4D system 28PTU touchscreen + arduno

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

Here is the example code

#include <genieArduino.h>

#include <DHT.h>

#define DHTPIN 2
#define DHTTYPE DHT22

DHT dht(DHTPIN, DHTTYPE);
int insideTempSensorC;
int insideTempSensorF;
Genie genie;
#define RESETLINE 4
void setup() 
{    Serial.begin(9600);
genie.Begin(Serial);

    genie.AttachEventHandler(myGenieEventHandler); // Event handler to process data coming from display

  pinMode(4, OUTPUT);  // Set D4 on Arduino to Output (4D Arduino Adaptor V2 - Display Reset)
  digitalWrite(4, 1);  // Reset the Display via D4
  delay(100);
  digitalWrite(4, 0);  // unReset the Display via D4
  
  delay (3500); //let the display start up
  dht.begin();
}

void loop() 
{ 
  static long waitPeriod = millis();
  
  //Read from sensor every 100ms and write to the display
  if (millis() >= waitPeriod) 
  {
    // PUT YOUR CODE HERE
    insideTempSensorC=(int)dht.readTemperature();;
    if(insideTempSensorC < 100) insideTempSensorC++; // replace with where you get your data from
    else insideTempSensorC = 0;
    
   genie.WriteObject(GENIE_OBJ_LED_DIGITS, 0, insideTempSensorC); // write insideTempSensorC value to LedDigit0
    
    insideTempSensorF = ((insideTempSensorC * 9) / 5) + 32; // Convert to Degress F
    genie.WriteObject(GENIE_OBJ_LED_DIGITS, 1, insideTempSensorF); // write insideTempSensorF value to LedDigit1
    
    genie.WriteObject(GENIE_OBJ_THERMOMETER, 0, insideTempSensorC); // write insideTempSensorC value to Thermometer0
    
    waitPeriod = millis() + 100; // rerun this code in another 100ms time. 
  }
  
  genie.DoEvents(); // Do this every loop, checks the input buffer for data from the display and runs myGenieEventHandler()
}

void myGenieEventHandler(void) 
{
  genieFrame Event;
  genie.DequeueEvent(&Event);

  //You dont need to do anything in here yet unless reading back from the display, such as from a button or slider or reading a value back etc
}

and here’s my code

#include <genieArduino.h>
#include <SD.h>
#include <math.h>
#include <SPI.h>

int analogPin = A3;
 float v400ppm = 4.51;   //MUST BE SET ACCORDING TO CALIBRATION
 float v40000ppm = 3.125; //MUST BE SET ACCORDING TO CALIBRATION````````````````````````
 float deltavs = v400ppm - v40000ppm;
 float A = deltavs/(log10(400) - log10(40000));
 float B = log10(400);
Genie genie;


void setup() {
  Serial.begin(115200);
genie.Begin(Serial);
genie.AttachEventHandler(myGenieEventHandler);

pinMode(analogPin, INPUT);
pinMode(4, OUTPUT);  // Set D4 on Arduino to Output (4D Arduino Adaptor V2 - Display Reset)
  digitalWrite(4, 1);  // Reset the Display via D4
  delay(100);
  digitalWrite(4, 0);  // unReset the Display via D4
  
  delay (3500); //let the display start up
}

void loop() {
   static long waitPeriod = millis();
  //int data = analogRead(analogPin); //digitise output from c02 sensor
  //float voltage = data/204.6;       //convert output to voltage

// Calculate co2 from log10 formula (see sensor datasheet)
  //float power = ((voltage - v400ppm)/A) + B;
  //int co2ppm = (int)pow(10,power);
  //Serial.println (co2ppm);
  if (millis() >= waitPeriod)
  {
    // PUT YOUR CODE HERE
   
  int data = analogRead(analogPin);
  float voltage = data/204.6;       //convert output to voltage
  float power = ((voltage - v400ppm)/A) + B;
  int co2ppm = pow(10,power);
  
  genie.WriteObject(GENIE_OBJ_LED_DIGITS, 0, co2ppm);
  waitPeriod = millis() + 500; // rerun this code in another 100ms time. 
  }
  
   genie.DoEvents(); // Do this every loop, checks the input buffer for data from the display and runs myGenieEventHandler()
}




void myGenieEventHandler(void) 
{
  genieFrame Event;
  genie.DequeueEvent(&Event);

  //You dont need to do anything in here yet unless reading back from the display, such as from a button or slider or reading a value back etc
}

Thanks !

check this out: http://forum.4dsystems.com.au/