void loop() {
// put your main code here, to run repeatedly:
#define LED_PIN 13
int state;
void setup ()
{
pinMode(LED_PIN, OUTPUT);
state = 0;
}
void loop ()
{
digitalWrite(LED_PIN, state);
state = !state;
delay (225);
}
1Preformatted text
}
Unedited code copypasted from original pdf:
#def ine LED PIN 13
int s t a t e ;
void se tup ( )
{
pinMode (LED PIN , OUTPUT) ;
s t a t e = 0 ;
}
void l o o p ( )
{
d i g i t a lW r i t e (LED PIN , s t a t e ) ;
s t a t e = ! s t a t e ;
d el a y ( 2 2 5 ) ;
}
Error message:
^
exit status 1
a function-definition is not allowed here before '{' token
I tried both the "run once" and "run repeatedly" options, and have messed with the spacing and brackets. This is not my work but is a school assignment in which we try to replicate some code given to us, I would post the original pdf but the forum won't let me.
Cheers.