Lowest price ever! Learn Generative AI for 48% less!
Get my discount0
What is wrong with my code
https://code.sololearn.com/c3MhDr4PSJlg/?ref=app // C++ code // const int LED =13; const int button = 7; void setup() { pinMode(LED,OUTPUT); pinMode(BUTTON,INPUT); } void loop() { val = digitalRead(BUTON); if(val = high); digitalWrite(LED,HIGH); else digitalWrit(LED,LOW); }
1 Answer
+ 1
Well, first of all, sololearn coding interface is an isolated space that doesn’t work with librarys like might you are using
So what is OUTPUT?
What is pinMode?
What is high?
What is Low?
What is digitalWrite?
Also u have a typo inside the if statement, if you’re comparing variables use ==, not = as it will assign. And another typo “;” after the if condition