RoboAide
Project to improve a DIY robotic arm used for mobility assistance
Classes | Functions | Variables
main.ino File Reference
#include <Arduino.h>
#include "dynamixel.h"
#include "axialMotor.h"
#include "encoder/Encoder.cpp"

Go to the source code of this file.

Classes

struct  dataPack
 A structure containing message data. More...
 

Functions

bool readDataToStruct (dataPack *data)
 Iterates through message one byte at a time casts it to a dataPack struct. More...
 
void readMessage (char *message)
 Iterates through message one character at a time until the end character is found and returns a char array of the message. More...
 
void sendMessage (dataPack message)
 Sends an encoded message over serial. More...
 
void moveAbsolute (uint16_t p1, uint16_t p2, uint16_t p3, uint16_t p4, uint16_t p5, uint16_t p6)
 move motors to an absolute position More...
 
void moveIncremental (uint16_t p1, uint16_t p2, uint16_t p3, uint16_t p4, uint16_t p5, uint16_t p6)
 move motors to an incremental position More...
 
void setDrawerGoalState (bool drawer1, bool drawer2, bool drawer3)
 
void stopMotors ()
 
void startMotors ()
 
void setup ()
 
void loop ()
 

Variables

const int MESSAGE_SIZE = 19
 
char endOfMessageChar = '\0'
 
const int id3 = 221
 
const int id1 = 222
 
const int id2 = 223
 
Dynamixel mot1 (id1, 0.879)
 
Dynamixel mot2 (id2, 0.879 *2)
 
Dynamixel mot3 (id3, 1)
 
long oldPosition = -999
 

Function Documentation

void loop ( )

Definition at line 77 of file main.ino.

void moveAbsolute ( uint16_t  p1,
uint16_t  p2,
uint16_t  p3,
uint16_t  p4,
uint16_t  p5,
uint16_t  p6 
)

move motors to an absolute position

Parameters
p1,...,p6: position for each motor

Definition at line 211 of file main.ino.

void moveIncremental ( uint16_t  p1,
uint16_t  p2,
uint16_t  p3,
uint16_t  p4,
uint16_t  p5,
uint16_t  p6 
)

move motors to an incremental position

Parameters
p1,...,p6: position for each motor

Definition at line 221 of file main.ino.

bool readDataToStruct ( dataPack data)

Iterates through message one byte at a time casts it to a dataPack struct.

Parameters
data: empty dataPack object the message will be written to
Returns
data : dataPack object containging the unpacked message data

Definition at line 182 of file main.ino.

void readMessage ( char *  message)

Iterates through message one character at a time until the end character is found and returns a char array of the message.

Parameters
message: empty character array
Returns
message : character array containing message

Definition at line 161 of file main.ino.

void sendMessage ( dataPack  message)

Sends an encoded message over serial.

Parameters
message: empty dataPack object the message will be written to

Definition at line 202 of file main.ino.

void setDrawerGoalState ( bool  drawer1,
bool  drawer2,
bool  drawer3 
)

Definition at line 226 of file main.ino.

void setup ( )

Definition at line 62 of file main.ino.

void startMotors ( )

Definition at line 238 of file main.ino.

void stopMotors ( )

Definition at line 231 of file main.ino.

Variable Documentation

char endOfMessageChar = '\0'

Definition at line 11 of file main.ino.

const int id1 = 222

Definition at line 13 of file main.ino.

const int id2 = 223

Definition at line 14 of file main.ino.

const int id3 = 221

Definition at line 12 of file main.ino.

const int MESSAGE_SIZE = 19

Definition at line 10 of file main.ino.

Dynamixel mot1(id1, 0.879)
Dynamixel mot2(id2, 0.879 *2)
Dynamixel mot3(id3, 1)
long oldPosition = -999

Definition at line 76 of file main.ino.