Difference between revisions of "How to handle the gpio-LED"
From IGEP - ISEE Wiki
(Created page with '= Overview = In this tutorial, we are going to use the '''4 LED's available in the board''', which probably is the most simple feature in the board, but sometimes you may want L…') |
m (→IGEP COM PROTON Board) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
= Overview = | = Overview = | ||
− | In this tutorial, we are going to use the '''4 LED's available in the board''', which probably is the most simple feature in the board, but sometimes you may want LED's to be a way of checking the status of some of your applications. | + | In this tutorial, we are going to use the '''4 LED's available in the board (3 LED's in IGEP COM PROTON)''', which probably is the most simple feature in the board, but sometimes you may want LED's to be a way of checking the status of some of your applications. |
You can easily '''turn LED's on and off''' using the 'echo' instruction. | You can easily '''turn LED's on and off''' using the 'echo' instruction. | ||
= IGEPv2 Board = | = IGEPv2 Board = | ||
− | + | <section begin=IGEPv2 /> | |
''' Basic ''' | ''' Basic ''' | ||
Line 47: | Line 47: | ||
Now the selected led is configured with a timer consisting of 250 miliseconds ON and 750 miliseconds OFF. | Now the selected led is configured with a timer consisting of 250 miliseconds ON and 750 miliseconds OFF. | ||
+ | <section end=IGEPv2 /> | ||
= IGEP COM MODULE Board = | = IGEP COM MODULE Board = | ||
− | + | <section begin=IGEP_COM_MODULE /> | |
''' Basic ''' | ''' Basic ''' | ||
Line 64: | Line 65: | ||
''' Know more ''' | ''' Know more ''' | ||
− | + | IGEP COM MODULE LED's are controlled with it's platform device at /sys/devices/platform/leds-gpio/leds/ | |
If you want to trigger the leds you can enable this mode and select the trigger source (none by default) to: mmc0, mmc1, timer, heartbeat and default-on.<br> | If you want to trigger the leds you can enable this mode and select the trigger source (none by default) to: mmc0, mmc1, timer, heartbeat and default-on.<br> | ||
Line 89: | Line 90: | ||
Now the selected led is configured with a timer consisting of 250 miliseconds ON and 750 miliseconds OFF. | Now the selected led is configured with a timer consisting of 250 miliseconds ON and 750 miliseconds OFF. | ||
+ | <section end=IGEP_COM_MODULE /> | ||
+ | |||
+ | = IGEP COM PROTON Board = | ||
+ | <section begin=IGEP_COM_PROTON /> | ||
+ | ''' Basic ''' | ||
+ | |||
+ | Log into IGEP COM PROTON (for example via SSH, as shown in the previous chapter), and run the following commands to turn LED's on: | ||
+ | |||
+ | <pre>echo 1 > /sys/devices/platform/leds-gpio/leds/d242\:green/brightness | ||
+ | echo 1 > /sys/devices/platform/leds-gpio/leds/d441\:green/brightness | ||
+ | echo 1 > /sys/devices/platform/leds-gpio/leds/d442\:green/brightness</pre> | ||
+ | |||
+ | You can turn them down using the same command and write '0' instead of '1'. | ||
+ | |||
+ | |||
+ | ''' Know more ''' | ||
+ | |||
+ | IGEP COM PROTON LED's are controlled with it's platform device at /sys/devices/platform/leds-gpio/leds/ | ||
+ | |||
+ | If you want to trigger the leds you can enable this mode and select the trigger source (none by default) to: mmc0, mmc1, timer, heartbeat and default-on.<br> | ||
+ | |||
+ | To enable any of this modes you just have to change a parameter in the directory of the led you want to control. You can see all the possibilities using the instruction 'cat':<br> | ||
+ | |||
+ | <pre>$ cat /sys/devices/platform/leds-gpio/leds/d242\:green/trigger | ||
+ | |||
+ | [none] nand-disk mmc0 timer heartbeat backlight gpio default-on</pre> | ||
+ | |||
+ | In the example above, we have checked the status of the trigger in led d242:green. Mode 'none' is selected. | ||
+ | |||
+ | To change it, for example, to the ''timer'' mode you can use 'echo': | ||
+ | |||
+ | <pre>echo timer > /sys/devices/platform/leds-gpio/leds/d242\:green/trigger | ||
+ | </pre> | ||
+ | |||
+ | In this case, we have set the trigger to the 'timer' mode. Now you can set the time for what the led is ON and the time it is OFF using: | ||
+ | |||
+ | <pre>echo 250 > /sys/devices/platform/leds-gpio/leds/d242\:green/delay_on | ||
+ | echo 750 > /sys/devices/platform/leds-gpio/leds/d242\:green/delay_off | ||
+ | </pre> | ||
+ | |||
+ | Now the selected led is configured with a timer consisting of 250 miliseconds ON and 750 miliseconds OFF. | ||
+ | <section end=IGEP_COM_PROTON /> |
Latest revision as of 17:09, 28 August 2012
Overview
In this tutorial, we are going to use the 4 LED's available in the board (3 LED's in IGEP COM PROTON), which probably is the most simple feature in the board, but sometimes you may want LED's to be a way of checking the status of some of your applications.
You can easily turn LED's on and off using the 'echo' instruction.
IGEPv2 Board
Basic
Log into IGEPv2 (for example via SSH, as shown in the previous chapter), and run the following commands to turn LED's on:
echo 1 > /sys/devices/platform/leds-gpio/leds/d240\:green/brightness echo 1 > /sys/devices/platform/leds-gpio/leds/d240\:red/brightness echo 1 > /sys/devices/platform/leds-gpio/leds/d440\:green/brightness echo 1 > /sys/devices/platform/leds-gpio/leds/d440\:red/brightness
You can turn them down using the same command and write '0' instead of '1'.
Know more
IGEPv2 LED's are controlled with it's platform device at /sys/devices/platform/leds-gpio/leds/
If you want to trigger the leds you can enable this mode and select the trigger source (none by default) to: mmc0, mmc1, timer, heartbeat and default-on.
To enable any of this modes you just have to change a parameter in the directory of the led you want to control. You can see all the possibilities using the instruction 'cat':
$ cat /sys/devices/platform/leds-gpio/leds/d240\:green/trigger [none] mmc0 mmc1 timer heartbeat default-on
In the example above, we have checked the status of the trigger in led D240:green. Mode 'none' is selected.
To change it, for example, to the timer mode you can use 'echo':
echo timer > /sys/devices/platform/leds-gpio/leds/d240\:green/trigger
In this case, we have set the trigger to the 'timer' mode. Now you can set the time for what the led is ON and the time it is OFF using:
echo 250 > /sys/devices/platform/leds-gpio/leds/d240\:green/delay_on echo 750 > /sys/devices/platform/leds-gpio/leds/d240\:green/delay_off
Now the selected led is configured with a timer consisting of 250 miliseconds ON and 750 miliseconds OFF.
IGEP COM MODULE Board
Basic
Log into IGEP COM MODULE (for example via SSH, as shown in the previous chapter), and run the following commands to turn LED's on:
echo 1 > /sys/devices/platform/leds-gpio/leds/d210\:green/brightness echo 1 > /sys/devices/platform/leds-gpio/leds/d210\:red/brightness echo 1 > /sys/devices/platform/leds-gpio/leds/d440\:green/brightness echo 1 > /sys/devices/platform/leds-gpio/leds/d440\:red/brightness
You can turn them down using the same command and write '0' instead of '1'.
Know more
IGEP COM MODULE LED's are controlled with it's platform device at /sys/devices/platform/leds-gpio/leds/
If you want to trigger the leds you can enable this mode and select the trigger source (none by default) to: mmc0, mmc1, timer, heartbeat and default-on.
To enable any of this modes you just have to change a parameter in the directory of the led you want to control. You can see all the possibilities using the instruction 'cat':
$ cat /sys/devices/platform/leds-gpio/leds/d210\:green/trigger [none] mmc0 mmc1 timer heartbeat default-on
In the example above, we have checked the status of the trigger in led D210:green. Mode 'none' is selected.
To change it, for example, to the timer mode you can use 'echo':
echo timer > /sys/devices/platform/leds-gpio/leds/d210\:green/trigger
In this case, we have set the trigger to the 'timer' mode. Now you can set the time for what the led is ON and the time it is OFF using:
echo 250 > /sys/devices/platform/leds-gpio/leds/d210\:green/delay_on echo 750 > /sys/devices/platform/leds-gpio/leds/d210\:green/delay_off
Now the selected led is configured with a timer consisting of 250 miliseconds ON and 750 miliseconds OFF.
IGEP COM PROTON Board
Basic
Log into IGEP COM PROTON (for example via SSH, as shown in the previous chapter), and run the following commands to turn LED's on:
echo 1 > /sys/devices/platform/leds-gpio/leds/d242\:green/brightness echo 1 > /sys/devices/platform/leds-gpio/leds/d441\:green/brightness echo 1 > /sys/devices/platform/leds-gpio/leds/d442\:green/brightness
You can turn them down using the same command and write '0' instead of '1'.
Know more
IGEP COM PROTON LED's are controlled with it's platform device at /sys/devices/platform/leds-gpio/leds/
If you want to trigger the leds you can enable this mode and select the trigger source (none by default) to: mmc0, mmc1, timer, heartbeat and default-on.
To enable any of this modes you just have to change a parameter in the directory of the led you want to control. You can see all the possibilities using the instruction 'cat':
$ cat /sys/devices/platform/leds-gpio/leds/d242\:green/trigger [none] nand-disk mmc0 timer heartbeat backlight gpio default-on
In the example above, we have checked the status of the trigger in led d242:green. Mode 'none' is selected.
To change it, for example, to the timer mode you can use 'echo':
echo timer > /sys/devices/platform/leds-gpio/leds/d242\:green/trigger
In this case, we have set the trigger to the 'timer' mode. Now you can set the time for what the led is ON and the time it is OFF using:
echo 250 > /sys/devices/platform/leds-gpio/leds/d242\:green/delay_on echo 750 > /sys/devices/platform/leds-gpio/leds/d242\:green/delay_off
Now the selected led is configured with a timer consisting of 250 miliseconds ON and 750 miliseconds OFF.