Editing Alpha Clock Serial v2
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 | + | 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. | + | 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. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
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. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
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. | + | 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 | + | ==== B''x'': Set Parameters (Daisy-Chained) ==== |
− | * | + | |
− | * | + | |
+ | |||
+ | ==== 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. | ||
− | == | + | == Sample programs == |
− | + | 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]. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | ==== 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 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. | ||
− | |||
− | + | ==== AlphaClock_SetTime ==== | |
− | |||
− | |||
+ | 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. | ||
− | + | 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. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||