HELP Propeller
gdibarra
Posts: 10
in BASIC Stamp
How do i make a parallax propeller run with a three push button circuit?
Comments
' according to the input of 3 switches
swx PIN 1
swy PIN 7
swz PIN 11
' which should follow a truth table of 3 variables (x & y & z) reading either 1 or 0.
DO
'So x=0 & y=0 & z=0
IF (swx=0) AND (swy=0) AND (swz=0) THEN LOW led1 ' x+y+z= 0 = false = LED stays off
'So x=0 & y=0 & z=1
IF (swx=0)AND (swy=0)AND (swz=1) THEN LOW led1 ' x+y+z= 0= false = LED stays off
' So x=0 & y=1 & z=0
IF (swx =0) AND (swy = 1)AND (swz=0) THEN HIGH led1 ' x+y+z = 1 = true = LED turns ON
' So x=0 & y=1 & z=1
IF (swx = 0) AND (swy = 1)AND (swz=1) THEN HIGH led1 ' x+y+z = 1 = true = LED turns ON
'So x=1 & y=0 & z=0
IF (swx=1) AND (swy=0) AND (swz=0) THEN LOW led1 ' x+y+z=0 = false = LED stays off
'So x=1 & y=0 & z=1
IF (swx=1) AND (swy=0) AND (swz=1) THEN LOW led1 ' x+y+z=0 = false = LED stays off
' So x=1 & y=1 & z=0
IF (swx = 1) AND (swy = 1) AND (swz=0) THEN HIGH led1 ' x+y+z = 1 = true = LED stays on
' So x=1 & y=1 & z=1
IF (swx = 1) AND (swy = 1)AND (swz=1) THEN LOW led1 ' x+y+z+=0= False = LED stays off
LOOP
So you've been able to turn an LED on and off and now you want to control a motor the same way. The problem is that a motor needs a lot of current to work and a Stamp I/O pin can only supply about 20mA. Look at Nuts and Volts column #6 for a discussion of this along with a number of solutions, all involving an external transistor or IC that is controlled by a Stamp pin using a small amount of current and in turn controls the much larger current needed by the motor.
Can you supply a picture or schematic please?
Your BASIC Stamp Kit should have come with the "What's a Microcontroller?" (WAM) text that Mike mentioned.
"Salvo" sounds similar to Servo and the Horn does resemble an airplane propeller.
Chapter 4 which starts on page 93 shows how to use a servo.
https://www.parallax.com/sites/default/files/downloads/28123-Whats-a-Micro-v3.0.pdf
You can also look up commands in the BASIC Stamp Manual.
https://www.parallax.com/sites/default/files/downloads/27218-Web-BASICStampManual-v2.2.pdf