Micro motor 16 problem

Hello Sir

i have some problem in my arduino program i cant solve this erro . plzz i am a new with arduino. i want to rorate micro motor 16 using arduino uno. but error occurs in progrma. plzz solve this. thanks here i attach my progrma..

final_without_commetn.ino (11.5 KB)

You would get better responses if you started a new thread and made a mention of exactly what you are trying to do in the title of your post.. That way people most familiar with the specific objective you have will be most likely to read it. Also don't forget to speak of the error you're getting, that is pretty pertinent information for someone to be able to help you!

At a glance I see you have two void setup()'s. You can only have one. And what version of Arduino are you programming with? I have 1.0.1 and it's saying wire.receive has been renamed to wire.read - Also some variables are defined twice, you can only initially define a variable once (eg. BYTE minute;)

Thread split. Please don't just tack on a completely different question (one which I am having trouble understanding) onto an existing thread. Also:

Read this before posting a programming question

What is a 'micro motor 16'?

How is it connected to your Arduino?

Where in your sketch is it referenced?

Why do you have two setup() functions?

Why do both setup()s and loop() all define local hour and minute variables?

void loop()
{byte minute;
byte hour;
if (minute=00)
{

Tools + Auto Format is your friend. USE IT!

minute and hour are local variables. They are not initialized. They are never valued. Why would you expect them to contain any specific values?

Why are you assigning (=) a value here, instead of testing (==) the value?

I do believe it would be a good idea to set a pin LOW now and then.

if (minute=00)

That condition will never be true.

if (minute=01)

That one always will be.

if (hour=08)

What they all said about comparisons vs. assignments PLUS "8" is not a valid octal digit. :wink:
Same for "9".

This tripped me up when I first started c coding because I was coming from programming in other languages. As the others have said, you're using a defining syntax (one =) when trying to read a value. For example:

int a = 10;
if ( a = 10 ) { Serial.println ("A is 10."); }

is incorrect; You do not receive an error because it is a syntax, just not the syntax you want. When you are reading a variable or comparing it, you need a double equals. The correct syntax would be:

int a = 10;
if ( a == 10 ) { Serial.println ("A is 10."); }

Notice the single equals is used when placing a value in the variable, a double equals is used when reading or comparing to it. I've seen it said to help remember, imagine the double equals as a seesaw, comparing weights (or values) of each side.