Brazo Robotico

  • Uploaded by: Diego Ramos
  • 0
  • 0
  • October 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Brazo Robotico as PDF for free.

More details

  • Words: 271
  • Pages: 2
// MeArmMeCon-A04.ino //Use With MeCon.exe Ver0.4 Windows Software for MeArm Motion Control #include <Servo.h> //MeArm HAS 4 SERVOS Servo xServo; // create servo object, arm base servo - left right motion Servo yServo; // create servo object, left side servo - forward backwards motion Servo zServo; // create servo object, right side servo - forward backwards motion Servo clawServo; // create servo object, end of arm srevo - open,close the claw hand //servo positions values, expects 1-180 deg. int xPos; int yPos; int zPos; int clawPos; //*************** INIT AT STARTUP ******************************************************************* void setup() { the board

// the setup function runs once when you press reset or power

// assign servo to pin numbers xServo.attach(11); // attaches the servo on pin 11 to the servo object yServo.attach(10); // attaches the servo on pin 10 to the servo object zServo.attach(9); // attaches the servo on pin 9 to the servo object clawServo.attach(6); // attaches the servo on pin 6 to the servo object // initialize serial port Serial.begin(9600); // Debug only send serial message to host com port terminal window in Arduino IDE //Serial.print("*** MeCom Test V04 ***."); // send program name, uncomment for debug connection test } // *********************************************************************************** ******************* // ********************************** MAIN PROGRAM LOOP START ******************************************* // *********************************************************************************** ******************* void loop() { //serial in packet patern = xVal,yVal,zVal,clawVal + end of packet char 'x' while (Serial.available() > 0) { xPos = Serial.parseInt(); yPos = Serial.parseInt(); zPos = Serial.parseInt(); clawPos = Serial.parseInt();

if (Serial.read() == 'x') { // Detect end of packet char 'x', go ahead and update servo positions // UPDATE SERVO POSITIONS xServo.write(xPos); yServo.write(yPos); zServo.write(zPos); clawServo.write(clawPos); } } }

Related Documents

Brazo Robotico
October 2019 26
Brazo Robotico
November 2019 20
Brazo
June 2020 15
Brazo Protector
June 2020 15
Brazo Hidraulico.docx
April 2020 10

More Documents from "David Felipe Gabriel"

Brazo Robotico
October 2019 26
December 2019 12
Plancha 1.pdf
June 2020 4
June 2020 12