hi, im newbie in this thing. i want to ask, i use two xbee to transmit data but in receiver i have no idea how to change string format so i can't use "FIle.write" command
the error output was : "no matching function for call to 'File::write(String&)'"
the output: invalid conversion from 'char*' to 'const uint8_t*'.
i just want to write a string from getData(). as i did before, without string in getData() i've success write it in txt
here's my entire code:
sender:
void setup()
{
Serial.begin(9600);
}
void loop()
{
for(int x = 0; x<10; x++){
int analogValue = analogRead(3);
int val = map(analogValue, 0, 1023, 253, 0);
Serial.println(val);
delay(1000);
}
while(true);
}
Perhaps what you really need to do is explain why you are wanting to use write() to store binary data in the file, when what you have is a String (that wraps a string) that contains ASCII data. Using the print() methods would make more sense to me.
PaulS:
Perhaps what you really need to do is explain why you are wanting to use write() to store binary data in the file, when what you have is a String (that wraps a string) that contains ASCII data. Using the print() methods would make more sense to me.
because if i'm using print() the data receive in serial monitor receiver is the ASCII data. i have to combine the sensor data with String time
because if i'm using print() the data receive in serial monitor receiver is the ASCII data.
I don't understand this statement. Perhaps you should show the Serial Monitor contents when you use print(), and explain what you expected to see, instead.
Although, really, the relationship between using print() to print to the Serial Monitor and using print() to write to the SD card escapes me.
i have to combine the sensor data with String time
Time shouldn't be in a String, so you shouldn't need to do this, either.