
Template project for University of York ELE00032C Lab 1
main.cpp
- Committer:
- ajp109
- Date:
- 2020-08-27
- Revision:
- 1:ee571cefc13b
- Parent:
- 0:fac2ffd6f143
- Child:
- 2:f63cdb6f8a44
File content as of revision 1:ee571cefc13b:
#include "mbed.h" int main() { // Initialise the digital pin USER_BUTTON (the blue button) as an input DigitalIn button(USER_BUTTON); // Initialise the serial connection with the PC Serial pc(USBTX, USBRX); // Loop forever... while (true) { // Is the button being pressed? if (button) { pc.printf("Button is up\n"); } else { pc.printf("Button is down\n"); } // Wait for 500ms thread_sleep_for(500); } }