bb-clock.pl 496 B

12345678910111213141516171819202122
  1. #!/usr/bin/perl
  2. use strict;
  3. use Ezkey;
  4. use Date::Format qw/time2str/;
  5. my $sign=new Ezkey("/dev/rfcomm0");
  6. $sign->connect();
  7. $sign->set_mode("hold");
  8. $sign->create_string("1",12);
  9. $sign->write_text($sign->spacing(1)
  10. .$sign->color("green").$sign->extchar("right_arrow")." "
  11. .$sign->color("red")
  12. .$sign->call_string(1));
  13. while(1) {
  14. my $text=time2str("%d.%H%M%S",time);
  15. $sign->write_string($text);
  16. sleep 1;
  17. }
  18. $sign->disconnect();