Ryszard Piatek
/
LAB3_COLOURMIX
Revision 0:1ee7ebd7d308, committed 2019-08-07
- Comitter:
- t00203814
- Date:
- Wed Aug 07 01:13:40 2019 +0000
- Commit message:
- T00203814
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 1ee7ebd7d308 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Aug 07 01:13:40 2019 +0000 @@ -0,0 +1,20 @@ +#include "mbed.h"//includes mbed header + +AnalogIn pot1(p19);// Declares P19 as an analouge in called pot1 +AnalogIn pot2(p20);// Declares P20 as an analouge in called pot2 +PwmOut red(p25);// Declares P25 as a Pulse Width Modulation out called red +PwmOut blue(p23);// Declares P23 as a Pulse Width Modulation out called blue +Serial pc(USBTX, USBRX);// sets up serial connection to PC + +int main() +{ + while(1) { + red = !pot1;// makes the value of red equal to pot1 + blue = !pot2;// makes the value of blue equal to pot2 + red = !red;//makes red equal to not red + blue = !blue;//makes blue equal to not blue + pc.printf("Red = %f & Blue = %f\n\n\r",red.read(),blue.read());// prints values to Pc + wait(0.1); + } +} +
diff -r 000000000000 -r 1ee7ebd7d308 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Aug 07 01:13:40 2019 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file