Skip to content

Commit

Permalink
added arduino lib docs, cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dekuNukem committed Mar 6, 2018
1 parent 430083a commit 486458b
Show file tree
Hide file tree
Showing 13 changed files with 142 additions and 37 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exixe is a miniature driver module for IN-12 and IN-14 Nixie tubes.

It aims to simplify Nixie tube related projects by eliminating the need for obscure vintage driver chips and multiplexing circuits. Instead, you can control every digit and the RGB backlight via SPI using only 3 wires and 1 line of code.

exixe is cheap, small and modular for easy integration. It is compatible with Arduino, Raspberry Pi, ESP8266, and virtually all embedded dev boards today.
exixe is cheap, small and modular for easy integration. It is compatible with Arduino, Raspberry Pi, and virtually all embedded dev boards today.

## Buy exixe on Tindie!

Expand Down Expand Up @@ -55,6 +55,10 @@ Compared to the traditional approach, exixe modules offers significant advantage

Please see [getting_started.md](/getting_started.md)

## Arduino Library

Please [click here](arduino_library/README.md)

## Pinout, SPI command format and technical details

Please see [technical_details.md](/technical_details.md)
Expand Down
25 changes: 25 additions & 0 deletions arduino_examples/1_LED_test/1_LED_test.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
exixe modules:
https://github.com/dekuNukem/exixe
library docs:
https://github.com/dekuNukem/exixe/tree/master/arduino_library
Demo 1: LED test
*/

#include "exixe.h"

// change this to the cs pin you're using
int cs_pin = 10;
exixe my_tube = exixe(cs_pin);

void setup()
{
my_tube.set_led(127, 0, 127); // purple
}

void loop()
{

}
8 changes: 4 additions & 4 deletions arduino_examples/2_loop_digit_simple/2_loop_digit_simple.ino
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
Demo for exixe modules
exixe modules:
https://github.com/dekuNukem/exixe
exixe "Getting Started" guide
https://github.com/dekuNukem/exixe/blob/master/getting_started.md
library docs:
https://github.com/dekuNukem/exixe/tree/master/arduino_library
Demo 2: loop digits
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
Demo for exixe modules
exixe modules:
https://github.com/dekuNukem/exixe
exixe "Getting Started" guide
https://github.com/dekuNukem/exixe/blob/master/getting_started.md
library docs:
https://github.com/dekuNukem/exixe/tree/master/arduino_library
Demo 3: Loop digits with crossfade animation
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
Demo for exixe modules
exixe modules:
https://github.com/dekuNukem/exixe
exixe "Getting Started" guide
https://github.com/dekuNukem/exixe/blob/master/getting_started.md
library docs:
https://github.com/dekuNukem/exixe/tree/master/arduino_library
Demo 4: Loop digits on two tubes
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
Demo for exixe modules
exixe modules:
https://github.com/dekuNukem/exixe
exixe "Getting Started" guide
https://github.com/dekuNukem/exixe/blob/master/getting_started.md
library docs:
https://github.com/dekuNukem/exixe/tree/master/arduino_library
Demo 5: Loop digits on two tubes with crossfade animation
*/
Expand Down
File renamed without changes.
File renamed without changes.
74 changes: 71 additions & 3 deletions arduino_library/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,76 @@

This is a simple Arduino library for exixe modules.

Under construction...

## Installation

