Hello,
My goal is to send collected data via FSR sensor between two board arduino via bluetooth.
I want to know if the created code can be correct or not. I couldn't test it because I haven't materials.
Can one help me and inform me if this code works? Results can be displayed in the serial monitor?
Really, I want your help this day (I have a deadline). Thank you in advance.
I created this code:
//sender_ code
int pin = 0; // the FSR and 10K pulldown are connected to a0
int data;
void setup() {
Serial.begin(9600);
}
void loop() {
data = analogRead(pin);
Serial.print("Pressure data= ");
Serial.println(data); // the raw analog reading
delay(1000);
}
//receiver_code
char inData;
String data;
void setup() {
Serial.begin(9600);
/// put your setup code here, to run once:
}
void loop() {
while(Serial.available()) {
inData = Serial.read();
Serial.print("Received data= ");
data += inData;
}
Serial.println (data);
delay(1000);
}