Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MS9g_move_sin mbed-STM32F103C8T6 mbed
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 }
Generated on Wed Jul 20 2022 14:28:43 by
1.7.2