Hey there [=
I just started using arduino, and successfully applied the date-reset workaround for making my arduino uno [smd edition] work with my windows 8 laptop. I'm using a german book called "prototyping interfaces" and downloaded code and electronic assembly instructions from the related webpage www.prototypinginterfaces.com
Every time I upload a sketch to the board, the compiling takes one or two minutes and I get the following error message:
Couldn't determine program size: null
I don't know if this is relevant for my problem, but I wanted to post it anyway. The 'Hello World' blinking sketch worked fine, so I suppose it's no real problem.
Now this is the code I downloaded:
// global variables
// Button attached to pin 2
int ButtonPin = 2;
// LED attached to pin 13
int LEDPin = 13;
// current status of button
int ButtonState = 0;
void setup()
{
// initialize LEDPin as OUTPUT:
pinMode(LEDPin, OUTPUT);
// initialize ButtonPin as INPUT:
pinMode(ButtonPin, INPUT);
}
void loop()
{
// write value from ButtonPin into ButtonState
ButtonState = digitalRead(ButtonPin);
// if ButtonState is HIGH
if (ButtonState == HIGH)
{
// LED = ON
digitalWrite(LEDPin, HIGH);
}
// if ButtonState is LOW
else
{
// LED = OFF
digitalWrite(LEDPin, LOW);
}
}
and this is the electronic assembly:
Instead of turning on when the button is pressed, and off when the button isn't pressed, the LED just blinks two times short, waits a second, then turns on for around a minute, then repeats all this. It doesn't react at all to the button. I also rotated and exchanged the button for another one, but nothing changed.
Maybe it's just a stupid mistake, but I can't make it out and also did not find anything with google, so maybe someone can help. thanks!