OK here is what im trying to do.
I Have a SeeedStudio Tft Shield V1, NRF24 Radios Running on a Mega 2560 the other radio is trasmitting off a Micro.
the Tft is successfully running a simple touch Program just to turn and off leds. And is also Receiving streaming data .
I would like to convert it into a "Voltage" reading but im thinking i need to convert it to FLOAT.
Here is where it goes down hill . The TFT caon do eather String or Char Tft.drawString ,,Tft.drawChar
Ihave my Transmitter sending
char DATA[3]; // 2 element array holding DATA readings
void setup()
{
Serial.begin(9600);
radio.begin();
radio.openWritingPipe(pipe);
}//--(end setup )---
void loop()
{
DATA[0] = analogRead(DATA_X);
DATA[1] = analogRead(DATA_Y);
DATA[2] = analogRead(DATA_Z);
radio.write(DATA, sizeof(DATA));
and of course Receiver
if ( radio.available() )
{
bool done = false;
// while (!done)
{
// Fetch the data payload
done = radio.read( DATA, sizeof(DATA) );
//voltage = (DATA[0] * (14.7 / 1023.0));
Tft.fillRectangle(0,200,240,20,BLACK);
Tft.drawString(sensor3Char,2,200,2,WHITE);
With a COnvertion From
void getSensor(){
itoa(DATA[0], sensor3Char, 10);
}
Its great i have the Raw numbers comming in , But it would be nice to see a "13.50 Volts "
Any Ideas?
I was thinking maybe Change what is being sent, But it only seems to want the format of
radio.write(DATA, sizeof(DATA));
Been at it a couple of days now ,, Need a Different prespective Or different Web page to look at