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:
- gcarmonar
- Date:
- 2014-02-27
- Revision:
- 0:2f77b2d22786
File content as of revision 0:2f77b2d22786:
#include "mbed.h" DigitalOut blueled_pin(LED3); DigitalOut redled_pin(LED1); Serial pc(USBTX, USBRX); // tx, rx int red, blue, t; Timer timer; int main() { timer.start(); red = 0; blue = 0; blueled_pin = 1; redled_pin = 1; while(true){ if (t % 3 == 0 && blue == 0){ blueled_pin = !blueled_pin; blue = 1; pc.printf("blue\n"); }else if(t % 3 != 0){ blue = 0; } if (t % 2 == 0 && red == 0){ redled_pin = !redled_pin; red = 1; pc.printf("red\n"); }else if(t % 2 != 0){ red = 0; } t = timer.read(); } }