Bean Easterling
New Member
Hi,
Hi I am using an OLED but it is not recieving any information from B.0 , it is just displaying 'serial OLED, www.picaxe.com. Can you help?
;128|129|130|131|132|133|134|135|136|137|138|139|140|141|142|143|
;192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|
#picaxe 18m2
;output B0 - LCD
;output B6 - LED
;output B4 - LED
;output B5 - LED
;output B3 - LED
;output B2 - not using
;output B1 - buzzer
;output B0 - Piezobuzzer
;input C0 - button reset
;input C1 - BUTTON LAP
;input C2 - BUTTON COUNTDOWN
;input C3 - NOT USING
;input C4 - 10k RES TO 0V
;input C5 - NOT USING
;input C6 - button countup
;input C7 - not using
serout B.0,N2400,(254,1);set B.0, as output for LCD
let dirsC = %00000000 ;set pinsC as inputs or outputs
let dirsB = %11111111 ;set pinsB as inputs or outputs(pin B.0
symbol lappos = b0 ; number of keys pressed
symbol count_down = b4 ; value of key pressed
symbol start_time = b6
; *** reset position to zero ***
init:
let lappos = 0
let count_down = 0
let start_time = 0
pause 500 ; wait for display to initialise
serout B.0,N2400,(254,1) 'clear display
pause 30
serout B.0,N2400,(254,129) ; move to end of first line
serout B.0,N2400,("Press Button") ;first line of code
serout B.0,N2400,(254,193) ; move to end of first line
serout B.0,N2400,(" To Start ") ;first line of code
; *** now scan each row in turn ***
; *** by setting only 1 row (and LED) high ***
; *** if a switch is hit jump call score sub below ***
Buttons:
if pinC.0 = 0 then init 'clear display'
if pinC.1 = 0 then lap
if pinC.2 = 0 then countdown
if pinC.6 = 0 then starttime
goto Buttons
starttime:
pause 500 ; wait for display to initialise
serout B.0,N2400,(254,1) 'clear display
pause 30
serout B.0,N2400,(254,131) ; move to end of first line
serout B.0,N2400,("START TIME") ;first line of code
serout B.0,N2400,(254,197) ; move to end of first line
serout B.0,N2400,("000") ;first line of code
pause 500
starttime2:
let start_time = start_time+1
bintoascii start_time,b1,b2,b3
pause 1000
if pinC.0 = 0 then init 'clear display'
if pinC.1 = 0 then lap
if pinC.2 = 0 then countdown
if pinC.6 = 0 then starttime
serout B.0,N2400,(254,197) ; move to end of first line
serout B.0,N2400,(b1,b2,b3) ;first line of code
goto starttime2
lap:
let lappos = lappos +0
serout B.0,N2400,(254,1) 'clear display
pause 30
serout B.0,N2400,(254,133) ; move to end of first line
serout B.0,N2400,("LAPS") ;first line of code
lap2:
let lappos = lappos+1 ;add 1 to a lap
bintoascii lappos,b1,b2,b3
serout B.0,N2400,(254,192) ; move to end of first line
serout B.0,N2400,("Total Laps:",b1,b2,b3)
pause 500
Buttons2:
if pinC.0 = 0 then init 'clear display'
if pinC.1 = 0 then lap2
if pinC.2 = 0 then countdown
if pinC.6 = 0 then starttime
goto Buttons2
countdown:
let count_down = count_down+10 ;add 10 to count_down
serout B.0,N2400,(254,1) 'clear display
pause 30
serout B.0,N2400,(254,130) ; move to end of first line
serout B.0,N2400,("Count down") ;first line of code
bintoascii count_down,b1,b2,b3
serout B.0,N2400,(254,192) ; move to end of first line
serout B.0,N2400,("Total:",b1,b2,b3)
pause 500
goto Buttons3
countdown2:
let count_down = count_down-1 ;minus 1 from Count down
serout B.0,N2400,(254,130) ; move to end of first line
serout B.0,N2400,("Count down") ;first line of code
bintoascii count_down,b1,b2,b3
serout B.0,N2400,(254,192) ; move to end of first line
serout B.0,N2400,("Total:",b1,b2,b3)
If count_down =0 then Buttons
pause 500
Buttons3:
if pinC.0 = 0 then init 'clear display'
if pinC.1 = 0 then lap
if pinC.2 = 0 then countdown2
if pinC.6 = 0 then starttime
goto Buttons3
Hi I am using an OLED but it is not recieving any information from B.0 , it is just displaying 'serial OLED, www.picaxe.com. Can you help?
;128|129|130|131|132|133|134|135|136|137|138|139|140|141|142|143|
;192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|
#picaxe 18m2
;output B0 - LCD
;output B6 - LED
;output B4 - LED
;output B5 - LED
;output B3 - LED
;output B2 - not using
;output B1 - buzzer
;output B0 - Piezobuzzer
;input C0 - button reset
;input C1 - BUTTON LAP
;input C2 - BUTTON COUNTDOWN
;input C3 - NOT USING
;input C4 - 10k RES TO 0V
;input C5 - NOT USING
;input C6 - button countup
;input C7 - not using
serout B.0,N2400,(254,1);set B.0, as output for LCD
let dirsC = %00000000 ;set pinsC as inputs or outputs
let dirsB = %11111111 ;set pinsB as inputs or outputs(pin B.0
symbol lappos = b0 ; number of keys pressed
symbol count_down = b4 ; value of key pressed
symbol start_time = b6
; *** reset position to zero ***
init:
let lappos = 0
let count_down = 0
let start_time = 0
pause 500 ; wait for display to initialise
serout B.0,N2400,(254,1) 'clear display
pause 30
serout B.0,N2400,(254,129) ; move to end of first line
serout B.0,N2400,("Press Button") ;first line of code
serout B.0,N2400,(254,193) ; move to end of first line
serout B.0,N2400,(" To Start ") ;first line of code
; *** now scan each row in turn ***
; *** by setting only 1 row (and LED) high ***
; *** if a switch is hit jump call score sub below ***
Buttons:
if pinC.0 = 0 then init 'clear display'
if pinC.1 = 0 then lap
if pinC.2 = 0 then countdown
if pinC.6 = 0 then starttime
goto Buttons
starttime:
pause 500 ; wait for display to initialise
serout B.0,N2400,(254,1) 'clear display
pause 30
serout B.0,N2400,(254,131) ; move to end of first line
serout B.0,N2400,("START TIME") ;first line of code
serout B.0,N2400,(254,197) ; move to end of first line
serout B.0,N2400,("000") ;first line of code
pause 500
starttime2:
let start_time = start_time+1
bintoascii start_time,b1,b2,b3
pause 1000
if pinC.0 = 0 then init 'clear display'
if pinC.1 = 0 then lap
if pinC.2 = 0 then countdown
if pinC.6 = 0 then starttime
serout B.0,N2400,(254,197) ; move to end of first line
serout B.0,N2400,(b1,b2,b3) ;first line of code
goto starttime2
lap:
let lappos = lappos +0
serout B.0,N2400,(254,1) 'clear display
pause 30
serout B.0,N2400,(254,133) ; move to end of first line
serout B.0,N2400,("LAPS") ;first line of code
lap2:
let lappos = lappos+1 ;add 1 to a lap
bintoascii lappos,b1,b2,b3
serout B.0,N2400,(254,192) ; move to end of first line
serout B.0,N2400,("Total Laps:",b1,b2,b3)
pause 500
Buttons2:
if pinC.0 = 0 then init 'clear display'
if pinC.1 = 0 then lap2
if pinC.2 = 0 then countdown
if pinC.6 = 0 then starttime
goto Buttons2
countdown:
let count_down = count_down+10 ;add 10 to count_down
serout B.0,N2400,(254,1) 'clear display
pause 30
serout B.0,N2400,(254,130) ; move to end of first line
serout B.0,N2400,("Count down") ;first line of code
bintoascii count_down,b1,b2,b3
serout B.0,N2400,(254,192) ; move to end of first line
serout B.0,N2400,("Total:",b1,b2,b3)
pause 500
goto Buttons3
countdown2:
let count_down = count_down-1 ;minus 1 from Count down
serout B.0,N2400,(254,130) ; move to end of first line
serout B.0,N2400,("Count down") ;first line of code
bintoascii count_down,b1,b2,b3
serout B.0,N2400,(254,192) ; move to end of first line
serout B.0,N2400,("Total:",b1,b2,b3)
If count_down =0 then Buttons
pause 500
Buttons3:
if pinC.0 = 0 then init 'clear display'
if pinC.1 = 0 then lap
if pinC.2 = 0 then countdown2
if pinC.6 = 0 then starttime
goto Buttons3