+ Reply to Thread
Results 1 to 5 of 5

Thread: Propeller Activity Board HELP

  1. #1

    Default Propeller Activity Board HELP

    Hi everyone, i'm new to the forum and also new to this programming activity board. I just recently got me an activity board and two hb-25 motor controller. I'm having trouble on how to get the motor to work on this board. This is the code that parallax provided as an example but i have no clue on it. Can someone please help me with it so i can understand. For the setup i have a motor connected to the hb 25 motorl terminal and a 6v battery connected to the battery terminal of the hb 25 motor control. Then i connect the hb 25 using a servo cable to the activity board to pin 15. Please let me know if i have the connect right .Thank you and this is the example code:

    /*
    Two DC Motors 60 Percent.c

    Version 0.94 for use with SimpleIDE 9.40 and its Simple Libraries

    Drive a pair of DC motors at 6/10 of full speed.
    http://learn.parallax.com/propeller-c-tutorials
    */

    #include "simpletools.h"

    int main()
    {
    // Keep pins low if unused.
    set_outputs(5, 2, 0b0000);
    set_directions(5, 2, 0b1111);

    // Start PWM process. Period 1 ms, Freq 1 kHz
    pwm_start(1000);
    // Turn motors counterclockwise for 3 s.
    pwm_set(3, 0, 600);
    pwm_set(4, 1, 600);
    pause(3000);

    // Stop for 1 second.
    pwm_set(3, 0, 0);
    pwm_set(4, 1, 0);
    pause(1000);

    // Turn motors counterclockwise for 3 s.
    pwm_set(2, 0, 600);
    pwm_set(5, 1, 600);
    pause(3000);

    // Stop again
    pwm_set(2, 0, 0);
    pwm_set(5, 1, 0);
    // End the PWM process
    pwm_stop();
    }

  2. #2

    Default Re: Propeller Activity Board HELP

    The HB-25 is controlled like a CR servo. The code you posted looks like it for a motor controlled by a conventional H-bridge.

    You could use normal ActivityBot code to drive the HB-25 since the ActivityBot uses CR servos to get around.

    I haven't used C on the Propeller much but I could find what "set_outputs" does by looking at this page.

    I don't think you'll need to use these same function to use the HB-25. You'll want to use the functions normally used to control servos.

  3. #3

    Default Re: Propeller Activity Board HELP

    I also don't use C for anything but edification. There is a standard in your SimpleIDE examples folder, "Standard Servo Position.side." You just need to set the pin to 15 rather than 16. I haven't tried this but if you adjust the pause to 5ms? I think you can drive your connected HB25's with one pin.

  4. #4

    Default Re: Propeller Activity Board HELP

    Thanks for the advice. I try to use the normal activity coding for servo and switch it to pin 15 but still didn't work. i use the example code:
    /*
    Standard Servo Position.c Moves servo to 0, 90 and 180 degrees. Holds each position for 2 s. Connect servo to P16 port on Propeller Activity Board.*/
    #include "simpletools.h" // Include simpletools header
    #include "servo.h" // Include servo header
    int main() // main function
    {
    servo_angle(15, 0); // P15 servo to 0 degrees
    pause(3000); // ...for 3 seconds
    servo_angle(15, 900); // P15 servo to 90 degrees
    pause(3000); // ...for 3 seconds
    servo_angle(15, 1800); // P15 servo to 180 degrees
    pause(3000); // ...for 3 seconds
    servo_stop(); // Stop servo process
    }

  5. #5

    Default Re: Propeller Activity Board HELP

    Quote Originally Posted by huutinhsau View Post
    . . .but still didn't work. i use the example code: . . .
    When you say it didn't work, what does that mean? Did the motor move at all?

    What kind of motor (how much current can it draw) are you using and what sort of 6V battery (how much current can is provide)?

    You've probably noticed the forum software destroys the indentation in code. Here's a link to a tutorial on posting code to the forum.


+ Reply to Thread

Similar Threads

  1. Replies: 4
    Last Post: 01-03-2014, 12:21 AM
  2. propeller activity board
    By propMaker in forum Propeller 1 Multicore Microcontroller
    Replies: 19
    Last Post: 08-22-2013, 04:25 PM
  3. Differences between Propeller Activity Board @ Prop. Board of Education?
    By banjo in forum Propeller 1 Multicore Microcontroller
    Replies: 6
    Last Post: 06-03-2013, 06:01 PM
  4. Propeller Activity Board.
    By electromanj in forum Propeller 1 Multicore Microcontroller
    Replies: 18
    Last Post: 05-24-2013, 10:54 PM
  5. propeller activity board A/D
    By jmpothering in forum Propeller 1 Multicore Microcontroller
    Replies: 3
    Last Post: 05-20-2013, 08:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts