Really basic question
Hank
Posts: 2
I have a really basic question. I have a BOE with a BS2 and I have connected a LED between P0 and Vdd. When I run the following example code.......
' HIGH_LOW.BS2
' This simple program sets I/O pin 0 high for 1/2 second and low for
' 1/2 second in an endless loop. Connect an LED to P0 for a simple
' blinker.
' {$STAMP BS2}
Main:
DEBUG "Setting HIGH 0"
HIGH 0
PAUSE 5000
DEBUG "Setting LOW 0"
LOW 0
PAUSE 5000
GOTO Main
END
In my debug window I see "Setting HIGH 0" and the LED goes off, then "Setting Low 0" and the LED goes on. Also with a multimeter I get 0 volts across P0 and Vdd after the "Setting HIGH 0" and 5v after the "Setting Low 0".
The Command Reference manual states in the "HIGH" section "The HIGH command sets the sepecified pin to a 1 (a +5 volt level)"
Now I am confused.
Thanks
Hank
' HIGH_LOW.BS2
' This simple program sets I/O pin 0 high for 1/2 second and low for
' 1/2 second in an endless loop. Connect an LED to P0 for a simple
' blinker.
' {$STAMP BS2}
Main:
DEBUG "Setting HIGH 0"
HIGH 0
PAUSE 5000
DEBUG "Setting LOW 0"
LOW 0
PAUSE 5000
GOTO Main
END
In my debug window I see "Setting HIGH 0" and the LED goes off, then "Setting Low 0" and the LED goes on. Also with a multimeter I get 0 volts across P0 and Vdd after the "Setting HIGH 0" and 5v after the "Setting Low 0".
The Command Reference manual states in the "HIGH" section "The HIGH command sets the sepecified pin to a 1 (a +5 volt level)"
Now I am confused.
Thanks
Hank
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pi Guy
Thanks a lot.
Hank
Always remember that a voltage -- any voltage -- is a DIFFERENCE in potential between two points, one of which is often the circuit's GROUND. But you're measuring between Vdd and the output pin, and neither of these is ground, although the output pin gets reasonably close to ground when it's LOW.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
· -- Carl, nn5i@arrl.net