
Originally Posted by
bearpawz
The info:
Using a pic 16F819, 20MHZ crystal oscilator
What I am trying to do:
I have 4 momentary pushbuttons with coresponding lamps. One is a "power" switch / lamp, the rest are one of three (ie, push one button and its lamp comes on, the others go off).
The "one of three" part works flawlessly.
My problem lies in the "Power" button. The unit defaults with power on and one other lamp lit. When I press the power switch, I want all lamps to go out until power switch is pressed again. (Simulating turn the whole unit off). For the LIFE of me I can not figure out what is going on with my code. Its not a debounce issue, ive tried puting in delays up to 10 seconds after the button is pressed and the unit insists on going back to the power up state. here is the code:
Hi Bearpawz,
You did not say what your circuit <b>IS</b> doing, or not doing. Since you are pulling PortB.0 up to signal your PIC, I ask if you remembered to pull it down with a resistor to logic low so as not to have a high impeadance on that pin? Lemmie guess, a controller for a dual purpose or B/W, yes?
JS
EDIT: WOW Sayzer slipped in just ahead of me ! Hi Sayzer !
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