this is the circuit and the program.....
#picaxe 40x1 'type of the microcontroller used
setfreq m8 'setting up the frequency to 8Mhz
symbol x=198
b1=x
main:
b1= 198
high portb 7
serout 7,T9600_8,(254,1) 'clear the screen
serout 7,T9600_8,(" Welcome To",254,192) 'display on screen the msg. "welcome to"
serout 7,T9600_8,(254,12) 'second line
serout 7,T9600_8,(" AMA Supermarket")
pause 3000
main2:
b1=198
serout 7,T9600_8,(254,1)
serout 7,T9600_8,(254,12)
serout 7,T9600_8,(254,212)
serout 7,T9600_8,("Confirm(*) Cancle(#)")
main3:
serout 7,T9600_8,(" Enter Your Budget",254,192)
serout 7,T9600_8,(" BD ")
serout 7,T9600_8,(254,13)
keypad:
if b1>200 then 'setting up the maximum digits in the budget
goto confirm
endif
'serout 7,T9600_8,(254,b1)
let dirsc=%11010100
let pins =%11010100
high portc 2 'for row 1'
low portc 4,6,7
if portc pin3=1 then 'check if number 1 is pressed
b2=1
serout 7,T9600_8,("1")
inc b1
elseif portc pin1=1 then 'check if number 2 is pressed
b2=2
serout 7,T9600_8,("2")
inc b1
elseif portc pin5=1 then 'check if number 3 is pressed
b2=3
serout 7,T9600_8,("3")
inc b1
else
b2=0
endif
pause 100
high portc 7 'for row 2'
low portc 2,4,6
if portc pin3=1 then 'check if number 4 is pressed
b2=4
serout 7,T9600_8,("4")
inc b1
elseif portc pin1=1 then 'check if number 5 is pressed
b2=5
serout 7,T9600_8,("5")
inc b1
elseif portc pin5=1 then 'check if number 6 is pressed
b2=6
serout 7,T9600_8,("6")
inc b1
else
b2=0
endif
pause 100
high portc 6 'for row 3'
low portc 2,4,7
if portc pin3=1 then 'check if number 7 is pressed
b2=7
serout 7,T9600_8,("7")
inc b1
elseif portc pin1=1 then 'check if number 8 is pressed
b2=8
serout 7,T9600_8,("8")
inc b1
elseif portc pin5=1 then 'check if number 9 is pressed
b2=9
serout 7,T9600_8,("9")
inc b1
else
b2=0
endif
pause 100
high portc 4 'for row 4'
low portc 2,6,7
if portc pin3=1 then 'check if number * is pressed then goto list
goto list
elseif portc pin1=1 then 'check if number 0 is pressed
b2=0
serout 7,T9600_8,("0")
inc b1
elseif portc pin5=1 then 'check if number # is pressed then goto main2
goto main2
else
b2=0
endif
pause 100
goto keypad
confirm:
high portc 4 'for row 4'
low portc 2,6,7
if portc pin3=1 then 'check if number * is pressed then goto RFID
goto list
endif
if portc pin5=1 then 'check if number # is pressed then goto main2
goto main2
endif
goto confirm
list:
serout 7,T9600_8,(254,1)
serout 7,T9600_8,(" Your Shopping List",254,192)
serout 7,T9600_8,(254,12)
RFID:
' let pins = %00000000
' setfreq m8
' if portc pin0=1 then\
setfreq m4
serin 0 ,N4800,b5
' endif
' serout 7,T9600_8,(#b5,254,192)
' setfreq m4
pause 1000
debug b5
pause 1000
goto RFID