I am trying to test out the Arduino and touchscreen to get an idea of how everything works together. I am using this as a reference: http://www.4dsystems.com.au/appnote/4D-AN-00015/
For now, all I am trying to do is get Leddigits0 to display a value of 5. From there I’ll continue to add more features I just want to make sure I have the basics down. The comms speed is 14400 on the workshop and same with my Arduino code. Right now nothing happens when I have the touchscreen and attached to the Arduino and the code running, a value of 000 is displayed as default when the touchscreen first turns on.
Essentially the only part of the code that should be triggered right now is:
genie.WriteObject(GENIE_OBJ_LED_DIGITS, 0x00, 5);
However it doesn’t appear to be sending anything to update the values on the screen.
Here is a full copy of my code:
#include <genieArduino.h>
Genie genie;
int tempC; //holds temperature readings in degrees Celsius
int tempF; //holds temperature readings in degrees Fahrenheit
int sensorPin = A0; //Vout of LM35 is connected to A0 of Arduino host
void setup()
{
Serial.begin(14400);
// a few options to talk to the Display, uncomment the preferred serial port and baud rate
// make sure that the ViSi Genie program has the same baud rate
genie.Begin(Serial); //Serial0
//Reset the Display (change D4 to D2 if you have original 4D Arduino Adaptor)
//See the app note 4D-AN-P4017-ViSi-Genie Connecting a 4D Display to an Arduino Host
//for information if using jumper connecting wires
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();
//tempC = ((5.0 * analogRead(sensorPin) * 100.0) / 1024) + 2; //signal level sampled from sensorPin is converted to a temperature value. Do calibration if needed.
genie.WriteObject(GENIE_OBJ_LED_DIGITS, 0x00, 5); //Write to Leddigits0 the value of tempC
delay(50);
//tempF = tempC * 9 / 5 + 32; //Convert temperature readings in degrees Celsius to degrees Fahrenheit
//genie.WriteObject(GENIE_OBJ_LED_DIGITS, 0x01, tempF); //Write to Leddigits1 the value of tempF
delay(50);
}
Here is a picture of my setup and what it looks like on from the workshop program: