Shop OBEX P1 Docs P2 Docs Learn Events
not able to grasp — Parallax Forums

not able to grasp

mythixmythix Posts: 6
edited 2015-06-10 13:19 in Learn with BlocklyProp
hi I am mythix I got my activity bot in December did all the quick projects but I am having problems with how to use the simple IDE I have no clue how to program or use other ports (1-15) and the others my, plan is I want to build it into a track based system with a camera, airsoft turret, and use buttons on a remote to turn lights camera on and off the last thing is I want to connect this all up and run it using and Xbox one controller. Is there any willing to help/teach me.

Comments

  • PublisonPublison Posts: 12,366
    edited 2015-06-05 09:10
    mythix wrote: »
    hi I am mythix I got my activity bot in December did all the quick projects but I am having problems with how to use the simple IDE I have no clue how to program or use other ports (1-15) and the others my, plan is I want to build it into a track based system with a camera, airsoft turret, and use buttons on a remote to turn lights camera on and off the last thing is I want to connect this all up and run it using and Xbox one controller. Is there any willing to help/teach me.

    Welcome to the forums!

    Are you programming in C or Spin?
  • mythixmythix Posts: 6
    edited 2015-06-05 09:21
    I am using the windows c? for simple IDE.....
  • PublisonPublison Posts: 12,366
    edited 2015-06-05 10:14
    mythix wrote: »
    I am using the windows c? for simple IDE.....

    Have you gone though all the Learn Examples?

    http://learn.parallax.com/activitybot
  • mythixmythix Posts: 6
    edited 2015-06-05 13:32
    I have done all except sd card games and polygon/circles manly im not understanding how to run multiple items like use ultra sound and light sensor to navigate or touch and IR or all together as well with and xbox one wireless controller is it as esay as just knowing its signal and putting that to and xbee or do I need to have a specific unit for the activity bot?
  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-06-05 14:20
    mythix wrote: »
    I have done all except sd card games and polygon/circles manly im not understanding how to run multiple items like use ultra sound and light sensor to navigate or touch and IR or all together as well with and xbox one wireless controller is it as esay as just knowing its signal and putting that to and xbee or do I need to have a specific unit for the activity bot?

    If the controller uses an USB connection it probably needs to interface with a PC and then the PC would send commands to the robot.

    There are lots of other game controllers which can be used directly with the Propeller. PlayStation 2 controllers are a good option. One of my favorite controllers to use with the Propeller is a wireless Wii Nunchuck. I used a wireless Nunchuck with my Halloween Hex robot.

    A wireless PlayStation 2 shouldn't be too hard to add to the Propeller. There was a recent thread on this topic; I'll try to find it and add a link here.

    I used a wired PlayStation 2 to control a Roomba. In order to make the connection wireless, I added a pair of Nordic nRF24L01+ transceivers. This required my use of a second Propeller to read the controller and send appropriate messages over a wireless link. It's a lot easier to start out with a wireless controller so a second microcontroller isn't needed.

    One advantage of using a second controller with a transceiver such as the Nordic modules I used or a pair of XBees is then you can get telemetry back from the robot. With telemetry it would be possible to monitor the batteries voltage, the robot's speed and other parameters from your control unit. Here's a link to my (possibly overly) ambitious robot rebot. My robot remote has the potential of being really cool but it's just so darn complicated. When I temporarily (or so I thought) switched to using a wireless Nunchuck I was thrilled with how simple it was to use.

    I think you'd be wise to start out with a wireless controller of some sort. The Wii Nunchuck and the PlayStation 2 are my top two recommendations for wireless controllers but they're mainly on my top two since I've used them (though my PS2 wasn't wireless). There may be other wireless controllers which would work well. I'd avoid a controller which uses an USB connection.

    Another option is to use a transmitter and receiver from normal RC gear. These are pretty easy to use with the Propeller but they generally require an I/O pin for each control channel used.

    Edit: Here's a link to Hal's wireless PlayStation 2 hack. Hal has just about convinced me I need one of these myself.

    http://forums.parallax.com/showthread.php/161173-PS2-Wireless-Controller-Receiver-hack

    Here's a link to the C software for the PS2 controller.

    http://forums.parallax.com/showthread.php/160712-Propeller-C-for-PS2-Game-Controller

    Post #4 of the thread has a link to a Spin version of the software. The Spin version will read from the PS2's analog buttons.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-06-05 14:39
    Here's a link to ValeT's project where he used two XBees to control his Activity Bot.

    http://forums.parallax.com/showthread.php/158011-How-To-Use-XBee-to-communicate-between-ActivityBoard-and-ActivityBot

    I don't use C much with the Propeller myself so I haven't used his method. It looks like he did a good job documenting his work.
  • mythixmythix Posts: 6
    edited 2015-06-05 14:43
    thank you for your info and will look into it more once I get more acquainted with what the h** I am doing so far im thinking on the physical setup design while learning how to use the windows simple IDE v. 0-9-64
  • mythixmythix Posts: 6
    edited 2015-06-07 10:34
    could some one post a windows simple ide code that uses ping and ir drive so I can understand the placement to run multiple sensors? or some one willing to do a walkthrough
  • mythixmythix Posts: 6
    edited 2015-06-07 11:20
    so I want to turn a flash light on with the light sensor what is wrong with this... sensor is linked to p14 and light is set to p7... this is #include "simpletools.h" // Include simpletools

    int main()
    {
    while(1)
    {
    high(12);
    pause(1000);
    int t = rc_time(12, 1);
    print("t = %d\n", t);
    pause(100);
    if t = 130 high(7) else t = 0 low(7);

    }
    } if this is not even close I would like to know... I am trying to learn tis with no prior education of all computer sci out side of typing class I truly need one on one with some one to vocally help me out other wise I might just have to sell the activitybot kit
  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-06-07 11:27
    mythix wrote: »
    could some one post a windows simple ide code that uses ping and ir drive so I can understand the placement to run multiple sensors? or some one willing to do a walkthrough

    Since you want to use Simple IDE, I assume you want to use C. Right? Edit: I hadn't seen post #10 when I wrote this post. Yes obviously you want to use C.

    I think there are examples in the Learn site to control servos and examples on how to use a Ping sensor. I'm not sure what you mean by "ir drive".

    While you'll likely be able to find example code to use various parts of the robot you want to make, it's very unlikely you'll find code to use all the things you want to include in a robot in the way you want to use them.

    Chris the Carpenter used to run a small robot making business. He made a couple of videos where he asks some questions about a person's goal when they start building a robot.

    https://sites.google.com/a/rocketbrandstudios.com/rocket-brand-studios/want-to-build-robot

    I think Chris did a good job in pointing out why one will need to learn to to write code if one wants to build robots.

    I think writing software for a robot is the most challenging parts of making a robot but I also think it's one of my favorite parts of making a robot.
  • PublisonPublison Posts: 12,366
    edited 2015-06-07 11:32
    mythix wrote: »
    so I want to turn a flash light on with the light sensor what is wrong with this... sensor is linked to p14 and light is set to p7... this is #include "simpletools.h" // Include simpletools

    int main()
    {
    while(1)
    {
    high(12);
    pause(1000);
    int t = rc_time(12, 1);
    print("t = %d\n", t);
    pause(100);
    if t = 130 high(7) else t = 0 low(7);

    }
    } if this is not even close I would like to know... I am trying to learn tis with no prior education of all computer sci out side of typing class I truly need one on one with some one to vocally help me out other wise I might just have to sell the activitybot kit

    I don't know C very well, but looking at the the code, you are reading p12 when you say the sensor is on p14.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-06-07 11:37
    mythix wrote: »
    so I want to turn a flash light on with the light sensor what is wrong with this... sensor is linked to p14 and light is set to p7... this is #include "simpletools.h" // Include simpletools

    int main()
    {
    while(1)
    {
    high(12);
    pause(1000);
    int t = rc_time(12, 1);
    print("t = %d\n", t);
    pause(100);
    if t = 130 high(7) else t = 0 low(7);

    }
    } if this is not even close I would like to know... I am trying to learn tis with no prior education of all computer sci out side of typing class I truly need one on one with some one to vocally help me out other wise I might just have to sell the activitybot kit

    It's unlikely the t will equal exactly 130. Usually you'd want to compare it some range of use "if t > 130" so it sets pin 7 high for any value above 130.

    It's a lot easier to read code in the forum if you use code tags. Use "Reply With Quote" to see how I added the tags here.
    #include "simpletools.h"                      // Include simpletools
      
      int main()                                    
    {
      while(1)                                     
      {
        high(12);                                  
        pause(1000);                                 
        int t = rc_time(12, 1);                    
        print("t = %d\n", t);                     
        pause(100);                               
        if t = 130 high(7) else t = 0 low(7);
     
      }
    }
    

    Does the above code compile? The syntax doesn't look correct to me but I don't use C much.
  • twm47099twm47099 Posts: 867
    edited 2015-06-07 17:51
    Duane Degn wrote: »
    It's unlikely the t will equal exactly 130. Usually you'd want to compare it some range of use "if t > 130" so it sets pin 7 high for any value above 130.

    It's a lot easier to read code in the forum if you use code tags. Use "Reply With Quote" to see how I added the tags here.
    #include "simpletools.h"                      // Include simpletools
      
      int main()                                    
    {
      while(1)                                     
      {
        high(12);                                  
        pause(1000);                                 
        int t = rc_time(12, 1);                    
        print("t = %d\n", t);                     
        pause(100);                               
        if t = 130 high(7) else t = 0 low(7);
     
      }
    }
    

    Does the above code compile? The syntax doesn't look correct to me but I don't use C much.

    The if statement syntax is not correct. Try:
     if (t > 100) high(7) ;         // choose a value for the test that is high enough to trigger, but low enough to occur.
     else low(7);                    
    

    if you are not going to need the low value of t don't bother to set t = 0. If you want to save 0 in t
    then you will have to use { after else, put a semi colon after 0 and (7) and put a } after (7);
    It would read:
    else { t = 0;
          low(7);
          }
    

    Also be sure to check that the pin number for the sensor is the same as the one in the program, as mentioned above.
    Tom
  • Steph LindsaySteph Lindsay Posts: 767
    edited 2015-06-10 13:19
    mythix wrote: »
    thank you for your info and will look into it more once I get more acquainted with what the h** I am doing so far im thinking on the physical setup design while learning how to use the windows simple IDE v. 0-9-64


    Hi Mythix,

    If you are still using 0-9-64, you might want to upgrade to the latest version (1.0, RC2). It may include improvements to the C libraries your code is relying on.
    http://learn.parallax.com/propeller-c-set-simpleide/windows


    You might also take a look at some of the ActivityBot projects posted on the Learn site, as examples of using multiple sensors together. Vale's Joystick-controlled robot project is posted here, for example.
    http://learn.parallax.com/projects/propeller-C-language


    The "Remote Control Rock, Talk and Roll ActivityBot" uses a TV remote, instead of a flashlight, to activate the robot and drive it around. It uses the touch-whiskers to react if it hits objects, but the last page of the project shows how to modify one line of code to use the Ping))) sensor instead.

    http://learn.parallax.com/project/remote-control-rock-talk-and-roll-activitybot
Sign In or Register to comment.