Arduinoにおける文法は標準C言語と特に変わりはありません。
●Example from Arduino Web Site
[c]
int gPWMval; // any function will see this variable
void setup()
{
// …
}
void loop()
{
int i; // "i" is only "visible" inside of "loop"
float f; // "f" is only "visible" inside of "loop"
// …
for (int j = 0; j <100; j++){
// variable j can only be accessed inside the for-loop brackets
}
}
[/c]