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.
Revision 7:b8018fce578f, committed 2020-02-10
- Comitter:
- arthur_2000
- Date:
- Mon Feb 10 10:37:44 2020 +0000
- Parent:
- 6:f8cb706c480c
- Commit message:
- Kleur led veranderen aan de hand van potentiometers
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Sep 19 15:25:01 2017 +0000 +++ b/main.cpp Mon Feb 10 10:37:44 2020 +0000 @@ -3,17 +3,29 @@ // Using Arduino pin notation C12832 lcd(D11, D13, D12, D7, D10); - +PwmOut r (D5); +PwmOut g (D8); +PwmOut b (D9); +AnalogIn pot1 (A0); +AnalogIn pot2 (A1); + int main() { - int j=0; - lcd.cls(); - lcd.locate(0,3); - lcd.printf("mbed application shield!"); + + while(1) { + lcd.cls(); + lcd.locate(0,3); + lcd.printf("Pot 1 = %.2f", (float)pot1); + lcd.locate(0,14); + lcd.printf("Pot 2 = %.2f", (float)pot2); + + r = pot1; + g = pot2; + b = pot1; + wait(0.1); + } - while(true) { // this is the third thread - lcd.locate(0,15); - lcd.printf("Counting : %d",j++); - wait(1.0); - } + + + }