Sec.5.36
Hi Keith,
Looks like a classic IF THEN ELSE to me.
Code:
TRISB = %00001111 ' 4 upper as outputs 4 lower as inputs
IF PortB.0 = 1 THEN ' if true then goto next statement
PortB.4 = 1 ' turn on this port
ELSE ' goes to here if false
PortB.4 = 0 ' Turns this port off
ENDIF ' ends the if then test for true / false and allows code to continue
make sure to use resistors pulling down if you close switches to activate or pulling up if you open switches to activate.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Bookmarks