For YRL Robot Arm
remote.h@0:b14dfd8816da, 2017-03-03 (annotated)
- Committer:
- jah128
- Date:
- Fri Mar 03 13:28:54 2017 +0000
- Revision:
- 0:b14dfd8816da
Updated
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jah128 | 0:b14dfd8816da | 1 | /* University of York Robotics Laboratory Robot Arm Controller Board |
jah128 | 0:b14dfd8816da | 2 | * |
jah128 | 0:b14dfd8816da | 3 | * Robot Arm Remote Control |
jah128 | 0:b14dfd8816da | 4 | * |
jah128 | 0:b14dfd8816da | 5 | * File: remote.h |
jah128 | 0:b14dfd8816da | 6 | * |
jah128 | 0:b14dfd8816da | 7 | * (C) Dept. Electronics & Computer Science, University of York |
jah128 | 0:b14dfd8816da | 8 | * |
jah128 | 0:b14dfd8816da | 9 | * James Hilder, Alan Millard, Shuhei Miyashita, Homero Elizondo, Jon Timmis |
jah128 | 0:b14dfd8816da | 10 | * |
jah128 | 0:b14dfd8816da | 11 | * February 2017, Version 1.0 |
jah128 | 0:b14dfd8816da | 12 | * |
jah128 | 0:b14dfd8816da | 13 | */ |
jah128 | 0:b14dfd8816da | 14 | |
jah128 | 0:b14dfd8816da | 15 | |
jah128 | 0:b14dfd8816da | 16 | #ifndef REMOTE_H |
jah128 | 0:b14dfd8816da | 17 | #define REMOTE_H |
jah128 | 0:b14dfd8816da | 18 | |
jah128 | 0:b14dfd8816da | 19 | /** Remote Class |
jah128 | 0:b14dfd8816da | 20 | * The Remote controller class |
jah128 | 0:b14dfd8816da | 21 | * |
jah128 | 0:b14dfd8816da | 22 | * Example code for main.cpp: |
jah128 | 0:b14dfd8816da | 23 | * @code |
jah128 | 0:b14dfd8816da | 24 | * #include "robotarm.h" |
jah128 | 0:b14dfd8816da | 25 | * Robotarm arm; |
jah128 | 0:b14dfd8816da | 26 | * int main(){ |
jah128 | 0:b14dfd8816da | 27 | * arm.init(); |
jah128 | 0:b14dfd8816da | 28 | * while(1) { //Do something! |
jah128 | 0:b14dfd8816da | 29 | * } |
jah128 | 0:b14dfd8816da | 30 | * } |
jah128 | 0:b14dfd8816da | 31 | * @endcode |
jah128 | 0:b14dfd8816da | 32 | */ |
jah128 | 0:b14dfd8816da | 33 | class Remote |
jah128 | 0:b14dfd8816da | 34 | { |
jah128 | 0:b14dfd8816da | 35 | public: |
jah128 | 0:b14dfd8816da | 36 | /** |
jah128 | 0:b14dfd8816da | 37 | * Main initialisation routine for the robot arm |
jah128 | 0:b14dfd8816da | 38 | * |
jah128 | 0:b14dfd8816da | 39 | * Set up the display, set up listener for remote control, set up servos |
jah128 | 0:b14dfd8816da | 40 | */ |
jah128 | 0:b14dfd8816da | 41 | void init(void); |
jah128 | 0:b14dfd8816da | 42 | |
jah128 | 0:b14dfd8816da | 43 | /** |
jah128 | 0:b14dfd8816da | 44 | * Set the LED on the remote |
jah128 | 0:b14dfd8816da | 45 | * param: mode 0=off 1=red 2=green 3=both |
jah128 | 0:b14dfd8816da | 46 | */ |
jah128 | 0:b14dfd8816da | 47 | void set_led(char mode); |
jah128 | 0:b14dfd8816da | 48 | |
jah128 | 0:b14dfd8816da | 49 | /** |
jah128 | 0:b14dfd8816da | 50 | * Detect if remote has been attached or detached |
jah128 | 0:b14dfd8816da | 51 | */ |
jah128 | 0:b14dfd8816da | 52 | void detect_remote(void); |
jah128 | 0:b14dfd8816da | 53 | |
jah128 | 0:b14dfd8816da | 54 | /** |
jah128 | 0:b14dfd8816da | 55 | * Detect if a direction switch is being pressed |
jah128 | 0:b14dfd8816da | 56 | */ |
jah128 | 0:b14dfd8816da | 57 | void detect_direction(void); |
jah128 | 0:b14dfd8816da | 58 | |
jah128 | 0:b14dfd8816da | 59 | /** |
jah128 | 0:b14dfd8816da | 60 | * Move the servo based on controller position |
jah128 | 0:b14dfd8816da | 61 | */ |
jah128 | 0:b14dfd8816da | 62 | void move_servo(char servo_number, int adjust); |
jah128 | 0:b14dfd8816da | 63 | |
jah128 | 0:b14dfd8816da | 64 | |
jah128 | 0:b14dfd8816da | 65 | }; |
jah128 | 0:b14dfd8816da | 66 | #endif // REMOTE_H |
jah128 | 0:b14dfd8816da | 67 | |
jah128 | 0:b14dfd8816da | 68 | /* |
jah128 | 0:b14dfd8816da | 69 | * Copyright 2017 University of York |
jah128 | 0:b14dfd8816da | 70 | * |
jah128 | 0:b14dfd8816da | 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:b14dfd8816da | 72 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 |
jah128 | 0:b14dfd8816da | 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:b14dfd8816da | 74 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
jah128 | 0:b14dfd8816da | 75 | * See the License for the specific language governing permissions and limitations under the License. |
jah128 | 0:b14dfd8816da | 76 | * |
jah128 | 0:b14dfd8816da | 77 | */ |