![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
sampleProgram
Dependencies: QEI accelerator bit_test cyclic_io cyclic_var cylinder event_var limit mbed mecanum motor_drive pid pid_encoder rs422_put sbdbt servo
Fork of 17robo_fuzi by
Diff: main.cpp
- Revision:
- 75:cd507886ee57
- Parent:
- 74:98bad67fde39
- Child:
- 76:03475cafb326
--- a/main.cpp Sun Oct 22 10:55:47 2017 +0000 +++ b/main.cpp Sun Oct 22 11:18:08 2017 +0000 @@ -24,15 +24,15 @@ #define RS422_RX p27 #define CONTROL_INDICATOR p11 -#define SHOULDER_LEFT_HIGH p1 -#define SHOULDER_LEFT_LOW p1 -#define SHOULDER_RIGHT_HIGH p2 -#define SHOULDER_RIGHT_LOW p2 +#define SHOULDER_LEFT_HIGH p6 +#define SHOULDER_LEFT_LOW p7 +#define SHOULDER_RIGHT_HIGH p8 +#define SHOULDER_RIGHT_LOW p9 -#define GROUND_ENCORDER_X_A p3 -#define GROUND_ENCORDER_X_B p4 -#define GROUND_ENCORDER_Y_A p5 -#define GROUND_ENCORDER_Y_B p6 +#define GROUND_ENCORDER_X_A p10 +#define GROUND_ENCORDER_X_B p11 +#define GROUND_ENCORDER_Y_A p12 +#define GROUND_ENCORDER_Y_B p13 #define GUN_ENCORDER_A p7 #define GUN_ENCORDER_B p8 @@ -95,6 +95,12 @@ CyclicVar swordSwingCyclic; DigitalOut controlIndigator(CONTROL_INDICATOR); +//全国大会用追記 +Cylinder shoulderLeft(SHOULDER_LEFT_HIGH,SHOULDER_LEFT_LOW); +Cylinder shoulderRight(SHOULDER_RIGHT_HIGH,SHOULDER_RIGHT_LOW); +eventVar eventShikaku; +eventVar eventSankaku; + int main() { @@ -105,6 +111,16 @@ } } +void shoulder(){ + shoulderLeft.cyclic(eventShikaku.getRise()); + shoulderRight.cyclic(eventSankaku.getRise()); +} + +void controllerEvent(){ + eventShikaku.input(sbdbt.shikaku); + eventSankaku.input(sbdbt.sankaku); +} + void setup() { wait(1.0);