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); //Outputs as an integer 00005 BusIn binaryInput(D3, D4); //Inputs as an integer 00006 00007 00008 //Main function 00009 int main() { 00010 00011 //Create a variable to hold the bit pattern 00012 unsigned int u = 7; 00013 00014 while(1) { 00015 00016 binaryOutput = u; //Write to LEDs 00017 00018 //TOGGLE all 3 bits in u 00019 u = u ^ 7; 00020 00021 //Calculate the delay 00022 double delay = (double)(binaryInput+1); 00023 wait(delay * 0.25); //Wait 00024 00025 } //end while(1) 00026 } //end main
Generated on Fri Jul 22 2022 00:04:52 by
1.7.2