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: DebounceIn mbed
main.cpp
- Committer:
- figlax
- Date:
- 2015-05-26
- Revision:
- 0:f9546c3e2e72
- Child:
- 1:357e2c6d4e66
File content as of revision 0:f9546c3e2e72:
#include "mbed.h" DigitalOut myled(LED1); //Indicator light to indicate the program is running DigitalOut motor(D4); //To MOSFET DigitalOut indic(LED2); //Indicate Hall ES State DigitalIn hall(D6); //HFS (deprecated?) DigitalIn swiRe(D1); //Rear Limit Switch DigitalIn swiFr(D2); //Front Limit Switch int main() { myled = 1; wait(0.2); myled = 0; wait(0.2); myled = 1; wait(0.2); myled = 0; wait(0.2); myled = 1; while(1) { if (swiRe&&(~swiFr)){ motor = 1; indic = 1; } if((~swiRe)&&swiFr){ motor = 0; indic = 0; } //if (hall==1){ // motor = 1; // indic = 1; // } //if (hall == 0) { // motor= 0; // indic = 0; // } } }