Git Product home page Git Product logo

pearlfan's Introduction

PearlFan

Build Status License

PearlFan is a tool to draw on a PEARL's USB LED fan.

Installation

Package

$ pacaur -S pearlfan

Manually

  • Dependencies:
$ pacman -S libusb-1.0 netpbm                         (archlinux)
$ apt-get install libusb-1.0-0-dev libnetpbm10-dev    (ubuntu)
  • Build:
$ make

Usage

pearlfan -c FILE  [-f]
pearlfan -d DIRECTORY [-f]
pearlfan -t TEXT [-f]

Setting:
  -c:  Displays at most eight images with transition effects described
       in the given config FILE.
  -d:  Displays at most eight .PBM images (156x11) in DIRECTORY.
  -t:  Draws TEXT (standard ASCII table). Words are not split, only huge words.

Mode:
  -f:  Enables fast-mode. Disables all others effect transitions.

Miscellaneous:
  -h:  Prints this help and exits.
  -v:  Prints version info and exits.

Examples

$ ls images/
pacman.pbm
mario.pbm
file.config

$ cat file.config
pacman.pbm  +2-2-0
mario.pbm   +1-1-6

$ pearlfan -c images/file.config    (or)
$ pearlfan -d images/             (without config file)

Configuration File

Sample

This an example of a pfan's configuration file

pacman.pbm  +2-2-0
mario.pbm   +1-1-6
circle.pbm  +0-0-0
cols.pbm    +3-3-6
full.pbm    +2-5-0

Specifications

Each configuration file consists of the following:

  • line pattern: {image_basename}.pbm+{effects}
  • Whitespace (blanks and TABs) between {image_basename}.pbm and + are ignored (cf. example above)
  • The image must be in the same directory than the configuration file
  • The image must be .PBM image
  • The image size must be: width=11px, height=156px
  • {effects}: the fan provides transition effects when displaying and switching images
  • Effect's pattern: {open}-{close}-{beforeclose}
  • Open, close and beforeclose's exclusive values are described in the table below
  • The fan can display at most 8 images

Effect values

Effects/Value 0 1 2 3 4 5 6
opening right-left left-right 2-side red-carpet top-bottom bottom-top fast-mode
closing left-right right-left 2-side red-carpet top-bottom bottom-top n/a
before-closing do nothing n/a turn left-right n/a n/a n/a turn right-left
  • opening/right-left: means appearing from right to left
  • closing/right-left: means disappearing from right to left
  • fast-mode: skip the 'open' and 'before-closing' transition effects

TODO

  • Turn the project into a cross-platform lib to draw on USB LED fans
  • Rename the project

pearlfan's People

Contributors

jay-to-the-dee avatar snaipe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pearlfan's Issues

libusb: init & close cause 2 not-freed blocks

A simple init & close cause 2 not-freed blocks (libusb #231)

==3893== 4,096 bytes in 1 blocks are still reachable in loss record 1 of 2
==3893==    at 0x4C29BBE: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==3893==    by 0x405B0EF: ??? (in /usr/lib/libudev.so.1.6.5)
==3893==    by 0x405F300: ??? (in /usr/lib/libudev.so.1.6.5)
==3893==    by 0x4E4518C: ??? (in /usr/lib/libusb-1.0.so.0.1.0)
==3893==    by 0x4E42D50: ??? (in /usr/lib/libusb-1.0.so.0.1.0)
==3893==    by 0x4E3B18C: libusb_init (in /usr/lib/libusb-1.0.so.0.1.0)
==3893==    by 0x40136A: main (main.c:60)
==3893== 
==3893== 4,096 bytes in 1 blocks are still reachable in loss record 2 of 2
==3893==    at 0x4C29BBE: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==3893==    by 0x405B0EF: ??? (in /usr/lib/libudev.so.1.6.5)
==3893==    by 0x405AA2B: ??? (in /usr/lib/libudev.so.1.6.5)
==3893==    by 0x406333B: ??? (in /usr/lib/libudev.so.1.6.5)
==3893==    by 0x40614A2: ??? (in /usr/lib/libudev.so.1.6.5)
==3893==    by 0x405EE9F: ??? (in /usr/lib/libudev.so.1.6.5)
==3893==    by 0x4064206: ??? (in /usr/lib/libudev.so.1.6.5)
==3893==    by 0x405C08B: udev_enumerate_scan_devices (in /usr/lib/libudev.so.1.6.5)
==3893==    by 0x4E45194: ??? (in /usr/lib/libusb-1.0.so.0.1.0)
==3893==    by 0x4E42D50: ??? (in /usr/lib/libusb-1.0.so.0.1.0)
==3893==    by 0x4E3B18C: libusb_init (in /usr/lib/libusb-1.0.so.0.1.0)
==3893==    by 0x40136A: main (main.c:60)

Unable to get working on Ubuntu 14.04

Have installed dependencies, libusb...-dev, and libnetpbm...-dev and did build, ran make. Both the pearlfan and pearltest compile. When run pearlfan or pearltest as user, with sudo or as root get:
Device can not be opened or found.
You may need permission.

In logs note:
[ 1797.644044] usb 7-1: new low-speed USB device number 4 using uhci_hcd
[ 1797.816820] usb 7-1: New USB device found, idVendor=0c45, idProduct=7160
[ 1797.816828] usb 7-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1797.816832] usb 7-1: Product: XY LED FAN
[ 1797.816837] usb 7-1: Manufacturer: XY-SUN
[ 1797.833926] input: XY-SUN XY LED FAN as /devices/pci0000:00/0000:00:1d.1/usb7/7-1/7-1:1.0/0003:0C45:7160.000C/input/input21
[ 1797.834241] hid-generic 0003:0C45:7160.000C: input,hidraw7: USB HID v1.00 Device [XY-SUN XY LED FAN ] on usb-0000:00:1d.1-1/input0

So device is found when plugged in.

Please help

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.