code not write by me will not work???

Here is the code i am using but i give me an error each time i am very new at this and did not write this can some one fix it and re post it i am using an arduino nano on digital pin 13 as the output. and if you have seen this thanks for not saying any thing.

int ledPin = 13; // LED connected to digital pin 2 –the same pin as showed in the
//circuiting image

int free = 71250 // period of the signal in micro seconds, you can change the value if your want

void setup()
{
pinMode(ledPin, OUTPUT); // sets the digital pin as output
}

void loop() //the code with in this part is a infinite loop, when finishes, start the code again
{
digitalWrite(ledPin, HIGH); // sets the LED on
delayMicroseconds(free/2); // waits with the led on for a time half “free” variable
digitalWrite(ledPin, LOW); // sets the LED off
delayMicroseconds(free/2); // waits with the led off for a time half “free” variable
}

int free = 71250

Missing semicolon.

In future, please remember that it's better if you post the actual error the compiler gave, and also to use code tags when posting code.

Here is the error i was given. Where do i put the semicolon at? I apologies again im am very new to this just trying to get it working. Your help is greatly appreciated.

Arduino: 1.6.8 (Windows 7), Board: "Arduino Nano, ATmega328"

sketch_aug16c:6: error: 'int free' redeclared as different kind of symbol

int free = 71250 // period of the signal in micro seconds, you can change the value if your want

^

In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:23:0,

from sketch\sketch_aug16c.ino.cpp:1:

c:\program files (x86)\arduino\hardware\tools\avr\avr\include\stdlib.h:305:13: error: previous declaration of 'void free(void*)'

extern void free(void *__ptr);

^

C:\Users\Captain Jack\Documents\Arduino\sketch_aug16c\sketch_aug16c.ino: In function 'void loop()':

sketch_aug16c:16: error: invalid operands of types 'void(void*)' and 'int' to binary 'operator/'

delayMicroseconds(free/2); // waits with the led on for a time half “free� variable

^

sketch_aug16c:18: error: invalid operands of types 'void(void*)' and 'int' to binary 'operator/'

delayMicroseconds(free/2); // waits with the led off for a time half “free� variable

^

exit status 1
'int free' redeclared as different kind of symbol

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Where do i put the semicolon at?

If you look at the rest of the code, you'll see another line very similar to the one I pointed out, that does have a semicolon in the correct place.
Try to extrapolate from that.

Also "free" is not a good name to use, try something like "wastedTime" instead

Ok so i put it after the value? i tried and still getting errors. int ledPin = 13; is what i assume you are referring to? int free = 71250; is what i put and still getting same error. Im trying thank you for our pattenance.

Also "free" is not a good name to use, try something like "wastedTime" instead

still getting same error

In future, please remember that it's better if you post the actual error the compiler gave, and also to use code tags when posting code.

ok sorry again im figuring this out... slowly.
Im not sure what a code tag is...

change int free to int wastedtime and put the semicolon where it needed to be. now another error,

Arduino: 1.6.8 (Windows 7), Board: "Arduino Nano, ATmega328"

C:\Users\Captain Jack\Documents\Arduino\sketch_aug16c\sketch_aug16c.ino:6:18: warning: overflow in implicit constant conversion [-Woverflow]

int wastedTime = 71250; // period of the signal in micro seconds, you can change the value if your want

^

C:\Users\Captain Jack\Documents\Arduino\sketch_aug16c\sketch_aug16c.ino: In function 'void loop()':

sketch_aug16c:16: error: invalid operands of types 'void(void*)' and 'int' to binary 'operator/'

delayMicroseconds(free/2); // waits with the led on for a time half “free� variable

^

sketch_aug16c:18: error: invalid operands of types 'void(void*)' and 'int' to binary 'operator/'

delayMicroseconds(free/2); // waits with the led off for a time half “free� variable

^

exit status 1
invalid operands of types 'void(void*)' and 'int' to binary 'operator/'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

I'll try one more time

Also "free" is not a good name to use, try something like "wastedTime" instead

ok did what you said and it appears to be working but when i upload to the arduino i get this message and my led just turns on and stays on no flashing.

C:\Users\Captain Jack\Documents\Arduino\sketch_aug16c\sketch_aug16c.ino:4:18: warning: overflow in implicit constant conversion [-Woverflow]

int wastedTime = 71250; // period of the signal in micro seconds, you can change the value if your want

^

OK, sometimes the most obvious things take a while to spot.
71250 doesn't fit into a sixteen bit "int" - use "long" instead of "int".

my led just turns on and stays on no flashing.

It is flashing, but it is flashing too fast for you to see.

I see that worked to get rid of the error and i think you are spot on with it blinking too fast to see. So how do i slow it down to about 14hz or so? i have tried playing with the values but im sure im doing it wrong.

14 Hz?
Now there's a frequency to start doubting good intentions.

Work out how many microseconds in a 14 Hz cycle - that's not a programming issue, that's simple arithmetic.

no malicious intent. still not having luck? i used an online converter and got the same value as was already there im wondering now if the code is just not sufficient to do what im looking for it to do.

still not having luck

What does that mean?
All AVR processors are 100% inoculated against luck before they leave the factory.

Are you saying the LED isn't flashing, or that you can't see it flashing?

I'm going to guess that you don't have an oscilloscope to prove that it is flashing.

Try waving the LED around - if you see a dotted line, it's flashing.

lboster:
'int free' redeclared as different kind of symbol

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Do not use the he name "free" as an identifier name in your program!

In the C programming language the function name free is the name of a function to deallocate a memory bblock which had been allocated dynamically nbefore`.

Do not use the same identifier names in your program which are already used by the C standard-library or the C-language!

Yes i see they left all the luck at the factory! It just never made it to me hahaha. I could change the value by adding another 0 to the end causing the number to be 712500 and it would slow done enough to see the flashing. but still way too fast for 14hz. Thanks again though you really know your stuff!

lboster:
im wondering now if the code is just not sufficient to do what im looking for it to do.

Blame the code, the hardware, the weather, blame it all.

Also, when did you mention what it was you are trying to get it to do?

If you're trying to get it to visibly blink, there is 0 reason to use delayMicroseconds.

Just use delay(number);
and the number will be milliseconds, not microseconds. 1000 milliseconds = 1 second.
If you can't figure out 14 times a second with that, I would advise you hop over to Google and look for a different hobby.

i am trying to get the led light to blink at 14hz. the blink code in the arduino examples already gives the on and off values at miliseconds and doing the math i get 71.something something and its not working. and i have a way to text for the 14.035 hz i am trying to achieve just not a way to see where i am at in correlation to that number.

I'm still seeing traffic signal pre-emption.