Hi im a complete newbie to arduino and this is basiclly my first program but couldnt find a soulution online.
this is my code:
//Blinking led
int ledPin = 13;
int switchPin = 8;
boolean lastButton = LOW;
boolean ledOn = false;
boolean currentLEDStatus = LOW;
void setup()
{
// difines if pins are input/output
pinMode(switchPin, INPUT);
pinMode(ledPin, OUTPUT);
}
//stops the led button from bouncing
boolean debounce(boolean last)
{
boolean current = digitalRead(switchPin);
if (last != current)
{
delay(5);
current = digitalRead(switchPin);
}
return current;
}
void loop()
{
//runs the bouncing removing scrpit
currentLEDStatus = debounce(lastButton);
//checks if button is pressed and what the last input to the led was
if (lastButton == LOW && currentLEDStatus == HIGH)
{
ledOn = !ledOn;
}
lastButton = digitalRead(switchPin);
digitalWrite(ledPin, ledOn);
}
when i run it get this error:
C:\Users\Nils\AppData\Local\Temp\build5312520591207345653.tmp/core.a(wiring.c.o): In function delay': D:\programfiler\Arduino\hardware\arduino\avr\cores\arduino/wiring.c:114: undefined reference to
yield'
collect2.exe: error: ld returned 1 exit status
Error compiling.
Btw my pc specs if it matters
intel i7 4810mq
gtx 880m with 8gb vram
16gb ram
1tb D: drive
128gb C: drive
please help i dont know what the heck is wrong so if somebody could reply that would be really helpful.