
Using JLEB

From the website:

  Dr. Andrew Davison
  Dept. of Computer Engineering
  Prince of Songkla University
  Hat Yai, Songkhla 90112, Thailand
  E-mail: ad@fivedots.coe.psu.ac.th
  http://fivedots.coe.psu.ac.th/~ad/


If you use this code, please mention my name, and include a link
to the website.

Thanks,
  Andrew

============================

This directory contains examples using JLEB, which is located in this
directory as a JAR file (jleb.jar). 

The JAR's source code is in the subdirectory jleb/, which has 
its own readme.txt file.


------
11 examples:
  * Hello.java, PlaySound.java, Alarm.java, Alarm2.java, Message.java
      -- notification examples

  * Clock.java, BarsClock.java, TimeLeft.java, Date.java
      -- time/date examples

  * Walker.java, Cycle.java
      -- animation examples

They are described in detail in section 2 of the "Using JLEB" report.


------
Assorted other files, used by the examples:

  * arrows.txt: multi-picture sprite file containing 4 arrows
       - used by Alarm2.java

  * blueTele.png: a blue telephone icon
        - used by ToChars.bat

  * chars1.txt: some character arrays for character sprites
        - used by ToHex.bat

  * line.txt:  multi-picture sprite file containing 12 lines
       - used by Cycle.java

  * p2_01.bmp: a very small bitmap image
        - used by ToChars.bat

  * pattern.txt: multi-picture sprite file containing 12 patterns
       - used by Cycle.java

  * robot.txt: multi-picture sprite file containing 12 robots
       - used by Cycle.java

------
Batch files for compiling/running:
  * compile.bat
  * run.bat
     - make sure they refer to the correct location 
       for your download of javahidapi

------
Batch files for running other JLEB Tools:
   * ToChars.bat
   * ToHex.bat
   * DrawBoard.bat
   * HIDScreen.bat

They are described in detail in section 4 of the "Using JLEB" report.


----------------------------
Before Compilation/Execution:

You need to download and install:
  * javahidapi: https://github.com/torbjornvatn/javahidapi

    From the ZIP file you need a minimum of 2 files:
      -  hidapi-1.1.jar, from javahidapi-master\dist\lib\

      -  the correct native library for your OS from javahidapi-master\lib\native
         e.g. on 32-bit Windows get javahidapi-master\lib\native\windows\x86\hidapi-jni-32.dll
         e.g. on 64-bit Windows get javahidapi-master\lib\native\windows\x86_64\hidapi-jni-64.dll

     - rename the library (if necessary) to hidapi-jni.<EXT>
       (e.g. hidapi-jni-64.dll is renamed to hidapi-jni.dll)

     - my code assumes that hidapi-1.1.jar and hidapi-jni.dll are in
       the folder D:\javahidapi
         

You should have a Dream Cheeky LED Message Board:
    http://dreamcheeky.com/led-message-board
    
If the board is still out of stock at its website, then you can find it
for sale at many other places online, such as at Amazon.

You can test the board using HIDScreen.bat (see section 4.4. of the
"Using JLEB" report).

----------------------------
Compiling the examples:

> compile *.java

----------------------------
Execution (see section 2 of the "Using JLEB" report):

> run <name of class file>

e.g.
> run Hello
> run PlaySound
> run Alarm
> run Alarm2
> run Message
> run Clock
> run BarsClock
> run Date
> run Walker

The following take command line arguments:

> run TimeLeft 14:55    (must be in HH:MM format)
> run Cycle line        (or pattern or robot)

-----
Running the JLEB tools (see section 4 of the "Using JLEB" report):

> ToChars.bat <image file> [<width> <height>]
e.g.
> ToChars.bat p2_01.bmp
> ToChars.bat blueTele.png 20 20


> ToHex.bat <character arrays>
e.g.
> ToHex.bat chars1.txt

> DrawBoard.bat

> HIDScreen.bat

-----------------------------
Last updated: 26th April 2017
