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.
Fork of HeaderTest by
myStuff.cpp@0:cc014c610423, 2017-10-19 (annotated)
- Committer:
- CSTritt
- Date:
- Thu Oct 19 21:05:11 2017 +0000
- Revision:
- 0:cc014c610423
Initial version. Demonstrates use of header files and compilation units (files) for each function.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| CSTritt | 0:cc014c610423 | 1 | /* |
| CSTritt | 0:cc014c610423 | 2 | Project: HeaderTest |
| CSTritt | 0:cc014c610423 | 3 | File: myStuff.cpp |
| CSTritt | 0:cc014c610423 | 4 | Last revised by: Dr. C. S. Tritt |
| CSTritt | 0:cc014c610423 | 5 | Last revision on: 10/19/17 (v. 1.0) |
| CSTritt | 0:cc014c610423 | 6 | |
| CSTritt | 0:cc014c610423 | 7 | This is the source file for the myStuff function. It toggles the LED. |
| CSTritt | 0:cc014c610423 | 8 | */ |
| CSTritt | 0:cc014c610423 | 9 | // See include comments in main.cpp and myProj.h. |
| CSTritt | 0:cc014c610423 | 10 | #include "mbed.h" |
| CSTritt | 0:cc014c610423 | 11 | #include <myProj.h> |
| CSTritt | 0:cc014c610423 | 12 | |
| CSTritt | 0:cc014c610423 | 13 | void myStuff(void) { |
| CSTritt | 0:cc014c610423 | 14 | board_LED = !board_LED; // Toggle LED state. |
| CSTritt | 0:cc014c610423 | 15 | wait(BASE_WAIT * (float) cycles); // Wait varying intervals. |
| CSTritt | 0:cc014c610423 | 16 | cycles++; // Slowly slow down flash rate. |
| CSTritt | 0:cc014c610423 | 17 | } |
