Shop OBEX P1 Docs P2 Docs Learn Events
rc arlo - Page 4 — Parallax Forums

rc arlo



  • reinaldoreinaldo Posts: 71
    edited 2020-11-11 04:27
    I’ll dm
  • I’m using MDDS10 cytron and I’ve been at work sorry for the late response.
  • reinaldo wrote: »
    I have tv option on the wx boe

    I assume you meant PAB WX? Parallax used to make a Propeller BOE (Board of Education). It's a different board than the PAB (Propeller Activity Board).

    I think I'll have some time to work on getting things converted to Spin this weekend. It will likely be convenient if we both use the same I/O pins to make it easier to test the code on your robot. I'm hoping you'll list how your I/O pins are connected.

    Based on the Blockly code you shared, I think you're using the following:

    Pin #: Use

    0: RC input elevator.
    1: RC input aileron.

    11: Very far right Ping.

    12: RC output to left motor control.
    13: RC output to right motor control.
    14: Center Ping.
    15: Very far left Ping.
    16: Left of center Ping.
    17 Right of center Ping.

    Is the above correct?

    Do you care if these get switched around?

    Which pins are you using for the TV?

    If you want to use the encoders, and you should really want to use them, then you'll need four pins. I personally think it would be a good idea to use the same I/O pins and was used by the PAB with two HB-25 motor controllers. The PAB with two HB-25s is a very similar setup to what you have. It would be nice if we kept the same pinouts as this earlier version of the Arlo hardware. This would let you switch between the two versions of code easily.

    Do you have any WS2812 (aka NeoPixel) type LEDs? This are pretty fun to add to a robot.

    Besides the elevator and aileron inputs, do you want to add any other RC inputs? It might be nice to use a knob or three position switch to set the robot in various modes.

    I hope to have some Spin code for you to try this weekend.

  • FlySky FS-i6X 10CH 2.4GHz RC Transmitter w/ iA6B RX is what I use for a controller...... I use the top knobs for controlling a turret and trigger system. I don't use the switches that flip up and down on the remote maybe one of those could be a autonomous mode.

    I want to be able to output the terminal still on the tv to possibly show the calculations. or make some kind of custom moving numbers or anything cool to print on the screen. the pin for the servo is pin 5.....

    maybe I could reorganize the pings to whatever you setup the ping pins for. while possibly leaving space for the tv pins which I have not setup yet with resistors.
  • thats a real challenge to make a mode for autonomy. I really want to just make my robot stop using all the pings if your not able to get the autonomous mode and use the tv out to display the terminal or anything on my screen using the wx board. also want my robot to use the welcome file for when a ping is triggered it will say welcome on the speaker lol.

  • reinaldoreinaldo Posts: 71
    edited 2020-11-15 18:57
    the pin setup you posted earlier are the correct pins by the way and its how I currently have them setup
  • reinaldo wrote: »
    maybe I could reorganize the pings to whatever you setup the ping pins for. while possibly leaving space for the tv pins which I have not setup yet with resistors.

    I think it would be helpful (at least it would be helpful to me) if we used the same pins as the Eddie/Arlo firmware.
    Looking at the Eddie/Arlo firmware I see the motor control pins are 12 (left motor) and 13 (right motor). The encoder pins start at 14 (left motor first).
    reinaldo wrote: »
    the pin for the servo is pin 5

    Pin 5 on the PAB? Which servo is this?
    It looks like your arm has three servos controlled with two channels. Is this correct?

    How do you want the servos controlled? The servos could be connected directly the the RC receiver output and controlled independent from the PAB. Do you want the program to control any of your servos?

    One concern is the number of I/O pins you'll need. Here's my count so far.

    Encoders 4
    Motor control 2
    RC inputs at least 2
    TV outputs 3
    Ping 5?

    This adds up to 16 which leaves two pins.
    Perhaps one of these pins could be used as a RC input to control the robot's mode? Maybe you want one of the pins to control a servo?

    I think we could free up two more pins by using a one-wire TV driver.

    The original Eddie/Arlo firmware was intended to be used with a controlling PC. I personally like to use the Propeller chip as the controller. If one Propeller chip can't handle the complete setup, then it's not uncommon to add a second Propeller chip to the mix.

    I'll PM you my phone number. It might help to discuss some this with a back and forth.
  • Reinaldo,
    From your PM, it sounds like you're having trouble accessing your old Blockly files. It took me a while to figure out how to access my older files. I was finally able to open some of the files we had worked on the past. I'll try to provide instructions on how I accessed these files tomorrow (my brain is refusing to work anymore tonight).
  • reinaldoreinaldo Posts: 71
    edited 2022-03-25 12:52

    Duane thanks 🙏

    I’m working on getting information such as the terminal projected onto a small LCD screen. You can see the screen in the picture it’s lit up green in the picture

  • I'm pretty sure it's not too hard to get data to the screen.

    Make sure and follow the link Unable to contact the BlocklyProp Launcher. Click for more information.

    I personally find Blockly and other graphic programming environments intensely frustrating. I'll certainly help with Blockly, but I'm also willing to help you transition to Spin using the Propeller Tool and the programming interface.

    IMO, small programs are easier when Blockly type programs but conventional coding methods quickly become easier to use once the program size increases a bit.

    Which Blockly file are you trying to access?

    I'll see if I can access the file myself if you let me know which one you want.

  • I’m trying to access the last code with servo motors attached to ping sensor includes rc code too and sensor stops robot while pushing forward on throttle

  • @reinaldo said:
    I’m trying to access the last code with servo motors attached to ping sensor includes rc code too and sensor stops robot while pushing forward on throttle

    Is it the code linked in post #77? I can access the code myself. Do you have the BlocklyProp launcher installed on your computer? I think you need this software installed to use Blockly (though I'm really not sure).

    Which LCD are you using? Do you have a link to the product page?

  • Parallax 2 x 16 Serial LCD with Piezo Speaker (Backlit). And post#77 could be the code but only problem is that when I click on it it’s blank so I can’t really know. Also I do have the latest blockly prop on my computer it’s called solo now.

  • The first time I tried opening the code in post #77, the code area was all white. Now it just takes a few seconds to load. I think the takes a while to load.
    I'm not sure why the code loads for me now when it didn't initially. I don't know if it's because I ran the Blockly code locally first or if the time it didn't load was a quirk and you just need to be patient to let load.
    How is your internet speed?

  • reinaldoreinaldo Posts: 71
    edited 2022-03-27 15:36

    still blank and when i click for code it says the project is empty and i waited everytime for more than ten minutes and im also using the latest blockly solo and my internet is great. i want to use blocks because its easy to use but i guess ill use spin if thats a more flexable coding platform.

  • As I mentioned before, I didn't see any code the first time I tried. I'm not sure how much this matters but I think you want to start the Blockly Launcher. The launcher initially looked like this:

    After clicking the link to the code, the launcher looked like this:

    This is the way the code page looks when I have the launcher active:

    If I haven't started the launcher, I still see the code but there's an error message at the top of the screen. I'm not sure why I see code even without the launcher. Maybe the code is in my browser cache?

    If you need to switch to Spin, you can start by downloading the Propeller Tool. It's the first item listed on the Propeller 1 Software page.

    Download and install: Propeller Tool Software for Windows (Spin/PASM for P1/P2)

    Let me know if you still can't access the Blockly code and I'll help get you started with some Spin code.

  • so, I tried everything and still no luck i will try using propeller tool it's probably a more reliable application I'm assuming. is there a way to convert the blockly code you were able to retrieve and upload it to the propeller tool. sorry I'm getting back a little late had work and was exhausted after. but i will keep up with the forum and not ghost it so no worries there.

  • dgatelydgately Posts: 1,624
    edited 2022-03-31 17:01

    If you click on the Code button BlocklyProp will display the C language code of your project. That code can be copied and pasted into a file in the SimpleIDE program. SimpleIDE supports C code projects. Check this Parallax web page:

    Good luck!

  • Duane DegnDuane Degn Posts: 10,588
    edited 2022-03-31 17:24

    As @dgately suggests, BlocklyProp produces C code. I'll add the produced C code below. I can program in C when I have to but I greatly prefer programming in Spin on the Propeller. I'll translate the code below to Spin in the next few days. You can decide to use the Spin code or the C code. Personally, I'd prefer to help with Spin code but I'm sure others here would be happy to help out with C code if you prefer C.

    Edit: Fixed code formatting and added text file of code.

    // ------ Libraries and Definitions ------
    #include "simpletools.h"
    #include "arlodrive.h"
    #define MY_CENTER_PULSE_1485    1485
    #define MY_PING_CAUTION_60  60
    #define MY_PING_DANGER_10   10
    #define MY_X_INDEX_0    0
    #define MY_Y_INDEX_1    1
    #define MY_PORT_INDEX_0     0
    #define MY_STARBOARD_INDEX_1    1
    #define MY_FRONT_INDEX_0    0
    #define MY_REAR_INDEX_1     1
    #define MY_RC_LOOP_INDEX_0  0
    #define MY_PING_LOOP_INDEX_1    1
    #define MY_MAX_ROBOT_SPEED_200  200
    #define MY_MAX_JOYSTICK_MOVEMENT_410    410
    #define MY_LOOP_PER_DEBUG_50    50
    #define MY_VERY_SLOW    5
    #define MY_HALF_DEADBAND_2  2
    #define MY_MAX_PING_SPEED_60    60
    #define MY_TURN_FROM_PING_75    75
    #include "ping.h"
    // ------ Global Variables and Objects ------
    int inputCommand[2];
    int speedFromRc[2];
    int speedFromRcRaw[2];
    int finalSpeed[2];
    int pingDistance[2];
    int frontRearPing[2];
    int cogLoops[2];
    int oldLoops[2];
    int loopDifference[2];
    int frozenLoops[2];
    int loopCountStopped[2];
    int otherIndex[2];
    int mainIndex;
    int fastestSide;
    int closestPing;
    int aileron;
    int scaledPingSpeed;
    int elevator;
    int rcIndex;
    // ------ Function Declarations ------
    void MonitorRcInput();
    void CheckDebug();
    void MonitorPings();
    void PingForwardSpeed();
    void printIndexSide();
    void printIndexXy();
    void printIndexFrontRear();
    void FindFastestSide();
    void printIndexLoop();
    void FindClosestPing();
    void WarningText();
    void ReversePingSpeed();
    void LoopText();
    // ------ Main Program ------
    int main() {
      // I use the NED coordinate system.
      // AKA North East Down.
      // Positive X is forward (north).
      // Positive Y is starboard (east).
      // Positive Z (if used) is below the robot (down).
      // "TURN_FROM_PING" is used to slow the wheel opposite of the obstacle.
      otherIndex[constrainInt(MY_PORT_INDEX_0, 0, 1)] = MY_STARBOARD_INDEX_1;
      otherIndex[constrainInt(MY_STARBOARD_INDEX_1, 0, 1)] = MY_PORT_INDEX_0;
      cogLoops[constrainInt(MY_RC_LOOP_INDEX_0, 0, 1)] = 0;
      cogLoops[constrainInt(MY_PING_LOOP_INDEX_1, 0, 1)] = 0;
      oldLoops[constrainInt(MY_RC_LOOP_INDEX_0, 0, 1)] = 0;
      oldLoops[constrainInt(MY_PING_LOOP_INDEX_1, 0, 1)] = 0;
      cog_run(MonitorRcInput, 128);
      cog_run(MonitorPings, 128);
      while(1) {
        if ((frontRearPing[MY_FRONT_INDEX_0] < MY_PING_CAUTION_60  || (pingDistance[MY_PORT_INDEX_0] < MY_PING_CAUTION_60  || pingDistance[MY_STARBOARD_INDEX_1] < MY_PING_CAUTION_60))  && (speedFromRc[MY_PORT_INDEX_0] > 0  && speedFromRc[MY_STARBOARD_INDEX_1] > 0)) {
        else if (frontRearPing[MY_REAR_INDEX_1] < MY_PING_CAUTION_60  && (speedFromRc[MY_PORT_INDEX_0] < 0  && speedFromRc[MY_STARBOARD_INDEX_1] < 0)) {
        }else {
          for (mainIndex = 0; mainIndex <= 1; mainIndex++) {
            finalSpeed[constrainInt(mainIndex, 0, 1)] = speedFromRc[mainIndex];
        drive_speed(finalSpeed[MY_PORT_INDEX_0], finalSpeed[MY_STARBOARD_INDEX_1]);
    // ------ Functions ------
    void MonitorRcInput() {
      while(1) {
        // Removed throttle control from this version.
        aileron = (pulse_in(0, 1));
        elevator = (pulse_in(1, 1));
        // Using "MAX_ROBOT_SPEED" instead of "maxSpeed" from throttle.
        inputCommand[constrainInt(MY_CENTER_PULSE_1485, 0, 1)] = elevator - MY_CENTER_PULSE_1485;
        inputCommand[constrainInt(MY_CENTER_PULSE_1485, 0, 1)] = (aileron - MY_CENTER_PULSE_1485) * -1;
        speedFromRcRaw[constrainInt(MY_CENTER_PULSE_1485, 0, 1)] = inputCommand[MY_CENTER_PULSE_1485] + inputCommand[MY_CENTER_PULSE_1485];
        speedFromRcRaw[constrainInt(MY_CENTER_PULSE_1485, 0, 1)] = inputCommand[MY_CENTER_PULSE_1485] - inputCommand[MY_CENTER_PULSE_1485];
        for (rcIndex = MY_CENTER_PULSE_1485; rcIndex <= MY_CENTER_PULSE_1485; rcIndex++) {
          speedFromRc[constrainInt(rcIndex, 0, 1)] = (speedFromRcRaw[rcIndex] * MY_CENTER_PULSE_1485) / MY_CENTER_PULSE_1485;
    void CheckDebug() {
      for (mainIndex = MY_RC_LOOP_INDEX_0; mainIndex <= MY_PING_LOOP_INDEX_1; mainIndex++) {
        frozenLoops[constrainInt(mainIndex, 0, 1)] = cogLoops[mainIndex] - oldLoops[mainIndex];
      }for (mainIndex = MY_RC_LOOP_INDEX_0; mainIndex <= MY_PING_LOOP_INDEX_1; mainIndex++) {
        loopDifference[constrainInt(mainIndex, 0, 1)] = frozenLoops[mainIndex] - oldLoops[mainIndex];
        if (1 == 0) {
          print("%s%d", "loopDiff[", mainIndex);
          print("%s%d\r", "] = ", loopDifference[mainIndex]);
      }if (loopDifference[MY_RC_LOOP_INDEX_0] > MY_LOOP_PER_DEBUG_50  || loopDifference[MY_PING_LOOP_INDEX_1] > MY_LOOP_PER_DEBUG_50) {
        for (mainIndex = MY_RC_LOOP_INDEX_0; mainIndex <= MY_PING_LOOP_INDEX_1; mainIndex++) {
          if (loopDifference[mainIndex] == 0) {
            if (loopCountStopped[mainIndex] > MY_STOPPED_LOOPS_THRESHOLD_2) {
          else {
            loopCountStopped[constrainInt(mainIndex, 0, 1)] = 0;
        }print("%s%d\r", "Aileron = ", aileron);
        print("%s%d\r", "Elevator = ", elevator);
        for (mainIndex = 0; mainIndex <= 1; mainIndex++) {
          print("%s%d\r", "] = ", inputCommand[mainIndex]);
        }for (mainIndex = 0; mainIndex <= 1; mainIndex++) {
          print("%s%d", "] = ", speedFromRcRaw[mainIndex]);
          print((", sFRc["));
          print("%s%d", "] = ", speedFromRc[mainIndex]);
          print((", fSpeed["));
          print("%s%d\r", "] = ", finalSpeed[mainIndex]);
          print("%s%d\r", "] = ", pingDistance[mainIndex]);
          print("%s%d\r", "] = ", frontRearPing[mainIndex]);
        for (mainIndex = MY_RC_LOOP_INDEX_0; mainIndex <= MY_PING_LOOP_INDEX_1; mainIndex++) {
          oldLoops[constrainInt(mainIndex, 0, 1)] = frozenLoops[mainIndex];
    void MonitorPings() {
      // ping pin 14 in front
      // ping pin 16 left
      // 17 right ping pin
      // 15 rear ping pin
      while(1) {
        pingDistance[constrainInt(MY_PORT_INDEX_0, 0, 1)] = ping_cm(16);
        pingDistance[constrainInt(MY_STARBOARD_INDEX_1, 0, 1)] = ping_cm(17);
        frontRearPing[constrainInt(MY_FRONT_INDEX_0, 0, 1)] = ping_cm(14);
        frontRearPing[constrainInt(MY_REAR_INDEX_1, 0, 1)] = ping_cm(15);
    void PingForwardSpeed() {
      if (frontRearPing[MY_FRONT_INDEX_0] < MY_PING_DANGER_10  || (pingDistance[MY_PORT_INDEX_0] < MY_PING_DANGER_10  || pingDistance[MY_STARBOARD_INDEX_1] < MY_PING_DANGER_10)) {
        // One distance below danger level.
        // Too close. Backup.
        // Only allow negative speeds.
        for (mainIndex = 0; mainIndex <= 1; mainIndex++) {
          finalSpeed[constrainInt(mainIndex, 0, 1)] = 0;
      else if (pingDistance[MY_PORT_INDEX_0] < MY_PING_CAUTION_60  && pingDistance[MY_STARBOARD_INDEX_1] < MY_PING_CAUTION_60) {
        // Obstacle.
        // Slow down both wheels based on distance.
        // Scale allowed speed by distance to closest obstacle.
        if (frontRearPing[MY_FRONT_INDEX_0] < pingDistance[closestPing]) {
          scaledPingSpeed = (((frontRearPing[MY_FRONT_INDEX_0] - MY_PING_DANGER_10) * MY_MAX_PING_SPEED_60) / PING_CONCERN_RANGE_50);
        else {
          scaledPingSpeed = (((pingDistance[closestPing] - MY_PING_DANGER_10) * MY_MAX_PING_SPEED_60) / PING_CONCERN_RANGE_50);
        // Scale each speed by this new limit.
        for (mainIndex = MY_PORT_INDEX_0; mainIndex <= MY_STARBOARD_INDEX_1; mainIndex++) {
          finalSpeed[constrainInt(mainIndex, 0, 1)] = (speedFromRc[mainIndex] * scaledPingSpeed) / speedFromRc[fastestSide];
        }}else {
        // Only one obstacle.
        // Turn away from obstacle.
        // Reduce opposite speed to turn away fro obstacle.
        finalSpeed[constrainInt(otherIndex[closestPing], 0, 1)] = (speedFromRc[otherIndex[closestPing]] < ((speedFromRc[closestPing] * MY_TURN_FROM_PING_75) / 100) ? speedFromRc[otherIndex[closestPing]] : ((speedFromRc[closestPing] * MY_TURN_FROM_PING_75) / 100));
        finalSpeed[constrainInt(closestPing, 0, 1)] = speedFromRc[closestPing];
    void printIndexSide() {
      if (mainIndex == MY_STARBOARD_INDEX_1) {
      else {
    void printIndexXy() {
      if (mainIndex == MY_Y_INDEX_1) {
      else {
    void printIndexFrontRear() {
      if (mainIndex == MY_REAR_INDEX_1) {
      else {
    void FindFastestSide() {
      if (speedFromRc[MY_PORT_INDEX_0] < speedFromRc[MY_STARBOARD_INDEX_1]) {
        fastestSide = MY_STARBOARD_INDEX_1;
      else {
        fastestSide = MY_PORT_INDEX_0;
    void printIndexLoop() {
      if (mainIndex == MY_PING_LOOP_INDEX_1) {
      else {
    void FindClosestPing() {
      if (pingDistance[MY_STARBOARD_INDEX_1] < pingDistance[MY_PORT_INDEX_0]) {
        closestPing = MY_STARBOARD_INDEX_1;
      else {
        closestPing = MY_PORT_INDEX_0;
    void WarningText() {
      print(("Cog Warning!"));
    void ReversePingSpeed() {
      if (frontRearPing[MY_REAR_INDEX_1] < MY_PING_DANGER_10) {
        for (mainIndex = MY_PORT_INDEX_0; mainIndex <= MY_STARBOARD_INDEX_1; mainIndex++) {
          finalSpeed[constrainInt(mainIndex, 0, 1)] = 0;
      else {
        scaledPingSpeed = (-1 * (((frontRearPing[MY_REAR_INDEX_1] - MY_PING_DANGER_10) * MY_MAX_PING_SPEED_60) / PING_CONCERN_RANGE_50));
        // Scale each speed by this new limit.
        // Use speed from "otherIndex" to find fastest reverse speed.
        // "fastestSide" will be slowest side in reverse.
        for (mainIndex = MY_PORT_INDEX_0; mainIndex <= MY_STARBOARD_INDEX_1; mainIndex++) {
          finalSpeed[constrainInt(mainIndex, 0, 1)] = (speedFromRc[mainIndex] * scaledPingSpeed) / speedFromRc[otherIndex[fastestSide]];
    void LoopText() {
      for (mainIndex = MY_RC_LOOP_INDEX_0; mainIndex <= MY_PING_LOOP_INDEX_1; mainIndex++) {
        print("%s%d", "] = ", cogLoops[mainIndex]);
        print((", oldLoops["));
        print("%s%d\r", "] = ", oldLoops[mainIndex]);
  • reinaldoreinaldo Posts: 71
    edited 2022-03-31 19:01

    hey thanks duane once again. also are you able to send me the blockly project as a file? i will work in the propellor tool as well, i have to add a servo to respond to sensor 17 and make it so that it moves a couple servos. servo is on pin 5 and moves 45 degrees and returns back to its original state when nothing blocks sensor 17 which is pin 17 in my setup. THE lcd screen is pin 3 and i need it to project terminal readings if thats possible. i love working in c coding but use blockly for some other things then convert the code to c. and if your preference is spin id love to work in spin.

    heres my setup front center ping is pin 16

                                    reAr ping is pin 15
                                   right ping is pin 17 and is supposed to move servo pin 5 up and down
                                     left ping is pin 11
                                    and then between left ping and  center ping is another ping thats on pin 14, so in total there are five pings.

    LCD SCREEN is pin 3

  • @reinaldo said:
    are you able to send me the blockly project as a file?

    I'm not really sure how to do this. I used the "Download SimpleIDE files" option and the attached zip archive was produced. This contains the code I attached earlier with the .txt file and I think it also includes some of the library files.

    I presently don't have any of the Propeller C code IDE programs on my computer.

  • reinaldoreinaldo Posts: 71
    edited 2022-04-01 17:16

    so i still have no luck getting blockly to read the link to the code it just says my project and its a blank page . anyways i showed you my setup if theres anyway you could help me out with this in spin or simple ide that be cool too. and i think i use servo differential drive as a robot reference instead of arlo because i dont use the motor board that came with the arlo kit because there were issues with the motor board from the company. and like i said my setup is

    right ping is pin 17, and makes a servo thats on pin 5 rotate 45 degrees when you block the sensor and when the sensor isnt blocked it returns to 0 degrees.

    front center ping pin is 16

    rear ping is pin 15

    LCD pin is 3

    left ping pin is 11

    i aLso really dont understand how you were able to get the blockly code and i tried on other devices to and still no luck. on another note i dont care at this point i just want to start working on my robot again.

Sign In or Register to comment.