Interface & Application Programming
As mentioned on my page for the Input Devices week, my final project would be a digital wristband that can turn our fingers and hand into digital interface. It would detect which segment of the finger my thumb is touching and therefore trigger different functions. This week I bought a 1.27" Color OLED screen and wanted to make a very simple graphic interface for the wristband. It is basically like a menu, when my thumb touches different parts of the finger, the rectangle moves to different functions, indiciating the selection.
When I connect the OLED screen to my board, I tested with the Software SPI and Hardware SPI connection. For Software SPI you can use any pins on your board but it is slower. For Hardware SPI it is faster but you have to connect to specific pins on your board. For my board which uses the 328p chip, the connection is as below:
Software SPI:
Pins on My Board |
OLED |
GND |
GND |
VCC |
VIN(+) |
13 |
SCLK (CL) |
12 |
MOSI (SI) |
11 |
DC |
10 |
OLEDCS (OC) |
9 |
RST (R) |
Hardware SPI:
Pins on My Board |
OLED |
GND |
GND |
VCC |
VIN(+) |
13 |
SCLK (CL) |
11 |
MOSI (SI) |
8 |
DC |
10 |
OLEDCS (OC) |
9 |
RST (R) |
Then I learnt and used the Adafruit GFX Graphics Library for Arduino to make a simple interface. It is very easy to use but also has a lot of limitations. For example, for text there is only one font you can use and for the size of the text you can only multiply that by integers, so it is impossible to make fine adjustments. Later I will try to work with the U8glib library to see if it would be more flexible.
For the below pictures, the black jumper wire on the left would actually be the metallic tattoo on my thumb, and the blue, green and yellow wires would be that on different segment of my fingers. When the black and the color ones are connected, different functions are selected on the screen.
(The background color of the menu is actually blue, and the rectangle and the texts are in white)
I 'm still working on the metallic temporary tattoo. Hope I can integrate that with these next week.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
My arduino code