The Armadillo-400 Series LEDs are supported as LED class devices. The LEDs can be controlled with the files under the LED class directories. For the LED class directories and corresponding LEDs, refer to 表7.1「LEDs and LED Class Directories」.
表7.1 LEDs and LED Class Directories
LED Class Directory | Description |
---|
/sys/class/leds/red/ | LED3 (red) |
/sys/class/leds/green/ | LED4 (green) |
/sys/class/leds/yellow/ | LED5 (yellow) |
7.1.1. Activating and Deactivating LEDs
LEDs can be turned on and off by writing an appropriate value to the brightness file under the LED class directory. A value between 0 and 255 can be written to the brightness file.
Writing any value apart from 0 to the brightness file turns the LED on. As the Armadillo-400 Series LEDs do not have brightness control functionality, the value has no effective meaning.
Writing 0 to the brightness file turns the LED off.
The current state of the LED can be obtained by reading the brightness file. 0 represents the off state, and any other value represents an on state.
A trigger to turn the LED on and off can be set by writing an appropriate value to the trigger file under the LED class directory. For values supported by the trigger file, refer to 表7.1「LEDs and LED Class Directories」.
表7.2 trigger Configuration
Configuration | Description |
---|
none | No trigger is set. |
mmc0 | LED acts as microSD card access lamp. |
timer | Blink on and off at certain intervals. After setting this trigger, delay_on and delay_off files appear under the LED class directory which can be used to set the on and off times in millisecond increments. |
heartbeat | Blink on and off like a heart beat. |
default-on | Used mainly from the kernel. The LED is turned on at boot time. |
Executing the commands below will cause LED3 to repeatedly turn on for 1 second and then off for 500 milliseconds.
The current trigger of the LED can be obtained by reading the trigger file. The value enclosed in [] is the current trigger.
The Armadillo-400 Series GPIO are supported as GPIO class devices. The GPIO can be controlled with the files under the GPIO class directories. For the GPIO class directories and corresponding GPIO, refer to 表7.3「GPIO and GPIO Class Directories」.
表7.3 GPIO and GPIO Class Directories
GPIO Class Directory | Description |
---|
/sys/class/gpio/CON9_1/ | CON9 pin 1 |
/sys/class/gpio/CON9_2/ | CON9 pin 2 |
/sys/class/gpio/CON9_11/ | CON9 pin 11 |
/sys/class/gpio/CON9_12/ | CON9 pin 12 |
/sys/class/gpio/CON9_13/ | CON9 pin 13 |
/sys/class/gpio/CON9_14/ | CON9 pin 14 |
/sys/class/gpio/CON9_15/ | CON9 pin 15 |
/sys/class/gpio/CON9_16/ | CON9 pin 16 |
/sys/class/gpio/CON9_17/ | CON9 pin 17 |
/sys/class/gpio/CON9_18/ | CON9 pin 18 |
/sys/class/gpio/CON9_21/ | CON9 pin 21 |
/sys/class/gpio/CON9_22/ | CON9 pin 22 |
/sys/class/gpio/CON9_23/ | CON9 pin 23 |
/sys/class/gpio/CON9_24/ | CON9 pin 24 |
/sys/class/gpio/CON9_25/ | CON9 pin 25 |
/sys/class/gpio/CON9_26/ | CON9 pin 26 |
/sys/class/gpio/CON9_27/ | CON9 pin 27 |
/sys/class/gpio/CON9_28/ | CON9 pin 28 |
7.2.1. Changing I/O Direction
The I/O direction can be changed by writing an appropriate value to the direction file under the GPIO class directory. For values supported by the direction file, refer to 表7.4「direction Configuration」.
表7.4 direction Configuration
Configuration | Description |
---|
high | Set I/O direction to OUTPUT. The input level can be obtained and set in this state. The input level will be HIGH. |
out | Set I/O direction to OUTPUT. The input level can be obtained and set in this state. The input level will be LOW. |
low | This is the same as setting "out". |
in | Set I/O direction to INPUT. The input level can be obtained but not set in this state. |
7.2.2. Obtaining Input Level
The input level can be obtained by reading the value file under the GPIO class directory. 0 represents a LOW level and 1 a HIGH level. The input level can be obtained both when the I/O direction is set to INPUT and OUTPUT.
7.2.3. Configuring Output Level
The output level can be set by writing an appropriate value to the value file under the GPIO directory. 0 represents a LOW level and 1 a HIGH level. Output level configuration can only be carried out when the I/O direction is set to OUTPUT.
As the RTC Option Module is connected by default in the Armadillo-420 Basic Model Development Set, time information can be maintained even after disconnecting power by using the RTC (calendar clock) function.
To set time information to the RTC, first set the system clock. After that, then set the hardware clock (RTC) to match the system clock.
7.3.1. Setting System Clock With date
The time format used as an argument to the date command is: MMDDhhmmCCYY.ss. In the example below, the date and time are set to 1/23/2000 4:56:00.
[armadillo ~]#
date
[armadillo ~]#
date 012304562000.00
[armadillo ~]#
date
7.3.2. Setting System Clock With NTP Client
The system clock can be set using the NTP client. For more information, refer to 「NTP Client」.
7.3.3. Setting Hardware Clock
[armadillo ~]#
hwclock
[armadillo ~]#
hwclock --utc --systohc
[armadillo ~]#
hwclock
7.4. UVC Compatible Web Cameras
UVC (USB Video Class) compatible Web cameras can be used with the Armadillo-400 Series.[]
With the default image on the Armadillo-420 Basic Model Development Set, when a UVC compatible Web camera is connected, the video server starts automatically and the video recorded by the camera can be viewed from a browser.
MJPG-streamer is used as the video server, and is started by udev when a Web camera is connected. LED3 (red) will blink while MJPG-streamer is running.
While LED3 (red) is blinking, the MJPG-Streamer demo page can be displayed by accessing http://(Armadillo-420's IP address):8080/ in a Web browser.
| |
---|
The Java runtime must be installed on the PC being used in order to run the Java sample. Also, an appropriate codec must be installed on the PC in order to display the Stream in Internet Explorer. |