Shop OBEX P1 Docs P2 Docs Learn Events
HELP Propeller — Parallax Forums

HELP Propeller

How do i make a parallax propeller run with a three push button circuit?

Comments

  • What do you mean by "three push button circuit"?
  • You posted in Propeller Forum. Do you require Basics Stamp or Propeller help.?
  • its for the BS2 Green Basic stamp kit. it came with a "Salvo" or what looks like a propeller. ( I apologize if its the wrong kind of forum). a three push button circuit representing AND gates. here is our code for lighting an LED except now he wants us to use the same gates to run a motor but we cant get the motor to run led1 PIN 14
    ' 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
  • weve replaced "HIGH" AND "LOW" with "PULSOUT" commands but its not doing the trick so i think its we simply dont understand how to connect the motor
  • The BS2 Basic Stamp Kit uses a Basic Stamp model BS2. I don't know what the "Salvo" is or what looks like a propeller, but the Propeller is a completely different microcontroller and you're in the proper forum. So you have 3 switches connected so that, when the button is pushed, an I/O pin is made logic 1 and logic 0 when the button is not pushed. The Stamp Manual shows how to hook up a pushbutton and resistor to ground and +5V (Vdd) to make that happen.

    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.

  • ElectrodudeElectrodude Posts: 1,660
    edited 2015-11-17 23:09
    Is a "Salvo" a servo motor? The horn that comes mounted on the axle sort of looks like a propeller?
  • If indeed you mean a servo motor rather than "Salvo", these are controlled with the PULSOUT statement. The motor has the additional transistors inside it. A hobby servo motor requires power (4-6V usually) and a control signal consisting of pulses at least one every 20ms. The width of the pulse tells the motor either the position to move to or the speed and direction. The pulses range from 1ms to 2ms in width with 1ms indicating one end of the range and 2ms indicating the other end. For continuous motion servos, 1ms is full speed in one direction and 2ms is full speed in the other direction with 1.5ms indicating stop. Look at the PULSOUT statement documentation and the "What's a Microcontroller?" text for details.
  • gdibarra wrote: »
    weve replaced "HIGH" AND "LOW" with "PULSOUT" commands but its not doing the trick so i think its we simply dont understand how to connect the motor

    Can you supply a picture or schematic please?

  • gdibarra,

    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
  • 72sonett72sonett Posts: 82
    edited 2015-11-23 19:34
    gdibarra wrote: »
    ... we simply don't understand how to connect the motor
    Get a Parallax relay board and connect that to the BStamp instead of the LED. With the relay board you can switch anything on and off (but not a servo...).

    27115.png?itok=nYB_rh80

Sign In or Register to comment.