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:
- gyth
- Date:
- 2015-05-21
- Revision:
- 0:55b07f83af75
File content as of revision 0:55b07f83af75:
#include "mbed.h"
DigitalOut red(D5);
DigitalOut blue(D8);
DigitalOut green(D9);
AnalogIn analog_value(A0);
int i;
int main() {
float meas;
int i;
while(1) {
meas = analog_value.read();
i = (int)(meas * 8);
red = i & 1;
blue = i & 2;
green = i & 4;
wait(0.2);
}
}