Duh! <smacks forehead> my switch routine had a LCD clear command in it.
Duh! <smacks forehead> my switch routine had a LCD clear command in it.
Good day
I'm a picbasic newbie i'd like to ask these syntaxes do?
AMPMFlag=AMPMFlag^1 '>>>>>>>>>>>>>>>>>>>what does this do?
Lc var byte [15]
For i = 0 to 15 : read i, b0:if b0 = 0 then
lookup i,[1,2,3,11,4,5,6,11,7,8,9,10,11,12,13,14], b0
Lc(i)=b0 '>>>>>>>>>>>>>>>>>>>>>>>>>>>what does this do?
goto Address
I would gladly appreciate for any response
thanks
ryan
AMPMFlag=AMPMFlag^1 '>>>>>>>>>>>>>>>>>>>what does this do?
AMPMFlag is a BIT variable.
All this does is toggle the BIT variable, if it was zero it will be set to 1, if it was 1 it will be set to 0. It is the equivallent of...
IF AMPMFlag=0 then
AMPMFlag=1
else
AMPMFlag=0
endif
Lc var byte [15]
For i = 0 to 15 : read i, b0:if b0 = 0 then
lookup i,[1,2,3,11,4,5,6,11,7,8,9,10,11,12,13,14], b0
Lc(i)=b0 '>>>>>>>>>>>>>>>>>>>>>>>>>>>what does this do?
Lc is a BYTE array 15 elements deep in the range Lc(0) to Lc(14)
You are loading Lc at array location i with the contents of variable b0
Thank you Mel,
I am incorporating your olympic timer in my medicine scheduler project I used some code snippets from les Johnson's book "experimenting with picbasic" I also read your thread with bits,byte, and arrray handling and found it intuitive!!!
I am still fixing my keypad routine to scan and output to LCD like a mobile fone does(",) I am trying to find a lcd menu routine for my display I will post it later on a new thread
thanks again
ryan
here is a chip that will give you 2 button's on one i/o
http://www.maxim-ic.com/quick_view2.cfm/qv_pk/4588
You seriously want to pay $1 for a 2 I/O expander?
If you need two buttons on one I/O, then you can achieve that with a different value of Capacitor on each of two Buttons and measure the time period for charge. Cost about 5 cents and a bit of magic in software...
You could also use the pot command and tie each button to a different value resistor.
This gives you the added ability of determining when both buttons are being pressed.
Bookmarks