can actuator

Dependencies:   MS9g_move_sin mbed-STM32F103C8T6 mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "stm32f103c8t6.h"
00003 #include "MS9g_move_sin.h"
00004 
00005 DigitalOut myled(PC_13);
00006 InterruptIn button_left (PA_0);
00007 InterruptIn button_right (PA_1);
00008 Servo_9g_CAN Servo(PA_11, PA_12);
00009 
00010 void left() {
00011     Servo.sendPosition(4, 1);
00012 }
00013 void right() {
00014     Servo.sendPosition(4, 2);
00015 }
00016 void neitral() {
00017     Servo.sendPosition(4, 1.5);
00018 }
00019 
00020 int main() {
00021     confSysClock();
00022     button_left.fall(&left);
00023     button_left.rise(&neitral);
00024     button_right.fall(&right);
00025     button_right.rise(&neitral);
00026     while(1) {
00027        myled != myled;
00028        wait(0.5);
00029     }
00030 }