I’m doing my first Picaxe project here, in which I am trying to light up 8 banks of 5 parallel LEDs in a sequence with a 20x2. Each bank of parallel LEDs is controlled by its own pin, through a 2N2222 transistor. I’m using pins B.0 through B.3 and C.0 through C.3. The problem I’m having is that when I tell a B pin to go low, it automatically loops back to the beginning of the program. For example:
Main:
High B.0
Pause 1000
Low B.0
Pause 1000
Goto main
This code makes the LEDs on B.0 go high for 1 second, then flash off briefly, then go high for 1 second, then flash off briefly, etc. This is the case with any B pin, but all C pins work fine.
However, when I write code to sequentially turn all pins high with a 1000 pause in between them, then turn all pins low sequentially with a 1000 pause in between them, everything works fine.
Clues: 1) it seemed to work fine on the solderless breadboard with a 4.5v power supply. 2) now it’s soldered into a perfboard with 4 AA NiMH batteries, and this is my first soldering job, but my soldering looks good, and multimeters out fine, as far as I can tell. I used a 20 pin socket. I tested it with the 4.5v power supply again instead of the batteries, to no avail. 3) The B pins all have blue LEDs. The C pins all have yellow LCDs. 4) I’ve got a 1k resistor between each pin and its transistor.
Thanks for any advice!
Brian Z
Main:
High B.0
Pause 1000
Low B.0
Pause 1000
Goto main
This code makes the LEDs on B.0 go high for 1 second, then flash off briefly, then go high for 1 second, then flash off briefly, etc. This is the case with any B pin, but all C pins work fine.
However, when I write code to sequentially turn all pins high with a 1000 pause in between them, then turn all pins low sequentially with a 1000 pause in between them, everything works fine.
Clues: 1) it seemed to work fine on the solderless breadboard with a 4.5v power supply. 2) now it’s soldered into a perfboard with 4 AA NiMH batteries, and this is my first soldering job, but my soldering looks good, and multimeters out fine, as far as I can tell. I used a 20 pin socket. I tested it with the 4.5v power supply again instead of the batteries, to no avail. 3) The B pins all have blue LEDs. The C pins all have yellow LCDs. 4) I’ve got a 1k resistor between each pin and its transistor.
Thanks for any advice!
Brian Z