## Usage
[Click me](https://github.com/dekuNukem/exixe/blob/master/arduino_library/exixe.zip?raw=true) to download the library file.

In Arduino IDE, select `Sketch` -> `Include Library` -> `Add .ZIP Library`

![Alt text](../resources/libinstall.png)

Select the `exixe.zip` you just downloaded, and it should install automatically.

## Usage

A number of examples are [provided here](../arduino_examples). Take a look at the [getting started guide](../getting_started.md) to see how to use them.

#### `show_digit(uint8_t digit, uint8_t brightness, uint8_t overdrive)`

* This sets `digit` in the tube to `brightness`.

* `digit` must be between 0 to 9.

* `brightness` must be between 0 and 127. 0 being off 127 being brightest.

* `overdrive` must be 0 or 1. When set to 1 the cathode current is doubled, helping to illuminate poisoned cathodes in second-hand tubes. [Before](../resources/no_overdrive.jpg) and [after](../resources/with_overdrive.jpg). Only use on poisoned tubes, otherwise it might shorten tube life.

* Overdrive is only available on exixe-14.

* [example usage](../arduino_examples/2_loop_digit_simple)

#### `set_led(uint8_t red, uint8_t green, uint8_t blue)`

* Set the LED backlight to provided RGB value.

* Color arguments must between 0 and 127, 0 being off 127 being brightest.

* [example usage](../arduino_examples/1_LED_test)

#### `set_dots(uint8_t left_brightness, uint8_t right_brightness)`

* Sets the decimal points in the tube to the brightness arguments.

* Brightness must be between 0 and 127, 0 being off 127 being brightest.

* IN-14 has 2 DPs, IN-12B has 1 DP, and IN-12A has no DP at all.

* You can use this to turn on DP alongside digits.

#### `clear()`

* Turns off all digits, DPs, and LED backlight.

#### `crossfade_init(uint8_t digit, uint16_t duration_frames, uint8_t brightness, uint8_t overdrive)`

* This sets up a crossfade animation.

* `digit` is the digit you want to fade into. Must be between 0 and 9.

* `duration_frames` is how long the crossfade animation should last, in number of frames. 1 second is 30 frames.

* `brightness` must be between 0 and 127, 0 being off 127 being brightest.

* `overdrive` must be 0 or 1. See `show_digit()` above for details.

* [example usage](../arduino_examples/3_loop_digit_crossfade)

#### `crossfade_run()`

* Executes the crossfade animation after `crossfade_init()`.

* Call this at **least every 33ms** for a smooth animation.

* This function is **non-blocking** and will return immediately, this allows you to do some other tasks while animation is underway. Just make sure to call it frequently enough as above.

* Check its return value to see if animation is finished. Once done it should return `EXIXE_ANIMATION_FINISHED`, otherwise `EXIXE_ANIMATION_IN_PROGRESS` is returned.
Binary file modified arduino_library/exixe.zip
Binary file not shown.
42 changes: 25 additions & 17 deletions getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,35 @@ In the end, you should have the tube, corresponding exixe board, headers, and th

![Alt text](resources/all.jpg)

## Installing the Arduino library

Take a look at the [Arduino library docs](arduino_library/README.md) to download and install the library.

If you're not using Arduino, there are some [barebone examples](/arduino_examples/barebone) too.

## Testing the bare module

Let's make sure the board works before hooking up high voltage and installing the tubes.

Solder on the headers, then take a look at the pinout in [technical_details.md](/technical_details.md).

First we hook up the power pins. Connect the GND to GND, and 3.3V power to 3V3.
First we hook up the power pins. Connect the GND to GND, and 3.3V power to 3V.

Next are the SPI lines. Connect MO to MOSI line, SCK to SCK line, and CS to CS line. For Arduino UNO example below, MOSI is pin 11, SCK is pin 13, CS is pin 10. Consult the datasheet if you're using other boards.
Next are the SPI lines. Connect MO to MOSI line, SCK to SCK line, and CS to CS line. For Arduino UNO below, MOSI is pin 11, SCK is pin 13, CS is pin 10. Consult the datasheet if you're using other boards.

![Alt text](resources/led_test_sch.png)

Then try the [LED test](/arduino_examples/0_LED_test). Change the `slaveSelectPin` variable if you're using a different pin. Compile and upload the sketch in Arduino IDE.
Then try the [LED test](/arduino_examples/1_LED_test). Change the `cs_pin` variable if you're using a different one. Compile and upload in Arduino IDE.

The LED on the exixe module should turn purple. You can play around with the RGB values in the sketch to change it to other colors.
The LED on the exixe module should turn purple. You can play around with the RGB values for other colors.

![Alt text](resources/example0.jpg)

If the board is not responding, take a look at the SPI commands in [technical_details.md](/technical_details.md) to make sure the SPI is configured properly, and the commands are valid. Also make sure the RST pin is HIGH, and CS pin is asserted properly. Use a logic analyzer to see what's going on if you have one.

### Testing tubes

I recommend testing your tubes first to make sure all digits light up. You can probably get away with not doing this if you're using NOS tubes, but for used ones this is essential.
I recommend testing your tubes first to make sure all digits light up, so you don't end up soldering a dud to the module.

First locate the anode on you tube:

Expand All @@ -64,31 +70,23 @@ After confirming the tube is good, you can insert it to the module. Match anode

It's a bit tricky on the IN-14 since the pins are not rigid. Just be patient and eventually it will all go in. Again, make sure the anode and every other pin is lined up correctly, then solder the tube in place.

Try keep the tube straight. For IN-14 leave around 5mm of pins between the PCB and the glass as demonstrated in the middle tube:
Try keeping the tube straight. For IN-14 leave around 5mm of pins between the PCB and the glass as demonstrated on the middle tube:

![Alt text](resources/soldered.jpg)

It's also a good idea to wrap the bottom of IN-14 tubes with heat-shrink tubing or electric tape like the one on the right, to prevent backlight leaking.

## Try some examples!

[Click here](https://github.com/dekuNukem/exixe/archive/master.zip) to download a copy of this repo, you'll need the Arduino files.

Once that's done, connect 180V to the HV pin of exixe module, make sure your Arduino, high voltage supply, and exixe module all share the same GND.
After getting the [LED test](/arduino_examples/1_LED_test) example working, connect 180V to the HV pin of exixe module, make sure your Arduino, high voltage supply, and exixe module all share the same GND.

![Alt text](resources/hvsch.png)

First try [show4 sketch](/arduino_examples/1_show4), this is a bare-bone implementation that just shows digit 4:

![Alt text](resources/example1.jpg)

To make life easier, I have written written an Arduino library. Copy the [exixe library folder](/arduino_library/exixe) into `My Documents\Arduino\libraries\` to use it.

After library is installed, try the [loop digit](/arduino_examples/2_loop_digit_simple) example, which loops through all the digits from 0 to 9:
First try the [loop digit](/arduino_examples/2_loop_digit_simple) example, which simply loops through all the digits from 0 to 9:

![Alt text](resources/1s.gif)

After that, you can try [loop digit crossfade](/arduino_examples/3_loop_digit_crossfade) to use fancy crossfade animation:
After that, you can try [crossfade](/arduino_examples/3_loop_digit_crossfade) to see the fancy crossfade animation:

![Alt text](resources/1c.gif)

Expand All @@ -102,4 +100,14 @@ Finally, the [multiple tubes crossfade](/arduino_examples/5_multiple_tubes_cross

![Alt text](resources/2c.gif)

## Resources

Consult the [Arduino library docs](arduino_library/README.md) to see how to use library functions. And explore the [sample sketches](/arduino_examples).

If you want to keep it simple, there are some self-contained [barebone examples](/arduino_examples/barebone) too.

## Go and have fun!

If you have any questions, feel free to [open an issue](https://github.com/dekuNukem/exixe/issues) or email me at `dekunukem gmail com`. The former is preferable since it helps other people too.

That's pretty much it! You can let your imagination run free now. Go wild and have fun!
Binary file modified resources/exixetubes.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/libinstall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 486458b

Please sign in to comment.