Hello, I want to program a flex sensor that when it bends a certain degree, turns a different colour with the rgb light. I've just verified it when it turns red and i've already gotten an error..
I keep getting an error saying that i need an expected primary expression before the equals sign on the "if" line...Any suggestions?
void setup();
void loop()
{
int flex = A0;
int rpin =11;
int gpin = 9;
int bpin = 10;
int val;
int sensor, degrees;
// read the voltage from the voltage divider (sensor plus resistor)
sensor = analogRead(0);
// convert the voltage reading to inches
//the first two numbeers are the sensor values for straight (768) and bent (853)
// the second two numbers are the degree readings we'll map that to (0 to 90 degerees)
degrees = map(sensor, 768, 853, 0, 90);
{
if (degrees) = < 50
//pinMode( rpin, OUTPUT);
//digitalWrite(rpin, HIGH);
//delay(400);
//digitalWrite(led, LOW);
//delay(400)
}
Thanks in advance..I know it is probably something really simple