I was trying other ways I did change that to 0 but still the same.
This is what is coming out the serial port.
8⸮⸮!⸮
8⸮⸮!⸮
8⸮⸮!⸮
8⸮⸮!⸮
8⸮⸮!⸮
8⸮⸮!⸮
8⸮⸮!⸮
The baud rate is set to 9600 on the serial monitor,
Now this is a strange thing I tried this code below with the ADC routine removed and to make things more simpler.
#include <LiquidCrystal.h>// Highlight out when ready to use mian display
LiquidCrystal lcd(2, 4, 5, 3, 7, 8);
const byte numChars = 10; //Number of bits to get
float resistance = 12.36;
double floatVal = 23.01;
String stringVal = ""; //data on buff is copied to this string
typedef struct Data_struct {
int PRO3600_Disconnected = 10;
boolean No_data ;
char receivedChars[numChars]; // an array to store the received data
} Data_struct;
Data_struct myData;
void setup()
{
Serial.begin(9600);
lcd.begin(8, 2);
lcd.clear();
resistance = resistance - 40.36;
dtostrf(floatVal, 10, 2, myData.receivedChars); //4 is mininum width, 4 is precision; float value is copied onto buff
Serial.print("charVal: ");
for (int i = 0; i < sizeof(myData.receivedChars); i++)
{
Serial.print(myData.receivedChars[i]);
}
Serial.println();
dtostrf(resistance, 6, 2, myData.receivedChars); // L
Serial.print("dtstore: ");
Serial.print( myData.receivedChars[0]); //display string
Serial.print( myData.receivedChars[1]); //display string
Serial.print( myData.receivedChars[2]); //display string
Serial.print( myData.receivedChars[3]); //display string
Serial.print( myData.receivedChars[4]); //display string
Serial.print( myData.receivedChars[5]); //display string
Serial.print( myData.receivedChars[6]); //display string
}
void loop()
{
lcd.setCursor(0, 0);
lcd.print(resistance);
lcd.setCursor(0, 1);
lcd.print(myData.receivedChars[0]); //display string
lcd.print( myData.receivedChars[1]); //display string
lcd.print( myData.receivedChars[2]); //display string
lcd.print( myData.receivedChars[3]); //display string
lcd.print( myData.receivedChars[4]); //display string
lcd.print( myData.receivedChars[5]); //display string
lcd.print( myData.receivedChars[6]); //display string
}
This is what I get on the Serial monitor
charVal: 23.01
dtstore: -28.00
Not sure why it does or will not work when I just add this to the code in post 17.
I've just added this to the code from post 17 and get the same results.
dtostrf(stored2, 6, 2, myData.receivedChars); // L
Serial.print("dtstore: ");
Serial.print( myData.receivedChars[0]); //display string
Serial.print( myData.receivedChars[1]); //display string
Serial.print( myData.receivedChars[2]); //display string
Serial.print( myData.receivedChars[3]); //display string
Serial.print( myData.receivedChars[4]); //display string
Serial.print( myData.receivedChars[5]); //display string
Serial.print( myData.receivedChars[6]); //display string
⸮!⸮
⸮!⸮
⸮!⸮
⸮!⸮
⸮!⸮
⸮!⸮