PengAlert: Linux Multifunctional Alert Device

Examples

Please find example code lines below:

  • usend -c "LED6 ON" --- This will turn on the LED number 6
  • usend -c "LED10 BLINK 2HZ" --- This will make LED number 10 blink with approximate frequency of 2Hz
  • usend -c "PIEZO OFF" --- This will stop the buzzer's sound, if any
  • usend -c "PIEZO ON 3" --- This will produce continuous 3.906kHz sound trough the buzzer

Please find a brief description of the usend command below:

usend - A tool for sending commands via USB to PengAlert devices
usend is an USB communication utility intended to send commands to a PengAlert device under Linux and other alternative operating systems. Commands are human readable at the command line but they are internally translated into binary codes prior to transmission.

usend [options]
usend [ -N number] -c command

OPTIONS
-V
Prints the version of usend and exits.
-c command
Sends the command to a device. If -N swich is not specified, the command is being sent only to first discovered device.
-N number
Specifies additionally the device-number. Specified number shall be in range 1..254. A specified number of 0 (zero) is rezerved for future extensions and specified number of 255 has the same meaning as it would be no -N switch specified. When -N switch is specified the command is being sent to all discovered devices and number is specified. Then it is responsibility of each individual device to compare specified number with its internal device-number and execute the command on match. The internal device-number could be changed by the command WRITENUMBER.

COMMANDS

  • LEDn ON
    • Turns on the LED number n
    • Valid numbers are from 0 to 10. Command with LED number 0 targets all LEDs on the device.
  • LEDn OFF
    • Turns off the LED number n
    • Valid numbers are from 0 to 10. Command with LED number 0 targets all LEDs on the device.
  • LEDn BLINK f
    • Sets the LED number n into blinking mode with frequency f
    • Valid numbers are from 0 to 10. Command with LED number 0 targets all LEDs on the device. Fequency shall be one of 0.5HZ , 1HZ , 2HZ or 4HZ Please note, these frequencies are actually 0.477Hz, 0.954Hz, 1.907Hz and 3.815Hz accordingly, since they are derived from CPU clock frequency of 4.8MHz.
  • DPn ON
    • Turns on the decimal point number n
    • Valid numbers are from 1 to 3.
  • DPn OFF
    • Turns off the decimal point number n
    • Valid numbers are from 0 to 3. Decimal point number 0 means all decimal point indicators on the device.
  • DISn OFF
    • Turns off the display indicator number n
    • Valid numbers are from 0 to 3. Display undicator number 0 means all indicators on the device.
  • DISn DISPLAY d
    • Shows up digit d onto display indicator number n
    • Valid numbers are from 0 to 3. Display undicator number 0 means all indicators on the device. Valid digits are from 0 to 9.
  • EXn HIZ
    • Puts output number n into high impedance state.
    • Valid numbers are from 0 to 4. Output number 0 means all outputs on the device.
  • EXn OUT0
    • Puts output number n into logical zero.
    • Valid numbers are from 0 to 4. Output number 0 means all outputs on the device.
  • EXn OUT1
    • Puts output number n into logical one.
    • Valid numbers are from 0 to 4. Output number 0 means all outputs on the device.
  • PIEZO OFF
    • Switches off the piezo buzzer.
  • PIEZO ON f
    • Switches on the piezo buzzer, and drives it with frequency number f
    • Valid frequency numbers are from 1 to 6. The actual frequencies corresponding to the numbers are 2.929kHz, 3.348kHz, 3.906kHz, 4.687kHz, 5.859kHz and 7.812kHz accordingly.
  • WRITENUMBER n
    • Overwrites internal device-number to new value n
    • Valid numbers are from 1 to 255.
Example BASH Script File

#!/bin/sh
# init-sh - a test script

# This script is freely available for modification
# and/or distribution.

usend -c "PIEZO OFF"
usend -c "LED0 OFF"
usend -c "DIS0 OFF"
usend -c "DP0 OFF"
usend -c "EX0 HIZ"
usend -c "LED1 BLINK 0.5HZ"
usend -c "LED2 BLINK 1HZ"
usend -c "LED3 BLINK 2HZ"
usend -c "LED4 BLINK 4HZ"
usend -c "LED5 BLINK 0.5HZ"
usend -c "LED6 BLINK 1HZ"
usend -c "LED7 BLINK 2HZ"
usend -c "LED8 BLINK 4HZ"
usend -c "LED9 BLINK 2HZ"
usend -c "LED10 ON"