very basic question for beginner
timparrish
Posts: 2
I am brand new to microcontrollers and programming. I have the "What's a Microcontroller?" book and am going through it. In the Digital Input - Pushbuttons section (chapter 3) I tested my pushbutton and it appears to work fine, but when I hook it up to the Basic Stamp I cannot get it to function the way it does in the book. The first activity is a very basic setup that is suppose to display in the Debug Terminal the state of the BS2 Input (1 or 0). The code is:
Vdd ---> pushbutton (pb) pin1; pb pin2 ---> 200ohm ---> BS2 P3; pb pin3 ---> 10k ohm ---> Vss.
In theory I'm suppose to see a 1 when the button is pressed and a 0 when not. In actuality, I see a 0 when not pressed and get nothing in the Debug Terminal when it is pressed.
Help would be greatly appreciated.
PAUSE 1000 DO DEBUG ? IN3 PAUSE 250 LOOPThe setup is:
Vdd ---> pushbutton (pb) pin1; pb pin2 ---> 200ohm ---> BS2 P3; pb pin3 ---> 10k ohm ---> Vss.
In theory I'm suppose to see a 1 when the button is pressed and a 0 when not. In actuality, I see a 0 when not pressed and get nothing in the Debug Terminal when it is pressed.
Help would be greatly appreciated.
Comments
DEBUG "top",CR
If you see that every time you press the button, then the Stamp is resetting.
With the program as given, there is no other way that I can think of that it would show nothing at all when the button is pressed.