]>
git.gir.st - Ledberg-ESP8266.git/blob - red-pulse.pl
2 # (c) 2019 Tobias Girstmair <https://gir.st/>; GPLv3
11 my ($type, $r, $g, $b) = @_;
12 open(my $netcat, "| nc -u $ip 1337");
13 print $netcat pack "CC", 0x01, $r if ($type eq "power");
14 print $netcat pack "CCCC", 0x02, $r*0xFF, $g*0x7F, $b*0x7F if ($type eq "color");
21 packet
"color", ((abs sin deg2rad
$_), 0, 0);
22 select(undef, undef, undef, 0.02); # sub-second sleep() substitute