This version of the code has the core communication functionality of the mood-light.

To use it, load the program into your MKC (with the BlinkT hardware connected) and RUN it. If your hardware is connected correctly then all LEDs should light up green. If not - check connections. (Pin 3 on MKC to eighth pin along from left  on top row on BlinkT. Pin 25 MM to ninth pin. 0v (pin 8 or 19 on MM) to third pin. +5v to first or second pin) 

The program will work with several of the colour buttons on the IR remote (red, green, blue, white, yellow, mauve, etc). Also On/Off toggle. Keep an eye on your Terminal screen too as some info is displayed there too.

Press Ctrl-C to stop the program and look at the code - it is relatively straight forward. Then, RUN it again, press Ctrl-C (this sets up the I/O pins) and at the command prompt you can set variables rr, gg, and bb to any value from 0 (for off) to 255 (for full intensity). Then to 'send' these values to the BlinkT, simply call the 'q' SUB by literally typing q (then press Enter). 


By the way, if you do go back into the Editor then it will 'reset' the pins to an unconfigured (floating) state. Simply RUN the program again and it will 'configure' the pins for you, then Ctrl-C to return to Command Prompt with the relevant pins configured as outputs.


Also, the variable ML_Brightness can take a value between 0 (LEDs off) and 32 (max brightness). You can set any combination of these four variables with appropriate values and send to the BlinkT in the method outlined above. (Good to experiment by changing one variable at a time and sending it to see the effect).  

30th April 2020