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 "mbed.h" 00002 00003 //Global objects 00004 BusOut binaryOutput(D5, D6, D7); 00005 00006 00007 //Main function 00008 int main() { 00009 00010 //Create a variable to hold the bit pattern 00011 unsigned int u; 00012 00013 while(1) { 00014 00015 u = 1; //Set initial value 0 00016 int count = 0; 00017 while (count++ < 3) { 00018 binaryOutput = u; //Write to LEDs 00019 u = u << 1; //Shift left 1 bit 00020 wait(0.25); //Wait 00021 } 00022 00023 //TODO: Make the pattern shift in the opposite direction 00024 // (also known as the knight rider pattern) 00025 00026 00027 } //end while(1) 00028 } //end main
Generated on Thu Aug 18 2022 00:41:24 by
1.7.2