hi,
i just got a ardunio uno -
setup a simple circuit with a photoresistor that controls a servo
code belo
#include <Servo.h>
Servo myservo;
int potpin = 0;
int val;
void setup()
{
myservo.attach(9);
Serial.begin(9600);
}
void loop()
{
val = analogRead(potpin);
val = map(val, 0, 900, 0, 179);
constrain(val, 0, 179);
Serial.println(val);
delay(25);
myservo.write(val);
delay(15);
}
i upload that code and open the serial monitor which starts printing out values.
the problem is that the serial sends data out but when there is a sudden large change in the value its sending tx freezes (the tx led either stays lit constant or goes out) and no data is being sent anymore - i have to unplug the usb and start again to get it sending again
i also tried reading with dotnet on com11 so make sure it wasnt a software issue and i got the same result
anyone know why this might be happening???
cheers,
mark