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.
Dependencies: mbed
Fork of Exercise6 by
main.cpp@1:245bc5eb1bbe, 2020-02-24 (annotated)
- Committer:
- drewantech
- Date:
- Mon Feb 24 13:29:48 2020 +0000
- Revision:
- 1:245bc5eb1bbe
- Parent:
- 0:cb7457d7c822
- Child:
- 2:20562827e8dd
Exercise 2
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| drewantech | 0:cb7457d7c822 | 1 | #include "mbed.h" |
| drewantech | 1:245bc5eb1bbe | 2 | /**************************************************************** |
| drewantech | 1:245bc5eb1bbe | 3 | In this exercise I would like you to make one function called "ToggleAll" |
| drewantech | 1:245bc5eb1bbe | 4 | this function should switch the state of the led from its current state |
| drewantech | 1:245bc5eb1bbe | 5 | you can figure out the current state by typing "= led1;" |
| drewantech | 1:245bc5eb1bbe | 6 | in this function I expect to see and minimal lines of code as possible |
| drewantech | 1:245bc5eb1bbe | 7 | |
| drewantech | 1:245bc5eb1bbe | 8 | In the main function I expect to see the on and off functions replaced with this new one. |
| drewantech | 1:245bc5eb1bbe | 9 | |
| drewantech | 1:245bc5eb1bbe | 10 | best of luck. |
| drewantech | 1:245bc5eb1bbe | 11 | ***************************************************************/ |
| drewantech | 0:cb7457d7c822 | 12 | |
| drewantech | 1:245bc5eb1bbe | 13 | // these functions initializes the led pins and functions associated with them these are technically c++ but dont worry to much about this yet |
| drewantech | 1:245bc5eb1bbe | 14 | DigitalOut led1(D5); |
| drewantech | 1:245bc5eb1bbe | 15 | DigitalOut led2(D6); |
| drewantech | 1:245bc5eb1bbe | 16 | DigitalOut led3(D7); |
| drewantech | 1:245bc5eb1bbe | 17 | DigitalOut led4(D8); |
| drewantech | 1:245bc5eb1bbe | 18 | DigitalOut led5(D9); |
| drewantech | 1:245bc5eb1bbe | 19 | DigitalOut led6(D10); |
| drewantech | 1:245bc5eb1bbe | 20 | DigitalOut led7(D11); |
| drewantech | 1:245bc5eb1bbe | 21 | DigitalOut led8(D12); |
| drewantech | 0:cb7457d7c822 | 22 | |
| drewantech | 1:245bc5eb1bbe | 23 | // this is your main function and is where the code starts good luck! |
| drewantech | 0:cb7457d7c822 | 24 | int main() { |
| drewantech | 1:245bc5eb1bbe | 25 | |
| drewantech | 0:cb7457d7c822 | 26 | } |
