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 #include <cmath> 00002 00003 #include "mbed.h" 00004 00005 #define WAIT_TIME 1 00006 #define MAX_COUNT 255 00007 00008 00009 int main() { 00010 BusOut my_ledice(dp23, dp24, dp25, dp26, 00011 dp27, dp5, dp6, dp28); 00012 my_ledice = 0; 00013 00014 DigitalOut enable_signal(dp14); 00015 enable_signal = 0; 00016 00017 while(true) { 00018 if(DigitalIn(dp1)) 00019 my_ledice = 00020 (my_ledice == 0) ? MAX_COUNT : ((my_ledice - 1) % MAX_COUNT); 00021 else 00022 my_ledice = ((my_ledice + 1) % MAX_COUNT); 00023 00024 wait(WAIT_TIME); 00025 } 00026 00027 return 0; // redundant 00028 }
Generated on Wed Jul 27 2022 14:30:14 by
