Good Day fellow programmers,
I am new into the Arduino programming( as a hobby)
I did a few projects got some of the internet but I started to do my own as I go on,
So my latest project is a ultrasonic sensor that switches on a light bulb via a relay.
So that part I got it right and it is working perfectly.
I dug deeper and connected a LCD to display the distance what the ultrasonic sensor is picking up including when the light is on or off.
Now my problem is:
If I program the LCD to print ON/OFF I obviously get the error that none of those are defined in the scope.
I have no IDEA where to define that the digitalWrite on the pin must be equal to ON or OFF.
Can anyone please give me some ideas or as sits me on what I am doing wrong
See the attachment for the coding. I know the coding has a error, Its just to show what I am trying to accomplish.
Motion activated light with LCD.ino (3.01 KB)