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
- Committer:
- CSTritt
- Date:
- 2017-10-19
- Revision:
- 0:cc014c610423
File content as of revision 0:cc014c610423:
/*
Project: HeaderTest
File: main.cpp
Last revised by: Dr. C. S. Tritt
Last revision on: 9/19/17 (v. 1.0)
Repeatedly toggles on-board LED.
This example code is in the public domain.
*/
// Use #include directives to "paste" text from other files into your code.
// Use this #include to declare all the mbed driver classes. The mbed library
// must also be added to the project either by importing it or by "Fixing" the
// error that is generated when it has not been imported.
#include "mbed.h"
// Use this type of #include to include your own custom header files. Typically
// 1 per project or library.
#include <myProj.h>
// Mbed driver class objects are typically declared and defined as global.
DigitalOut board_LED(LED1);
// Define global variables here.
const float BASE_WAIT = 0.1;
int cycles = 1;
/* The "main" function defines your main program -- it executes as soon as
you program the board.
*/
int main() { // This curly brace marks the beginning of the main function.
board_LED = 0; // Initialize LED state (not necessary in this case).
while(true) { // while(true) repeat forever.
myStuff(); // Call function that is in its own file.
if (cycles == 11) { // Reset cycles after 10 of them.
cycles = 1;
}
}
}