I have built a large model crane and am using picaxe to try and simulate realistic control and driver information read out.
The control of the motors is all sorted and working smoothly.
my problem is with the displays 3-20x4 lcds
my first problem is with the alarm sound on line 29 program works in pe6 simulation but not when connected
to board small speaker is connected as manual, pin B.6 -10 mf cap -speaker -0v, only the first tone is heard but skips second.
Can someone please help
Thanks Mike
;*** Boom angle-length display ***
; Note boom start length 24.6 mts each section increases length by 11.00 mts (35.6-46.6-57.6)
#picaxe 20X2
; 20x4 lcd display B.7
init:
setfreq M32 ;set speed
symbol baud = N4800_32
let b1 = 80 ; set alarm approaching max jib angle (amber led)
let b2 = 84 ; set max angle warning/cut out (red led, two tone alarm)
setup:
pause 1000
Serout B.7, Baud, (254,1,254,133,"GOTTWALD",254,153,"AMK500-93")
pause 50000
Serout B.7, Baud,(254,1,254,133,"boom Angle",254,200," Degree`s",254,153,"boom length",254,220," Metre`s")
pause 1000
main:
do
readadc B.2, b0 ; read angle sensor
serout B.7,Baud,(254,197,#b0," ") ; display angle
pause 30
if b0 => b1 then high B.0 else low B.0 endif ; approaching max angle alarm (amber)
if b0 => b2 then high B.1 ; max angle alarm (red)
sound B.6, (123, 100, 121, 100) ; sound audible alarm two tone
else low B.1 endif
readadc B.3,b4 ; read length sensor
let b5=b4/4 ; calculate
serout B.7,Baud,(254,217,#b5," ") ; display length
pause 30
loop
The control of the motors is all sorted and working smoothly.
my problem is with the displays 3-20x4 lcds
my first problem is with the alarm sound on line 29 program works in pe6 simulation but not when connected
to board small speaker is connected as manual, pin B.6 -10 mf cap -speaker -0v, only the first tone is heard but skips second.
Can someone please help
Thanks Mike
;*** Boom angle-length display ***
; Note boom start length 24.6 mts each section increases length by 11.00 mts (35.6-46.6-57.6)
#picaxe 20X2
; 20x4 lcd display B.7
init:
setfreq M32 ;set speed
symbol baud = N4800_32
let b1 = 80 ; set alarm approaching max jib angle (amber led)
let b2 = 84 ; set max angle warning/cut out (red led, two tone alarm)
setup:
pause 1000
Serout B.7, Baud, (254,1,254,133,"GOTTWALD",254,153,"AMK500-93")
pause 50000
Serout B.7, Baud,(254,1,254,133,"boom Angle",254,200," Degree`s",254,153,"boom length",254,220," Metre`s")
pause 1000
main:
do
readadc B.2, b0 ; read angle sensor
serout B.7,Baud,(254,197,#b0," ") ; display angle
pause 30
if b0 => b1 then high B.0 else low B.0 endif ; approaching max angle alarm (amber)
if b0 => b2 then high B.1 ; max angle alarm (red)
sound B.6, (123, 100, 121, 100) ; sound audible alarm two tone
else low B.1 endif
readadc B.3,b4 ; read length sensor
let b5=b4/4 ; calculate
serout B.7,Baud,(254,217,#b5," ") ; display length
pause 30
loop