Course 3 / Lecture 8:

Using indicator leds on the Lego Brick

LED lights are commonly used in all electrical equipment to display status information. Your Lego brick is also equipped with an RGB led, that can be programmed to light up in different colors, and to blink according to various patterns. This LED is a great way to provide information for the user of a robot. This lecture is bout teaching you how to use this LED sensor in your robot control code.

Requirements




Video tutorial: 'How to use the Lego Status Light in Ozeki 10'




Task #1:

Start Control Panel through any browser!

Make sure to use the IP address of your Ozeki server in any webbrowser through the 9505 port, login to Ozek 10 and open the Control Panel from the desktop GUI. For this step it is assumed that your Brick is already paired through Bluetooth, if not please pair it with the following useful tutorial: http://www.ozeki.hu/index.php?owpn=6065. You should know that the Control Panel is capable to manage the message routing of all connections added to Ozeki 10, including the Brick Status Light.


Figure 1 - Starting the Control Panel through the desktop GUI

Task #2:

Select 'LED_1' from the list!

If the Brick is connected to Ozeki 10, all available connections will appear (Figure 2). If the Brick devices are missing from the list, the following short guide should help you connect them: http://www.ozeki.hu/index.php?owpn=6067. You will find 'LED_1' appear on the connection list with a 'Details' button to the right. By clicking it, you will find yourself on the device chat window of the LED.


Figure 2 - This is how you can see the detected LED_1 device

Task #3:

Send color command to the LED using chat!

On the chat interface, please send 'help' to list all available commands for the Brick LED (Table 1). Start by changing the color you wish the LED to glow. You can choose from green, red or orange. Orange was used for this series. It's fine if you get here because you are just only one step away to be able to use the LED. Send 'orange' command, so you can see the Brick LED glow (Figure 3).


Figure 3 - Change LED to orange

Task #4:

Send flash command to the LED using chat!

By flashing the LED, you will see it glow for a certain amount of time, then keep itself turned off for the same short period. Create this with a simple 'orangeflash' command (Figure 4), so it will start flashing. You can try 'greenflash' and 'redflash' too. It is a good idea to write short Ozeki 10 codes for your robot. This way you can visually create different robot LED states. Try bulding codes later on.


Figure 4 - Flash LED in orange

Task #5:

Send pulse command to the LED using chat!

A pulsing LED consists of 2 flashes and a longer off period and then 2 flashes again. Make a colorful orange pulse by sending 'orangepulse' (Figure 5). You have probably noticed that you didn't had to subscribe to the LED (from STEP 3 to 5), because the LED is not designed to send outgoing messages. The Brick LED is simply an input device accepting commands to emit light.


Figure 5 - Pulse LED in orange

Task #6:

Check the events of the LED!

Finally you can turn the LED using 'off' command and click on the 'Events' tabpage on the top of the Lego LED panel. In Ozeki 10 each device has an event list. Here you can check the history of the LED communication. It shows all 4 LED commands that were sent from the Ozeki 10 user (Figure 6) towards the LED. These commands can be easily understood and will be described on the table just below the screenshot. If you do not remember what your device did, you can always check the event history. On the Control Panel you can find a common event page to see all events.


Figure 6 - See the Lego Mindstorms EV3 Brick's Status Light events




The Brick Status Light command set

The text commands were created for the Lego LED to effectively use it from Ozeki 10. These tables contain all commands to control the Status Light. These messages can be sent through chat by yourself if you click on the 'Send' button or route commands from any other Ozeki 10 connection. You can control the LED simply from other services or devices, like e-mail, SMS or Snap codes.

Command examples Description
off turn off the LED
green set LED color to green
red set LED color to red
orange set LED color to orange
greenflash set color to green and flash LED
redflash set color to red and flash LED
orangeflash set color to orange and flash LED
greenpulse set color to green and pulse LED
redpulse set color to red and pulse LED
orangepulse set color to orange and pulse LED

Commands Table - Commands controlling the Status Light

Basic commands Description
help request the command set
subscribe subscribe to device messages
unsubscribe unsubscribe from device messages
subscribers shows the list of subscribers

Basic commands Table - General commands for all devices

More information


Next


Copyright © 2000- |Ozeki Ltd | info@ozekirobot.com |
Page: 6102 | 79.99.42.43 | Login
Thank you for visiting this page