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: EthernetInterface LM75B mbed-rtos mbed
Fork of communication by
led.cpp@0:52e944ca21ea, 2018-03-13 (annotated)
- Committer:
- JelleRaes
- Date:
- Tue Mar 13 09:40:51 2018 +0000
- Revision:
- 0:52e944ca21ea
- Child:
- 2:067142778937
voorlopig beste versie;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| JelleRaes | 0:52e944ca21ea | 1 | #include "mbed.h" |
| JelleRaes | 0:52e944ca21ea | 2 | #include <string.h> |
| JelleRaes | 0:52e944ca21ea | 3 | #include "led.h" |
| JelleRaes | 0:52e944ca21ea | 4 | |
| JelleRaes | 0:52e944ca21ea | 5 | Serial pc3(USBTX, USBRX); |
| JelleRaes | 0:52e944ca21ea | 6 | led::led(void) |
| JelleRaes | 0:52e944ca21ea | 7 | { |
| JelleRaes | 0:52e944ca21ea | 8 | count =4; |
| JelleRaes | 0:52e944ca21ea | 9 | colors[0].name="red"; |
| JelleRaes | 0:52e944ca21ea | 10 | colors[0].redValue = 0.0; |
| JelleRaes | 0:52e944ca21ea | 11 | colors[0].greenValue =1.0; |
| JelleRaes | 0:52e944ca21ea | 12 | colors[0].blueValue =1.0; |
| JelleRaes | 0:52e944ca21ea | 13 | |
| JelleRaes | 0:52e944ca21ea | 14 | colors[1].name="green"; |
| JelleRaes | 0:52e944ca21ea | 15 | colors[1].redValue = 1.0; |
| JelleRaes | 0:52e944ca21ea | 16 | colors[1].greenValue =0.0; |
| JelleRaes | 0:52e944ca21ea | 17 | colors[1].blueValue =1.0; |
| JelleRaes | 0:52e944ca21ea | 18 | |
| JelleRaes | 0:52e944ca21ea | 19 | colors[2].name="blue"; |
| JelleRaes | 0:52e944ca21ea | 20 | colors[2].redValue = 1.0; |
| JelleRaes | 0:52e944ca21ea | 21 | colors[2].greenValue =1.0; |
| JelleRaes | 0:52e944ca21ea | 22 | colors[2].blueValue =0.0; |
| JelleRaes | 0:52e944ca21ea | 23 | |
| JelleRaes | 0:52e944ca21ea | 24 | colors[3].name="black"; |
| JelleRaes | 0:52e944ca21ea | 25 | colors[3].redValue = 1.0; |
| JelleRaes | 0:52e944ca21ea | 26 | colors[3].greenValue =1.0; |
| JelleRaes | 0:52e944ca21ea | 27 | colors[3].blueValue =1.0; |
| JelleRaes | 0:52e944ca21ea | 28 | } |
| JelleRaes | 0:52e944ca21ea | 29 | |
| JelleRaes | 0:52e944ca21ea | 30 | |
| JelleRaes | 0:52e944ca21ea | 31 | led::COLOR led::getCOLOR(char *n){ |
| JelleRaes | 0:52e944ca21ea | 32 | led::COLOR temp; |
| JelleRaes | 0:52e944ca21ea | 33 | for(int i=0;i<count;i++){ |
| JelleRaes | 0:52e944ca21ea | 34 | if(strcmp(colors[i].name,n) ==0) |
| JelleRaes | 0:52e944ca21ea | 35 | temp=colors[i];} |
| JelleRaes | 0:52e944ca21ea | 36 | return temp; |
| JelleRaes | 0:52e944ca21ea | 37 | } |
