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.
Revision 0:f9065ea26a3d, committed 2021-04-21
- Comitter:
- wadesamples
- Date:
- Wed Apr 21 02:57:18 2021 +0000
- Commit message:
- Works on conditional loops;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Apr 21 02:57:18 2021 +0000 @@ -0,0 +1,35 @@ +/* + * Lab #: 4 + * Lab Title: Counting in binary with loops + * Author(s): Wade Samples + * Date: 04/14/2021 + * Purpose: Conditional loops + */ + +#include "mbed.h" +#include "TTU_CSC1300.h" + +BusOut all_leds (LED0_PIN, LED1_PIN, LED2_PIN); + +int main() +{ + //this while(TRUE) loop keeps the program running + while(TRUE) + { + while (sw5 == true) + { + all_leds = 7; + wait_ms(10); + all_leds = 0; + } + + do{ + int i; + for (i = 0; i <= 7; i++) + { + all_leds = i; + wait_ms(300); + } + }while (sw5 == false); + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Apr 21 02:57:18 2021 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file