#include<Servo.h>
Servo steer1;
static int angle1 = 140;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
steer1.attach(7);
steer1.write(angle1);
}
void loop() {
Serial.println(angle1);
steer1.write(angle1);
int num = 0;
char c2 = 0;
int i = 3;
while (i > 0)
{
if (Serial.available() > 0)
{
Serial.println('b');
c2 = Serial.read();
Serial.println(c2);
if (c2 <= '9' && c2 >= '0')
{
if (i == 3)
{
num += 100 * (c2 - '0');
}
else if (i == 2)
{
num += 10 * (c2 - '0');
}
else
{
num += c2 - '0';
}
i--;
}
}
}