Results 1 to 4 of 4

Thread: Arduino Mega talking to Pincher

  1. Arduino Mega talking to Pincher

    Hi Everyone,

    So I am trying to have an arduino mega send a serial packet to an arbotix-m that has the ArmLinkSerial sketch uploaded to it.

    I am trying to make this as simple as possible for now so I am just wanting to send a premade packet from the examples on the website.

    This is what I have so far:

    Code:
    void setup(){
      Serial.begin(9600);
      Serial1.begin(38400);
    }
    
    void loop() {
     
      if (Serial1.available()){
        Serial.print("Writing to Robot");
      
      
        Serial1.write(0xff);
        Serial1.write(0x0);
        Serial1.write(0x0);  
        Serial1.write(0x0);  
        Serial1.write(0x0);  
        Serial1.write(0x0);  
        Serial1.write(0x0);  
        Serial1.write(0x0);  
        Serial1.write(0x0);
        Serial1.write(0x0);
        Serial1.write(0x0);
        Serial1.write(0x0);
        Serial1.write(0x0);
        Serial1.write(0x0);
        Serial1.write(0x0);
        Serial1.write(0x30);
        Serial1.write(0xcf);
        
        delay(10000);
      }
     
    }
    The Mega is then attached to the arbotix like this:

    http://imgur.com/a/Y38DS

    I am really new to the arduino and robotics in general, any help would be really really appreciated.

    Thanks!
    -Kelly

  2. Re: Arduino Mega talking to Pincher

    So I tried to simplify it further and my code now looks like this:

    Code:
    void setup(){
      Serial.begin(38400);
      Serial1.begin(38400);
      delay(10000);
      Serial.println("Send Data.");
    }
    
    void loop() {
       
                Serial.println("Sending Packet...");
                
                Serial1.write(0xff);
                Serial1.write(0x0);
                Serial1.write(0x0);  
                Serial1.write(0x0);  
                Serial1.write(0x0);  
                Serial1.write(0x0);  
                Serial1.write(0x0);  
                Serial1.write(0x0);  
                Serial1.write(0x0);
                Serial1.write(0x0);
                Serial1.write(0x0);
                Serial1.write(0x0);
                Serial1.write(0x0);
                Serial1.write(0x0);
                Serial1.write(0x0);
                Serial1.write(0x30);
                Serial1.write(0xcf);
                delay(10000);
            
     }
    It says it is sending the packets and the TX light is flashing but there is no response from the robot. I am really at a loss as to how to send these packets...

    Any help would be a life saver

  3. #3

    Re: Arduino Mega talking to Pincher

    Hi Kelly,
    Sorry for not responding to this sooner.

    You're code looks fine (I got it to work on a mega / pincher here)

    Before we delve too deep in, I just want to make sure that
    1)If you were to number the pins on the ArbotiX FTDI Pinout from 1-6 with green being 1 and black being 6, the ArbotiX's TX pin is 2(yellow) and RX pin is 3(orange). Pin 2 on the arbotix should be connected to the RX1 pin on the mega, and pin 3 to the TX1. So basically make sure that RX on one goes to TX on the other board. If that doesn't work,
    2)Were you able to run the test code for the pincher?
    3)Were you able to run the arm link software to control the pincher?


    The following code should have the arm move between home position and on offset position every second or so.

    Code:
    void setup(){  Serial.begin(38400);
      Serial1.begin(38400);
      delay(1000);
      Serial.println("Send Data.");
    }
    
    
    void loop() {
       
                Serial.println("Sending Packet...");
                
                Serial1.write(0xff);
                Serial1.write(0x0);
                Serial1.write(0x0);  
                Serial1.write(0x0);  
                Serial1.write(0x0);  
                Serial1.write(0x0);  
                Serial1.write(0x0);  
                Serial1.write(0x0);  
                Serial1.write(0x0);
                Serial1.write(0x0);
                Serial1.write(0x0);
                Serial1.write(0x0);
                Serial1.write(0x0);
                Serial1.write(0x0);
                Serial1.write(0x0);
                Serial1.write(0x30);
                Serial1.write(0xcf);
      delay(1000);
                
                Serial1.write(0xff);
                Serial1.write(0x02);
                Serial1.write(0x00);  
                Serial1.write(0x00);  
                Serial1.write(0x96);  
                Serial1.write(0x00);  
                Serial1.write(0x96);  
                Serial1.write(0x00);  
                Serial1.write(0x5A);  
                Serial1.write(0x02);  
                Serial1.write(0x0);
                Serial1.write(0x00);
                Serial1.write(0x00);
                Serial1.write(0x80);
                Serial1.write(0x00);
                Serial1.write(0x00);
                Serial1.write(0xf5);
                
      delay(1000);
            
     }

  4. Re: Arduino Mega talking to Pincher

    Hi, thank you for the help! I am so excited that I was on the right path but I actually ended up just running all of the code directly on the Arbotix-m. Believe it or not I just got it working earlier today. It uses a pixy to find object location to basically act as a pick and place robot. Video is attached. This was my first time programming an arduino so pretty happy with the turn out

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. RX24 need help with getting position with Arduino Mega
    By muhigol in forum Humanoids, Walkers & Crawlers
    Replies: 1
    Last Post: 11-16-2014, 12:27 AM
  2. Dynamixel Servo Control Issues (MX-28 and Arduino Mega)
    By JasonT in forum DYNAMIXEL & Robot Actuators
    Replies: 1
    Last Post: 08-12-2014, 08:12 PM
  3. Arduino Mega 2560 and AX12A servos
    By DVS in forum DYNAMIXEL & Robot Actuators
    Replies: 3
    Last Post: 07-08-2013, 05:26 PM
  4. Arduino Mega 2560 and AX12A servos
    By DVS in forum Sensors
    Replies: 1
    Last Post: 07-08-2013, 05:09 PM
  5. Question(s) controlling 6 ax-12a's with an arduino Mega
    By mlerner in forum DYNAMIXEL & Robot Actuators
    Replies: 6
    Last Post: 02-01-2013, 06:29 PM

Tags for this Thread

Posting Permissions

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