Many thanks, worked a treat but doesn't cover inputing data from portA or logical operators for data decisions. But it's a neat step forward.Originally Posted by paul borgmeier
Tim
Many thanks, worked a treat but doesn't cover inputing data from portA or logical operators for data decisions. But it's a neat step forward.Originally Posted by paul borgmeier
Tim
Timmoore47:
You will want to map port A and port B with the "symbol" command like:
Symbol PortA = 5
Then read it:
peek PortA,B0 'read PortA into Byte0 variable
If the LEDS are on port B, then map PortB with Symbol and Poke PortB,B0
Note the number of pins on PortA, you might not need to wire LEDs to all of port B.
Hi timmoore47,
How many switches?
I use 2 approaches.
If I have plenty of pins to use, I prefere binary switching to a pic as its fast and easy to implement.
If I am short of pins, I use POT or A/D.
For Pics that don't have A/D, I use the POT command.
I set up buttons in a resistive divider ladder.
Then I have the PIC talk to my PC serialy.
I press each button to see what the pic is getting for POT or A/D readings and then using those values, the next step is to code where to go in the rest of the program, based on these readings.
Hope this helps
dw_picbasic
Bookmarks