Difference between revisions of "Single Color LED (use with mDesigner)"

From Microduino Wiki
Jump to: navigation, search
(Set Pin)
(Set Pin)
Line 22: Line 22:
 
The follow blocks are used for this module.
 
The follow blocks are used for this module.
 
==Set Pin==
 
==Set Pin==
[[File:mDesigner_Block_Set_Pin_(Digital).png]]
 
 
This block sets the voltage level on the selected pin either to '''high''' or '''low'''.
 
This block sets the voltage level on the selected pin either to '''high''' or '''low'''.
 
*When set to '''high''', the Single Color LED turns on (illuminates).
 
*When set to '''high''', the Single Color LED turns on (illuminates).
 
*When set to '''low''', the Single Color LED turns off (no illumination).
 
*When set to '''low''', the Single Color LED turns off (no illumination).
 +
[[File:mDesigner_Block_Set_Pin_(Digital).png]]
 +
*Pin Number - the pin to configure the state of.
 +
*State - set the pin to high or low state.
 
===Examples===
 
===Examples===
  

Revision as of 22:09, 31 May 2018

The Single Color LED is a light emitting diode (LED), which is capable of emitting a illuminating a single color. Red, green and yellow are the common colors. Support for this trinket is found in mDesigner.

Compatible Pins

The following pins on the Hub or mCenter+'s Hub support this module:

Hub

Pin Name Compatibility Notes
Pin 0 Yes Not recommended, since Pin 0 & 1 are used by mDesigner (serial communication).
Pin 1 Yes Not recommended, since Pin 0 & 1 are used by mDesigner (serial communication).

Blocks

The follow blocks are used for this module.

Set Pin

This block sets the voltage level on the selected pin either to high or low.

  • When set to high, the Single Color LED turns on (illuminates).
  • When set to low, the Single Color LED turns off (no illumination).

MDesigner Block Set Pin (Digital).png

  • Pin Number - the pin to configure the state of.
  • State - set the pin to high or low state.

Examples

Set Pin PWM

This block sets the voltage level on the selected pin varying values. Values between 0 and 255 will cause the Single Color LED to turn on at different levels.

  • When set to 255, the Single Color LED is at maximum on.
  • When set to 0, the Single COlor LED is off.
  • When set to 127, the Single Color LED is half-way on.
  • Other values between 0 and 255 will turn on the LED at appropriate brightness levels.

*Note: Only pins which support "Analog Write" will work correctly with this block.

  • For Microduino / mCookie Core: Pins A, B, C
  • For Microduino / mCookie Core+, mCenter+: Pins D, E, F