a mysterious problem :)

Hello everyone! I bought an arduino starter kit and 3 days ago i started to "play" with it. Everything is ok with the 1st project. After that i built the circuit for the 2nd project, i wrote the code, uploaded the code and everything according to the projects book... But it didn't work! I spend a whole afternoon but nothing changed. If someone can help, it would be great. Thanks!!

Try loading an empty sketch

Void setup()
{}

Void loop()
{}

Weedpharma

it’s definitely a mystery!!! :wink:

Well at least for those of us that didn’t feel the need to buy the starter kit thus having no idea what project 2 could be…

Regards,

Graham

What project, What code, What kit, What book.

Mark

Is the code uploading? Are you getting an error message while uploading or does it say it's done?
Unplug everything from the Arduino and try the Blink example. Does it work?

Arduino Uno
project's name : "Spaceship Interface"
Arduino Projects book

You can find it in the products list :slight_smile:

Or just for the benefit of this exercise, you could post your code, and let us know what the problems are that you're having!! Assuming you are looking for help that is....... :wink:

Graham

@Shpaget
I tried the Blink example http://prntscr.com/5ejhhu

@ghlawrence2000

int switchState=0;
void setup(){
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
pinMode(2,INPUT);
}

void loop(){
switchState=digitalRead(2);

if (switchState==LOW){
digitalWrite(3,HIGH);
digitalWrite(4,LOW);
digitalWrite(5,HIGH);
}

else{
digitalWrite(3,LOW);
digitalWrite(4,HIGH);
digitalWrite(5,HIGH);

delay(250);
digitalWrite(4, HIGH);
digitalWrite(5,LOW);
delay(250);

}
}

Hi,
Wasted a whole afternoon trying to get code and hardware working!! That's nothing, you're just starting...

And as the other chaps have ask we need your code AND schematic, even if pencil drawn. We don't have the book and have better things to do then go and look it up, for YOUR benifit! How is the switch connected does the resistor? go to 5v or GND?

Regards

Mel.

It is the old out of sync problem......

Not a code problem. So I am guessing, it is a clone UNO?

Graham

ghlawrence2000:
It is the old out of sync problem......

Not a code problem. So I am guessing, it is a clone UNO?

Graham

I would sooner attribute it to a wrong COM port.
Try changing it.

int switchState=0;
void setup(){
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
pinMode(2,INPUT);
}

void loop(){
switchState=digitalRead(2);

if (switchState==LOW){
digitalWrite(3,HIGH);
digitalWrite(4,LOW);
digitalWrite(5,HIGH);
}

else{
digitalWrite(3,LOW);
digitalWrite(4,HIGH);
digitalWrite(5,HIGH);

delay(250);
digitalWrite(4, HIGH);
digitalWrite(5,LOW);
delay(250);

}
}

Check the circuit here: Screenshot by Lightshot

It's not a clone UNO :slight_smile:

Have you tried changing the COM port in Tool -> Serial Port?

I have changed the port but nothing changed…

can anyone expalain the txt below?

avrdude: stk500_getsync(): not in sync: resp=0x00

It’s the “out of sync” problem? Someone mentioned that before?

Difag13:
I have changed the port but nothing changed...

can anyone expalain the txt below?

avrdude: stk500_getsync(): not in sync: resp=0x00

It's the "out of sync" problem? Someone mentioned that before?

Hi,
Yes that means your program is not getting to your Arduino, because you have the wrong PORT set, or the wrong board, etc.

If we know this at the beginning! if you told us what "don't work" really ment, this post could be have been a lot shorter, and you would be up and running by now. Sorry but had the same thing twice in 3-4 days!!

Your code looks fine!
Regards

Mel.

Everything is OK guys... I changed COM and my code uploaded without problems

The code will not produce an out of sync error like this. It means that the computer is not even finding your arduino. This can be because of wrong settings like has been said or a faulty USB lead or a faulty arduino.