Permalink
Browse files

Actual size for the real display

  • Loading branch information...
1 parent eb049f1 commit 57cfef499c98eae5c92b3c0d13e91c7fa2e3646e @osresearch committed Aug 11, 2013
Showing with 51 additions and 5 deletions.
  1. +46 −0 checkerboard
  2. +5 −5 rainbow
View
46 checkerboard
@@ -0,0 +1,46 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+use IO::Socket;
+use Time::HiRes 'usleep';
+
+# Make an RGB checkerboard
+my $host = '192.168.7.2:9999';
+
+my $sock = IO::Socket::INET->new(
+ PeerAddr => $host,
+ Proto => 'udp',
+) or die "Socket failed: $!\n";
+
+
+my $width = 64;
+my $height = 210;
+my $offset = 0;
+
+my $i = 0;
+
+while (1)
+{
+ $offset++;
+ my $s = chr(1);
+ my $bright = 0x30;
+
+ for(my $y = 0 ; $y < $height ; $y++)
+ {
+ for(my $x = 0; $x < $width ; $x++)
+ {
+ my $r = ($i % 7 == 0) ? $bright : 0;
+ my $g = ($i % 7 == 1) ? $bright : 0;
+ my $b = ($i % 7 == 2) ? $bright : 0;
+
+ $s .= chr($r);
+ $s .= chr($g);
+ $s .= chr($b);
+ $i++;
+ }
+ }
+
+ $sock->send($s);
+ usleep(80000);
+ $i++;
+}
View
10 rainbow
@@ -13,19 +13,19 @@ my $sock = IO::Socket::INET->new(
) or die "Socket failed: $!\n";
-my $width = 10;
-my $height = 32;
+my $width = 64;
+my $height = 210;
my $offset = 0;
while (1)
{
$offset++;
- my $s = '1';
- my $bright = 0x10;
+ my $s = chr(1);
+ my $bright = 0x30;
for(my $y = 0 ; $y < $height ; $y++)
{
- for(my $x =0 ; $x < $width ; $x++)
+ for(my $x = 0; $x < $width ; $x++)
{
my $r = (($x + $offset) % $width) * $bright / $width;
my $g = 0;

0 comments on commit 57cfef4

Please sign in to comment.