Robot Arm Controller Library

Dependents:   PR_RobotArm lighthouse_2

Committer:
jah128
Date:
Thu Feb 16 23:57:45 2017 +0000
Revision:
0:9f7b70e0186e
First commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jah128 0:9f7b70e0186e 1 /* University of York Robotics Laboratory Robot Arm Controller Board
jah128 0:9f7b70e0186e 2 *
jah128 0:9f7b70e0186e 3 * Robot Arm Remote Control
jah128 0:9f7b70e0186e 4 *
jah128 0:9f7b70e0186e 5 * File: remote.h
jah128 0:9f7b70e0186e 6 *
jah128 0:9f7b70e0186e 7 * (C) Dept. Electronics & Computer Science, University of York
jah128 0:9f7b70e0186e 8 *
jah128 0:9f7b70e0186e 9 * James Hilder, Alan Millard, Shuhei Miyashita, Homero Elizondo, Jon Timmis
jah128 0:9f7b70e0186e 10 *
jah128 0:9f7b70e0186e 11 * February 2017, Version 1.0
jah128 0:9f7b70e0186e 12 *
jah128 0:9f7b70e0186e 13 */
jah128 0:9f7b70e0186e 14
jah128 0:9f7b70e0186e 15
jah128 0:9f7b70e0186e 16 #ifndef REMOTE_H
jah128 0:9f7b70e0186e 17 #define REMOTE_H
jah128 0:9f7b70e0186e 18
jah128 0:9f7b70e0186e 19 /** Remote Class
jah128 0:9f7b70e0186e 20 * The Remote controller class
jah128 0:9f7b70e0186e 21 *
jah128 0:9f7b70e0186e 22 * Example code for main.cpp:
jah128 0:9f7b70e0186e 23 * @code
jah128 0:9f7b70e0186e 24 * #include "robotarm.h"
jah128 0:9f7b70e0186e 25 * Robotarm arm;
jah128 0:9f7b70e0186e 26 * int main(){
jah128 0:9f7b70e0186e 27 * arm.init();
jah128 0:9f7b70e0186e 28 * while(1) { //Do something!
jah128 0:9f7b70e0186e 29 * }
jah128 0:9f7b70e0186e 30 * }
jah128 0:9f7b70e0186e 31 * @endcode
jah128 0:9f7b70e0186e 32 */
jah128 0:9f7b70e0186e 33 class Remote
jah128 0:9f7b70e0186e 34 {
jah128 0:9f7b70e0186e 35 public:
jah128 0:9f7b70e0186e 36 /**
jah128 0:9f7b70e0186e 37 * Main initialisation routine for the robot arm
jah128 0:9f7b70e0186e 38 *
jah128 0:9f7b70e0186e 39 * Set up the display, set up listener for remote control, set up servos
jah128 0:9f7b70e0186e 40 */
jah128 0:9f7b70e0186e 41 void init(void);
jah128 0:9f7b70e0186e 42
jah128 0:9f7b70e0186e 43 /**
jah128 0:9f7b70e0186e 44 * Set the LED on the remote
jah128 0:9f7b70e0186e 45 * param: mode 0=off 1=red 2=green 3=both
jah128 0:9f7b70e0186e 46 */
jah128 0:9f7b70e0186e 47 void set_led(char mode);
jah128 0:9f7b70e0186e 48
jah128 0:9f7b70e0186e 49 /**
jah128 0:9f7b70e0186e 50 * Detect if remote has been attached or detached
jah128 0:9f7b70e0186e 51 */
jah128 0:9f7b70e0186e 52 void detect_remote(void);
jah128 0:9f7b70e0186e 53
jah128 0:9f7b70e0186e 54 /**
jah128 0:9f7b70e0186e 55 * Detect if a direction switch is being pressed
jah128 0:9f7b70e0186e 56 */
jah128 0:9f7b70e0186e 57 void detect_direction(void);
jah128 0:9f7b70e0186e 58
jah128 0:9f7b70e0186e 59 /**
jah128 0:9f7b70e0186e 60 * Move the servo based on controller position
jah128 0:9f7b70e0186e 61 */
jah128 0:9f7b70e0186e 62 void move_servo(char servo_number, int adjust);
jah128 0:9f7b70e0186e 63
jah128 0:9f7b70e0186e 64
jah128 0:9f7b70e0186e 65 };
jah128 0:9f7b70e0186e 66 #endif // REMOTE_H
jah128 0:9f7b70e0186e 67
jah128 0:9f7b70e0186e 68 /*
jah128 0:9f7b70e0186e 69 * Copyright 2017 University of York
jah128 0:9f7b70e0186e 70 *
jah128 0:9f7b70e0186e 71 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
jah128 0:9f7b70e0186e 72 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
jah128 0:9f7b70e0186e 73 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS
jah128 0:9f7b70e0186e 74 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
jah128 0:9f7b70e0186e 75 * See the License for the specific language governing permissions and limitations under the License.
jah128 0:9f7b70e0186e 76 *
jah128 0:9f7b70e0186e 77 */