hello,
i am trying to make a code for a scale model car with leds and buttons (i have no idea if the rest of the code works, right now i am stuck on this part).
after adding the part in void BlinkerL() {
it gave this error:
/usr/local/bin/arduino-cli compile --fqbn arduino:avr:uno --build-cache-path /tmp --output-dir /tmp/568108045/build --build-path /tmp/arduino-build-D9A8B889F901E57BA79C33613DA902C0 --library /mnt/create-efs/webide/95/f8/95f8f1688db0c02612a584e50cd0020e:jasper1234567890/libraries_v2/ServoEasing /tmp/568108045/1968
In file included from /home/builder/.arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino/Arduino.h:32:0,
from /tmp/568108045/1968/1968.ino:1:
/home/builder/.arduino15/packages/arduino/hardware/avr/1.8.6/cores/arduino/binary.h:31:12: error: expected unqualified-id before numeric constant
#define B1 1
^
/tmp/568108045/1968/1968.ino:32:5: note: in expansion of macro 'B1'
int B1 = 0;
^~
/tmp/568108045/1968/1968.ino: In function 'void BlinkerL()':
/tmp/568108045/1968/1968.ino:57:12: error: lvalue required as left operand of assignment
if (B1 = 0) { B1 + 1;}
^
/tmp/568108045/1968/1968.ino:58:17: error: lvalue required as left operand of assignment
else if (B1 = 1) { B1 - 1;}
^
/tmp/568108045/1968/1968.ino:59:17: error: lvalue required as left operand of assignment
while (B1 = 1) { digitalWrite(BL, HIGH); delay(500); digitalWrite(BL, LOW); delay(500); }
^
/tmp/568108045/1968/1968.ino: At global scope:
/tmp/568108045/1968/1968.ino:62:1: error: expected declaration before '}' token
}
^
Error during build: exit status 1
it says it needs a declaration of somekind before '}' but in the code it doens't create that red error line, so i have no idea where or what to add. (i tried restarting the program but that didn't help)
why change B1 to BlinkerState? that is just more typing and reading.
isn't this what i wrote but just said in a different way?
and a second question, will this function (the while) be seperate from the rest of the code? that i can still perform other functions without the delay being in my way.
(i hope you understand what i am trying to say)