Hello All,
I just started with Arduino and with programing.
My problem is that I need to increment the output to a servo (LFoot) by 1 in an if statement.
When the result of the if statement is a number or just the servo name (LFoot) then all works, but when I add a 1 to the name I get an
error: no match for 'operator+' in 'LFoot + 1.
Thanks for any assistance
Dave
This is my code
#include <Servo.h>
Servo LFoot;
int LLToe=15; //selects input pin for left foot left toe sensor input
int LRToe=14;
int ValueLLToe; //variable to store the value coming from the sensor
int ValueLRToe;
void setup()
{
// Attaches names of servos to specific pins of controler
//Fett plug
LFoot.attach(12);//Roll in max 155, Roll out max 40, center 98
int LFoot(98);
}
void loop ()// To stand
{
//Left plug
ValueLLToe = analogRead(LLToe);
ValueLRToe = analogRead(LRToe);
if (ValueLLToe < ValueLRToe)
{
LFoot = LFoot ;
}
else
{
LFoot=LFoot+1;
}
}