Hi
I am using the PICAXE 20M project board. The LCD is connected to B4 and I am using C3 as an input. I get the stand PICAXE message on the LCD display when I have 2 power supplies (linked negative rail). I have run a code in basic on PICAXE.
C3 is pulled low with RA1.
I either get random symbols or a blank screen.
Thanks for any support
#picaxe 20M2
symbol inputPin = C.3 ' Define input pin
symbol lcdPin = B.4 ' Define LCD output pin
b0 = 0 ' Initialize counter variable
main:
if pinC.3 = 1 then ' Check if input is high
pause 200 ' Debounce delay
if pinC.3 = 1 then ' Confirm input is still high
if b0 < 20 then ' Count only up to 20
inc b0 ' Increment the counter
else
b0 = 0 ' Reset counter to 0 after reaching 20
endif
serout lcdPin, N2400, (254, 1) ' Clear LCD
serout lcdPin, N2400, ("Count: ")
serout lcdPin, N2400, (#b0) ' Display count on LCD
do while pinC.3 = 1 : loop ' Wait until input goes low
endif
endif
goto main ' Repeat loop
I am using the PICAXE 20M project board. The LCD is connected to B4 and I am using C3 as an input. I get the stand PICAXE message on the LCD display when I have 2 power supplies (linked negative rail). I have run a code in basic on PICAXE.
C3 is pulled low with RA1.
I either get random symbols or a blank screen.
Thanks for any support
#picaxe 20M2
symbol inputPin = C.3 ' Define input pin
symbol lcdPin = B.4 ' Define LCD output pin
b0 = 0 ' Initialize counter variable
main:
if pinC.3 = 1 then ' Check if input is high
pause 200 ' Debounce delay
if pinC.3 = 1 then ' Confirm input is still high
if b0 < 20 then ' Count only up to 20
inc b0 ' Increment the counter
else
b0 = 0 ' Reset counter to 0 after reaching 20
endif
serout lcdPin, N2400, (254, 1) ' Clear LCD
serout lcdPin, N2400, ("Count: ")
serout lcdPin, N2400, (#b0) ' Display count on LCD
do while pinC.3 = 1 : loop ' Wait until input goes low
endif
endif
goto main ' Repeat loop