This is my very first time coding with an arduino, I just want a LED to blink, I've done the wiring correctly.
Here's the code:
void setup() {
// put your setup code here, to run once:
pinMode(13, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
{
pinMode(13, HIGH);
delay(1500);
pinMode(13, LOW);
delay(1500);
}}
Problem is that it only blinks when I reset it and it doesn't turn on/off for 1.5 seconds, it blinks 3 times quickly, The same as the orange little LED on the arduino.
I've tried changing 'pinMode(13, OUTPUT);' to 'pinMode(13, INPUT);' too,
same thing.
What can I do to fix this?
Read the forum guidelines. Post code in code tags.
Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.
Here is your code formatted and posted in code tags.
void setup()
{
// put your setup code here, to run once:
pinMode(13, OUTPUT);
}
void loop()
{
// put your main code here, to run repeatedly:
pinMode(13, HIGH);
delay(1500);
pinMode(13, LOW);
delay(1500);
}
Extra curly brackets removed.
pinMode() is an initialization, for changing an output use digitalWrite()