Tri-Color LED:

  • In previous lessons we have seen Light emitting diode on playme it is commonly known as Used LED1 and User LED2.
  • These are single color LEDs which can give only one color when it turn ON.
  • It may be RED,GREEN,BLUE etc. Tri-color LEDs are having three different color LEDs in one package.

  • Here we are having six tricolor LEDs in Playme. They are named as WS2812B RGB LED.
  • It can generate different colors based upon combination of Red, Green and Blue.
  • Goto mblock software and open it. Goto edit menu and select Arduino mode.

Goto Robots section.

  • Playme Motor Program is a Header file for Robot programming. It makes programming simple. By using this we can access all blocks easily and smoothly.
  • If we are not using this then it may give us errors in program.
  • So put this at start of program.Now drag Playme LED control block.
  • It consists of Red, green, Blue color field whose value can be set between 0-255.
  • 0 indicates minimum value i.e LEDs will remain OFF and 255 indicates maximum value.i.e LED will be ON with full brightness.
  • We can generate many colors using combination of RGB.

 

  • 1-6 indicates LED numbers. Playme consists of 6 tri color LEDs.
  • We can access individual LEDs  by its respective number.
  • If we want to glow only one Led then drag LED control block once choose your LED number and set its RGB value.

 

  • Now in this program we want blue color for all LEDs. So we are going put value in blue field.
  • Let’s take it as 150. At this value it will glow with medium brightness.

 

  • Do this for All remaining LEDs. Program will be :

  • Save program.Upload program to play me. After uploading is done you will get this message  of Uploading done
  • Click on close option. See output on Play me robot.
  • Now Try generating all the different colors using the color Blocks