Editing Alpha Clock Serial v2

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 31: Line 31:
 
== Supported commands ==
 
== Supported commands ==
  
Firmware version 2.0 supports several serial commands: Set time (ST), Ascii display (A0/A''x''), Set Parameter (B0/B''x'') and Mode Time (MT).
+
Firmware version 2.0 supports three serial commands: Set time (ST), Ascii display (A0), and Mode Time (MT).
  
 
Each command consists of exactly 13 bytes:  A single header byte (0xFF), followed by a two-letter command code and then 10 additional bytes of data.   
 
Each command consists of exactly 13 bytes:  A single header byte (0xFF), followed by a two-letter command code and then 10 additional bytes of data.   
Line 51: Line 51:
  
  
The Alpha Clock Five library (v. 2.0 and above) includes a set of Processing sketches, including an example program (AlphaClock_SetTime) that can sync the time on your Alpha Clock Five to that on your PC.  (Sample applications to communicate with Alpha Clock Five are provided as .pde files, for use with the Processing development environment.  Processing is a free, cross-platform programming environment, and you can download your copy [http://processing.org/ at processing.org].)
+
The Alpha Clock Five library (v. 2.0 and above) includes a set of Processing sketches, including an example program (AlphaClock_SetTime) that can sync the time on your Alpha Clock Five to that on your PC.  To run the example sketches, download Processing [http://processing.org from processing.org].
 
 
  
  
Line 75: Line 74:
  
 
Note that the decimal point protocol has been changed from that in firmware v1, for which the display characters were 'U', 'L', and 'B' for upper, lower, or both decimal points.  
 
Note that the decimal point protocol has been changed from that in firmware v1, for which the display characters were 'U', 'L', and 'B' for upper, lower, or both decimal points.  
 +
 +
 +
The Alpha Clock Five library (v. 2.0 and above) includes a set of Processing sketches, including an example program (AlphaClockv2_SendText) that can can display text on the Alpha Clock Five LEDs.  To run the example sketches, download Processing [http://processing.org from processing.org].
  
 
    
 
    
 
To blank the display, you can send an string consisting of five spaces ("    ") for both the ASCII and DP strings.
 
To blank the display, you can send an string consisting of five spaces ("    ") for both the ASCII and DP strings.
 
 
The Alpha Clock Five library (v. 2.0 and above) includes a set of Processing sketches, including an example program (AlphaClockv2_SendText) that can can display text on the Alpha Clock Five LEDs.  (Sample applications to communicate with Alpha Clock Five are provided as .pde files, for use with the Processing development environment.  Processing is a free, cross-platform programming environment, and you can download your copy [http://processing.org/ at processing.org].)
 
 
 
  
  
Line 99: Line 96:
 
When Alpha Clock Five receives an A''x'' command on its main serial port (where ''x'' is not equal to zero), it relays that command out through its second serial port, decrementing it from A''x'' to A''(x-1)''.  For example, suppose that two Alpha Clock Five units are connected together via their serial ports. Then, the command A1, followed by a text/decimal string, will be received by the first Alpha Clock Five and then sent to the next as an A0 command, so that it will display that text/decimal string on the second unit.
 
When Alpha Clock Five receives an A''x'' command on its main serial port (where ''x'' is not equal to zero), it relays that command out through its second serial port, decrementing it from A''x'' to A''(x-1)''.  For example, suppose that two Alpha Clock Five units are connected together via their serial ports. Then, the command A1, followed by a text/decimal string, will be received by the first Alpha Clock Five and then sent to the next as an A0 command, so that it will display that text/decimal string on the second unit.
  
 
The Alpha Clock Five library (v. 2.0 and above) includes a set of Processing sketches, including several example programs that can can display text across multiple daisy-chained Alpha Clock Five units through the serial interface.  (Sample applications to communicate with Alpha Clock Five are provided as .pde files, for use with the Processing development environment.  Processing is a free, cross-platform programming environment, and you can download your copy [http://processing.org/ at processing.org].)
 
 
The relevant example sketches are as follows:
 
* AlphaClockv2_SendTextDaisy: Demonstrates sending text to the second of two Alpha Clock Five units connected together.
 
* AlphaClockv2_TextStringDaisy2:  Writes a single text string across two Alpha Clock Five units.
 
* AlphaClockv2_Test4Daisy: Demonstrates sending text to up to four Alpha Clock Five units.
 
* AlphaClockv2_ScrollTextDaisy2:  Scrolls a text string across multiple Alpha Clock Five units.
 
  
  
Line 138: Line 127:
 
'''B02''': Edit font character
 
'''B02''': Edit font character
  
The shape of any character in the font table can be redefined by using the B02 command.  Following the "B02" are nine bytes of data that specify the ASCII character to be redefined, and the shape of that character.  The font shape is specified by three sequential values, the "A", "B", and "C" values that indicate which LEDs will be lit when that character is displayed.  Depending on those three values, a font character may include alphanumeric segments, decimal points (upper and/or lower), or both.   This command can be used to put arbitrarily shaped characters or data on the Alpha Clock Five display, for example by overwriting the 'a' through 'e' characters, and then displaying those characters with the A0 command.
+
The shape of any character in the font table can be redefined by using the B02 command.  Following the "B02" are nine bytes of data that specify the ASCII character to be redefined, and the shape of that character.  The font shape is specified by three sequential values, the "A", "B", and "C" values that indicate which LEDs will be lit when that character is displayed.  Depending on those three values, a font character may include alphanumeric segments, decimal points (upper and/or lower), or both.  
 
 
  
 
In detail, the full B02 command is given as follows:
 
In detail, the full B02 command is given as follows:
Line 164: Line 152:
  
  
The Alpha Clock Five library (v. 2.0 and above) includes a set of Processing sketches, including two example programs that execute the B0 commands.  (Sample applications to communicate with Alpha Clock Five are provided as .pde files, for use with the Processing development environment.  Processing is a free, cross-platform programming environment, and you can download your copy [http://processing.org/ at processing.org].)
 
  
The relevant example sketches are as follows:
+
==== B''x'': Set Parameters (Daisy-Chained)  ====
* AlphaClockv2_BrightnessNumSet:  Change Alpha Clock Five brightness and number character set.
+
 
* AlphaClockv2_CustomChars: Demonstrates editing and displaying custom characters on Alpha Clock Five through the serial interface.
+
 
 +
 
 +
==== MT: Mode Time ====
 +
 
 +
The MT function is used to resume normal display mode-- typically showing the time --after command A0 has been issued.
 +
 
 +
 
 +
The full command consists of 13 bytes, as follows:
 +
* The header byte, 0xFF
 +
* The command MT
 +
* A 10-character string (the contents of this string will be ignored).
 +
 
  
 +
Please see the Sample Programs section below for an example program that displays characters with A0, and then uses MT to display the time again.
  
  
==== B''x'': Set Parameters (Daisy-Chained)  ====
+
== Sample programs ==
  
The B''x'' function is a "daisy-chained" version of the B0 commandIt is used to adjust certain parameters on more than one Alpha Clock Five, connected through their serial interfaces.  
+
Sample applications to communicate with Alpha Clock Five are provided as .pde files, for use with the Processing development environmentProcessing is a free, cross-platform programming environment, and you can download your copy [http://processing.org/ at processing.org].
  
The full command consists of 13 bytes, as follows:
 
* The header byte, 0xFF
 
* The command letter 'B', a single ASCII character
 
* The distance value ''x'', a single byte.  This may be an ASCII value of '0' - '9' or a binary value from 0 to 47. This value indicates how many daisy-chained Alpha Clock Five units should "relay" the command before executing the "B0" command.
 
* One more character, either 0, 1, or 2, which indicates which parameter to adjust.
 
* Nine more characters of data, which depend on the parameter being adjusted.  See the description of the B0 command above for the specific data format.
 
  
 +
==== AlphaClock_SetText ====
  
 +
Download this file [http://evilmadscientist.s3.amazonaws.com/source/alphafive/AlphaClock_SetText.pde here] (2 kB .pde file).    --NOT YET UPDATED FOR v2.
  
When Alpha Clock Five receives an B''x'' command on its main serial port (where ''x'' is not equal to zero), it relays that command out through its second serial port, decrementing it from B''x'' to B''(x-1)''.  For example, suppose that two Alpha Clock Five units are connected together via their serial ports. Then, the command B1, followed by a data string, will be received by the first Alpha Clock Five and then sent to the next as an B0 command, so that it will execute the B0 command on the second unit.
 
  
 +
When you run the application, it presents a window.  Click your mouse in the window to alternately display a text string ("ALPHA", plus some added decimal points) and to resume clock display.  This demonstrates the use of the A0 and MT serial functions.
  
 +
Note that you may need to edit the file to select the correct serial port, defined by the "portIndex" variable, in order to select the serial port where your clock is attached.
  
The Alpha Clock Five library (v. 2.0 and above) includes a set of Processing sketches, including several example programs that can can execute B''x'' commands across multiple daisy-chained Alpha Clock Five units through the serial interface.  (Sample applications to communicate with Alpha Clock Five are provided as .pde files, for use with the Processing development environment.  Processing is a free, cross-platform programming environment, and you can download your copy [http://processing.org/ at processing.org].)
 
  
  
The relevant example sketches are as follows:
+
==== AlphaClock_SetTime ====
* AlphaClockv2_BrightnessNumSetDaisy: Change Alpha Clock Five brightness and number character set on two Alpha Clock Five units connected together.
 
* AlphaClockv2_CustomCharsDaisy:  Demonstrates editing and displaying custom characters on multiple Alpha Clock Five units through the serial interface.
 
  
 +
Download this file [http://evilmadscientist.s3.amazonaws.com/source/alphafive/AlphaClock_SetTime.pde here] (2 kB .pde file).   
  
 +
When you run the application, it presents a window.  Click your mouse in the window to set the time on the clock to your present computer system time.  This demonstrates the use of the ST function, and also provides an accurate way to set the display time.
  
==== MT: Mode Time ====
+
Note that you may need to edit the file to select the correct serial port, defined by the "portIndex" variable, in order to select the serial port where your clock is attached.
  
The MT function is used to resume normal display mode-- typically showing the time --after command A0 has been issued.
 
  
  
The full command consists of 13 bytes, as follows:
 
* The header byte, 0xFF
 
* The command MT
 
* A 10-character string (the contents of this string will be ignored).
 
 
 
  
  

Please note that all contributions to Evil Mad Scientist Wiki are considered to be released under the GNU Free Documentation License 1.3 (see Evil Mad Scientist Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel | Editing help (opens in new window)