Hardware Reference
In-Depth Information
Pulses pin 9 so that it's turned off 50% of the time.
atoi
Converts a string of numbers to an integer. With atoi , a string made up of
the characters “23” can be converted to the integer 23 to be used in arith-
metic. See “Converting ASCII Characters to Integers” on page 113 for more
information.
Syntax
atoi(stringNumber);
Parameters
stringNumber
An array of characters, such as those read from a file.
Return value
The integer value of the string.
Example
char number[] = "23";
int i = atoi(number);
number[] holds an array of characters: 2 and 3. atoi converts that into the
integer value 23.
const
Store a spot in memory to hold data that cannot be changed. See “Con-
stants” on page 81 . This might be helpful if you want to store a value in mem-
ory and you know that it should never be changed. Because the compiler will
stop and return an error if you try to change a const value, you'll know when
you've done something wrong in your code.
Example
const int potentiometerPin = 0;
Stores the integer 0 in a spot in memory called potentiometerPin . You will
not be able to change this value later in code.
delay
Pauses the execution of code for the specified number of milliseconds. See
“delay()” on page 39 .
Syntax
Search WWH ::




Custom Search