![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
A project that aims at making a LED based light system controlled by microcontroller and with BLE (soon) with smooth color transitions.
main.cpp@2:0bbd4fc5e202, 2017-08-18 (annotated)
- Committer:
- ledonger
- Date:
- Fri Aug 18 11:26:01 2017 +0000
- Revision:
- 2:0bbd4fc5e202
- Parent:
- 1:8b80523d8959
- Child:
- 3:25af55580ef6
Bug Fix => Variables uninitialized
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ledonger | 0:b350f8395bff | 1 | #include "mbed.h" |
ledonger | 0:b350f8395bff | 2 | #include "LEDManager.h" |
ledonger | 0:b350f8395bff | 3 | |
ledonger | 0:b350f8395bff | 4 | Timer timer; |
ledonger | 2:0bbd4fc5e202 | 5 | Serial pc(USBTX,USBRX,921600); |
ledonger | 0:b350f8395bff | 6 | |
ledonger | 0:b350f8395bff | 7 | |
ledonger | 1:8b80523d8959 | 8 | LEDManager *led1 = new LEDManager(D11,10000); |
ledonger | 1:8b80523d8959 | 9 | LEDManager *led2 = new LEDManager(D4,10000); |
ledonger | 2:0bbd4fc5e202 | 10 | LEDManager *led3 = new LEDManager(D7,10000); |
ledonger | 1:8b80523d8959 | 11 | LEDManager *led4 = new LEDManager(D5,10000); |
ledonger | 1:8b80523d8959 | 12 | LEDManager *led5 = new LEDManager(D6,10000); |
ledonger | 2:0bbd4fc5e202 | 13 | LEDManager *led6 = new LEDManager(D12,10000); |
ledonger | 1:8b80523d8959 | 14 | LEDManager *led7 = new LEDManager(D8,10000); |
ledonger | 1:8b80523d8959 | 15 | LEDManager *led8 = new LEDManager(D9,10000); |
ledonger | 1:8b80523d8959 | 16 | LEDManager *led9 = new LEDManager(D10,10000); |
ledonger | 0:b350f8395bff | 17 | |
ledonger | 0:b350f8395bff | 18 | int main() |
ledonger | 0:b350f8395bff | 19 | { |
ledonger | 2:0bbd4fc5e202 | 20 | pc.printf("Starting...\n"); |
ledonger | 0:b350f8395bff | 21 | |
ledonger | 0:b350f8395bff | 22 | printf("Test procedure\n"); |
ledonger | 1:8b80523d8959 | 23 | |
ledonger | 0:b350f8395bff | 24 | timer.start(); |
ledonger | 0:b350f8395bff | 25 | |
ledonger | 1:8b80523d8959 | 26 | |
ledonger | 1:8b80523d8959 | 27 | int time = timer.read_us(); |
ledonger | 0:b350f8395bff | 28 | |
ledonger | 2:0bbd4fc5e202 | 29 | |
ledonger | 1:8b80523d8959 | 30 | |
ledonger | 0:b350f8395bff | 31 | while(1) |
ledonger | 0:b350f8395bff | 32 | { |
ledonger | 1:8b80523d8959 | 33 | time = timer.read_us(); |
ledonger | 2:0bbd4fc5e202 | 34 | |
ledonger | 0:b350f8395bff | 35 | led1->processLED(time); |
ledonger | 0:b350f8395bff | 36 | led2->processLED(time); |
ledonger | 0:b350f8395bff | 37 | led3->processLED(time); |
ledonger | 0:b350f8395bff | 38 | led4->processLED(time); |
ledonger | 0:b350f8395bff | 39 | led5->processLED(time); |
ledonger | 0:b350f8395bff | 40 | led6->processLED(time); |
ledonger | 0:b350f8395bff | 41 | led7->processLED(time); |
ledonger | 0:b350f8395bff | 42 | led8->processLED(time); |
ledonger | 0:b350f8395bff | 43 | led9->processLED(time); |
ledonger | 2:0bbd4fc5e202 | 44 | |
ledonger | 0:b350f8395bff | 45 | } |
ledonger | 0:b350f8395bff | 46 | } |
ledonger | 0:b350f8395bff | 47 |