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.
main.cpp
00001 /* mbed Microcontroller Library 00002 * Copyright (c) 2019 ARM Limited 00003 * SPDX-License-Identifier: Apache-2.0 00004 */ 00005 00006 //#include "mbed.h" 00007 //#include "platform/mbed_thread.h" 00008 00009 00010 // Blinking rate in milliseconds 00011 #define BLINKING_RATE_MS 500 00012 00013 #include "mbed.h" 00014 #include "StepperMotor.h" 00015 00016 StepperMotor m( P0_23, P1_02, P0_13, P0_15 ); 00017 00018 int main() { 00019 m.set_sync_mode( StepperMotor::SYNCHRONOUS ); 00020 m.set_power_ctrl( true ); 00021 00022 while( 1 ) { 00023 m.go_angle( 120 ); 00024 wait( 0.5 ); 00025 00026 m.go_angle( 240 ); 00027 wait( 0.5 ); 00028 00029 m.go_angle( 0 ); 00030 wait( 0.5 ); 00031 00032 m.go_angle( 240 ); 00033 wait( 0.5 ); 00034 00035 m.go_angle( 120 ); 00036 wait( 0.5 ); 00037 00038 m.go_angle( 0 ); 00039 wait( 0.5 ); 00040 } 00041 }
Generated on Sun Jul 24 2022 19:54:51 by
1.7.2