Thanks for all the guidance regarding the post on bluetooth! I was able to overcome that error, however another one has occur.
char b;
char string0='W';
char string1='A';
value0 = analogRead(flexPin0); //Read and save analog value from potentiometer
value0 = map(value0, 700, 900, 0, 255);//Map value 0-1023 to 0-255 (PWM)
delay (100);
value1 = analogRead(flexPin1);
value1 = map(value1, 700, 900, 0, 255);//Map value 0-1023 to 0-255 (PWM)
delay (100);
if (value0 >= 620)
{
b=string0;
Serial.println(b);//Read and save analog value from potentiometer
} else if (value1 >=620)
{
b=string1;
Serial.println(b);//Read and save analog value from potentiometer
}
So the above is just segments of my overall code. As seen, value0 and value1 will be the value of sensors and once it reaches 620, the char b will be equal to string0 or value1, which holds the character 'W' and 'A'. However, it does not show up in the serial monitor.
value0 = analogRead(flexPin0); //Read and save analog value from potentiometer
Serial.println(value0); //Print value
if (value0 >= 620)
{
b=string0;
Serial.println(b);
}
This is the previous code that I used, and it works. However, during this stage, I was only using one sensor, where as now I am using four. Can someone help as to why the upper code will not print the char b?
value0 = analogRead(flexPin0); //Read and save analog value from potentiometer
Serial.println(value0); //Print value
if (value0 >= 620)
{
b=string0;
Serial.println(b);
}
If so, then why did this code work ?? All the parameters are the same.