David Mc Sherry
/
EMBED_LAB_Q4
Colour mixer
main.cpp
- Committer:
- t00214916
- Date:
- 2021-08-21
- Revision:
- 0:117065dd7f27
File content as of revision 0:117065dd7f27:
#include "mbed.h" Serial pc (USBTX, USBRX); PwmOut red(p23); PwmOut green(p24); AnalogIn pot1(p19); AnalogIn pot2(p20); float p1; float p2; int main() { while(1) { p1 = pot1; p2 = pot2; red = 1 - pot1; green = 1 - pot2; pc.printf("pot1 value = %0.2f\n\r", p1); pc.printf("pot2 value = %0.2f\n\r", p2); wait (2); } }