File: displayit.pl

package info (click to toggle)
lm-sensors 1%3A2.10.1-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 5,104 kB
  • ctags: 10,474
  • sloc: ansic: 61,469; perl: 7,544; sh: 1,491; makefile: 400; lex: 300; yacc: 291
file content (32 lines) | stat: -rwxr-xr-x 784 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/perl

# This is a simple perl script to display a 'screen' 
# on a Matrix Orbital Display.  In this case, this
# script will read the first four lines (up to 20
# chars a line) and display them on the display.

# Written and copywritten (C) by Philip Edelbrock, 1999.


# Turn off the blinking cursor
$temp=`echo  "254 84" > /proc/sys/dev/sensors/matorb*/disp`;

$linenum=1;

while (<STDIN>) {
 # Reset the position of the cursor to the next line
 $temp=`echo "254 71 1 $linenum" > /proc/sys/dev/sensors/matorb*/disp`;
 chop;
 $_="$_                    ";
 if (/^(.{1,20})/) {
  $_=$1;
  $line="";
  while (/(.)/gc) {
   $temp=ord($1);
   $line="$line $temp";
  }
  $temp=`echo "$line" > /proc/sys/dev/sensors/matorb*/disp`;
 }
 $linenum+=1;
 if ($linenum > 4) { exit; }
}