![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
This is some awesome robot code
Dependencies: mbed-rtos mbed QEI
Fork of ICRSEurobot13 by
Actuators/Arms/Arm.h@90:e4164bb8c60e, 2013-04-17 (annotated)
- Committer:
- madcowswe
- Date:
- Wed Apr 17 23:16:25 2013 +0000
- Revision:
- 90:e4164bb8c60e
- Parent:
- 65:4709ff6c753c
final state at end of competition. Includes avoid wooden team hack
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rsavitski | 65:4709ff6c753c | 1 | #ifndef EUROBOT_ACTUATORS_ARMS_ARM_H_ |
rsavitski | 65:4709ff6c753c | 2 | #define EUROBOT_ACTUATORS_ARMS_ARM_H_ |
twighk | 1:8119211eae14 | 3 | |
twighk | 1:8119211eae14 | 4 | #include "mbed.h" |
twighk | 1:8119211eae14 | 5 | |
rsavitski | 65:4709ff6c753c | 6 | namespace arm |
twighk | 1:8119211eae14 | 7 | { |
rsavitski | 65:4709ff6c753c | 8 | |
rsavitski | 65:4709ff6c753c | 9 | class Arm; |
twighk | 1:8119211eae14 | 10 | |
rsavitski | 65:4709ff6c753c | 11 | extern Arm lower_arm; |
rsavitski | 65:4709ff6c753c | 12 | extern Arm upper_arm; |
rsavitski | 65:4709ff6c753c | 13 | |
rsavitski | 65:4709ff6c753c | 14 | |
rsavitski | 65:4709ff6c753c | 15 | class Arm |
rsavitski | 65:4709ff6c753c | 16 | { |
twighk | 1:8119211eae14 | 17 | public: |
rsavitski | 65:4709ff6c753c | 18 | Arm (PwmOut pwm_in, float period_in, float min_pos_in, float max_pos_in) |
rsavitski | 65:4709ff6c753c | 19 | : pwm_(pwm_in), period_(period_in), min_pos_(min_pos_in), max_pos_(max_pos_in) |
rsavitski | 65:4709ff6c753c | 20 | { |
rsavitski | 65:4709ff6c753c | 21 | pwm_.period(period_); |
twighk | 1:8119211eae14 | 22 | } |
twighk | 1:8119211eae14 | 23 | |
rsavitski | 65:4709ff6c753c | 24 | void go_up() |
rsavitski | 65:4709ff6c753c | 25 | { |
rsavitski | 65:4709ff6c753c | 26 | pwm_.pulsewidth_us(max_pos_*1000); |
twighk | 1:8119211eae14 | 27 | } |
twighk | 1:8119211eae14 | 28 | |
rsavitski | 65:4709ff6c753c | 29 | void go_down() |
rsavitski | 65:4709ff6c753c | 30 | { |
rsavitski | 65:4709ff6c753c | 31 | pwm_.pulsewidth_us(min_pos_*1000); |
twighk | 1:8119211eae14 | 32 | } |
twighk | 1:8119211eae14 | 33 | |
rsavitski | 65:4709ff6c753c | 34 | private: |
rsavitski | 65:4709ff6c753c | 35 | PwmOut pwm_; |
rsavitski | 65:4709ff6c753c | 36 | float period_; |
rsavitski | 65:4709ff6c753c | 37 | float min_pos_; |
rsavitski | 65:4709ff6c753c | 38 | float max_pos_; |
twighk | 1:8119211eae14 | 39 | |
twighk | 1:8119211eae14 | 40 | }; |
rsavitski | 65:4709ff6c753c | 41 | |
rsavitski | 65:4709ff6c753c | 42 | } //namespace |
rsavitski | 65:4709ff6c753c | 43 | |
rsavitski | 65:4709ff6c753c | 44 | #endif |