I have converted the original code into PicBasic Pro format and also extended the code to accept 0-15 output. [The original one only accept from 0-11] Can anyone check the code for me? Is it correct?
'Speech Recognition Interface - PIC16F84A
'PicBasic Pro
'Version 1.3
trisa = 255
trisb = 240
p var byte
start:
p = portb
if p.4 = 1 then goto start
pause 500
p = portb
if p.5 = 1 then send
goto start
send:
p = porta
if p.4 = 1 then odd
portb = p
goto start
odd:
if p.0 = 0 then even
if (p.1 = 0) and (p.2 = 0) and (p.3 = 0) then portb = 11
if (p.1 = 1) and (p.2 = 0) then portb = 13
if (p.1 = 0) and (p.2 = 1) then portb = 15
if (p.1 = 1) and (p.2 = 1) then portb = 15 '17 originally.
if p.3 = 1 then portb = 15 '19 originally.
goto start
even:
if (p.1 = 0) and (p.2 = 0) and (p.3 = 0) then portb = 10
if (p.1 = 1) and (p.2 = 0) then portb = 12
if (p.1 = 0) and (p.2 = 1) then portb = 14
if (p.1 = 1) and (p.2 = 1) then portb = 15 '16 originally.
if p.3 = 1 then portb = 15 '18 originally.
goto start
end
Bookmarks