Hello,
I am using the ARDUNIO MEGA2560 with SMART GPU2 LCD display. Here is my code.
#include <SMARTGPU2.h> //include the SMARTGPU2 library!
SMARTGPU2 lcd; //create our object called LCD
/////////////////////////// Analog read
int sensorPin = A0; // select the input pin for the potentiometer
int sensorValue = 0; // variable to store the value coming from the sensor
///
void setup() {
//Those two functions must always be called for SMARTGPU2 support
lcd.init(); //configure the serial and pinout of arduino board for SMARTGPU2 support
lcd.start(); //initialize the SMARTGPU2 processor
// end GPU2 Support
// COMMUNICATE WITH LCD DISPLAY
lcd.baudChange(BAUD6); // Set a fast baud!, always that we use touch functions is
}
void loop() {
int inChar;
AnalogMenu();
}
void AnalogMenu (void)
{
sensorValue = analogRead(sensorPin);
lcd.setTextColour(CYAN);
lcd.setTextSize(FONT2);
lcd.printNumber(10, 150, sensorValue);
}
The display always shows 1023. No matter what the Analog input is.
If I remove the Smart GPU2 LCD display and remove all the lines in the program that refers to it.
and then have the MEGA2560 to send out the data on the RS232, then I get the correct value.
There is a conflict somewhere but I can not find it.
Any Ideas would be appreciated.
Thanks
Bobby