No announcement yet.

Arduino Program 28PTU

  • Filter
  • Time
  • Show
Clear All
new posts

  • Arduino Program 28PTU

    Hi everyone !
    First of all sorry for my bad english i'm french , i hope you'll understand what i write

    So , i want to display my ppm of my c02 sensor. It works when i display it with the serial monitor , but now i'm tryin to display it on the touchscreen.
    I used an example code of DHT22 and the touchscreen , it worked. But i changed my code of C02 sensor and it didn't work

    Thanks !
    Attached Files
    Last edited by Ressatnom; 19 June 2015, 11:29 PM.

  • #2
    Nobody here?


    • #3
      In your loop code you have a print statement that needs to be commented creates a conflict with the display



      • #4
        Hi Ressatnom,

        You posted at our 7:39PM on Friday night, it is now 8:36AM Saturday morning - please be aware of time zone differences and we cannot reply outside our working hours.

        You have provided two Arduino Sketches. Why are there 2? Which one are you having problems with?

        As rcbandwidth said, you have a serial.print statement in the c02_4D.ino sketch in your main loop. You cannot use Serial.print statements on the same serial port you use to talk to your display, as it creates a conflict.
        Please read the STICKY post at the top of our Arduino section:

        Please provide your Workshop4 Program too, so we can see any other issues which you might have.
        Open your project in Workshop4, go to File, Zip Project. It will then create a ZIP file, which you need to attach to the forum.



        • #5
          Thank you for your answers!
          So , the 4D_DHT code is the code that i use as an example just to make sure that my Touchscreen works ! and the C02_4D is my code for my c02 sensor. I modify my code and delete my Serial.print but it's still not working .
          Edit : i changed my baudrates from 115200 to 9600 and it display wrong values in my display .. But when i choose a higher baudrates , it doesn't shows anything ..
          Attached Files
          Last edited by Ressatnom; 22 June 2015, 07:22 PM.


          • #6
            You have changed the Baud Rate in both your Arduino sketch, and in the Workshop4 Application, and compiled and downloaded I assume?
            How have you wired your display and Arduino up?
            Are you using a 4D Arduino Adaptor Shield, or have you wired it directly from Arduino to display?
            You have the display connected to Serial0 on the Arduino, which is also used for programming, so I assume you have been disconnecting the display when you program your Arduino?



            • #7
              Thanks i changed my baud rate in both , and it almost worked .. But there is a problem when ppm value is bigger than 32000 it display corrupt graphics ..
              of course that i disconnect the display when i program arduino
              Yes i use a 4D adaptator shield , and here's how i wired it :
              Arduino shield --> H1
              5V --> +5V
              Rx --> TX0
              Tx --> RX0
              GND --> GND
              RES --> RES
              Last edited by Ressatnom; 22 June 2015, 08:49 PM.


              • #8
                What you are sending to the display is a 16bit signed integer, so the maximum value displayable is 32767.

                What is the largest number you need to display?

                If you really need larger numbers you probably need to look at something like this