rgb

Dependencies:   C12832

Committer:
timonclaerhout
Date:
Mon Feb 10 10:16:36 2020 +0000
Revision:
4:1f114c172d80
Parent:
1:5ac8fa71dfb4
rgb;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
chris 0:f86c572491c3 1 #include "mbed.h"
timonclaerhout 4:1f114c172d80 2 #include "C12832.h"
chris 0:f86c572491c3 3
timonclaerhout 4:1f114c172d80 4
timonclaerhout 4:1f114c172d80 5
timonclaerhout 4:1f114c172d80 6 // Blinking rate in milliseconds
timonclaerhout 4:1f114c172d80 7 #define BLINKING_RATE_MS 500
timonclaerhout 4:1f114c172d80 8
timonclaerhout 4:1f114c172d80 9 C12832 lcd(D11, D13, D12, D7, D10);
timonclaerhout 4:1f114c172d80 10 AnalogIn pot1 (A0);
timonclaerhout 4:1f114c172d80 11 AnalogIn pot2 (A1);
chris 1:5ac8fa71dfb4 12 PwmOut r (D5);
chris 1:5ac8fa71dfb4 13 PwmOut g (D8);
chris 1:5ac8fa71dfb4 14 PwmOut b (D9);
chris 0:f86c572491c3 15
timonclaerhout 4:1f114c172d80 16
chris 0:f86c572491c3 17 int main()
chris 0:f86c572491c3 18 {
timonclaerhout 4:1f114c172d80 19 lcd.cls();
timonclaerhout 4:1f114c172d80 20 while(1) {
timonclaerhout 4:1f114c172d80 21
timonclaerhout 4:1f114c172d80 22 lcd.locate(0,3);
timonclaerhout 4:1f114c172d80 23 lcd.printf("Pot 1 = %.2f", (float)pot1);
timonclaerhout 4:1f114c172d80 24 lcd.locate(0,14);
timonclaerhout 4:1f114c172d80 25 lcd.printf("Pot 2 = %.2f", (float)pot2);
timonclaerhout 4:1f114c172d80 26
timonclaerhout 4:1f114c172d80 27
timonclaerhout 4:1f114c172d80 28 r = (float)pot1;
timonclaerhout 4:1f114c172d80 29 g = (float)pot1;
timonclaerhout 4:1f114c172d80 30 b = (float)pot2; ;
timonclaerhout 4:1f114c172d80 31 wait (0.1);
timonclaerhout 4:1f114c172d80 32 }
timonclaerhout 4:1f114c172d80 33
chris 0:f86c572491c3 34 }