Showing posts with label DIY. Show all posts
Showing posts with label DIY. Show all posts

Monday, 9 April 2018

NLC Triad - Build notes - Triple Envelope Generator

Looks like a nice compact EG module. It's in the Eurorack format.
It's a easy build too.

"These are AR or AD generators that will fire on a trigger or a gate, giving envelopes up to approx 25 seconds. A single gate to input 1 will fire all 3 envelopes, when nothing is plugged into inputs 2 & 3."

There are three envelopes in the one package.

Andrew's Blog notes are here:
http://nonlinearcircuits.blogspot.com.au/2015/11/triad-triple-envelope-generator.html

His Build guide is here:
http://www.sdiy.org/pinky/data/TRIAD%20build%20guide.pdf

If you are using a gate to trigger the envelope, once the attack stage is over the envelope will stay high until the gate finishes and then it begins the release stage.


When building remember that the LEDs are an integral part of the circuit.
Andrew recommends I use ultra-or super-bright LEDs. So depending upon the V ON of my LEDs,
I may need to have to adjust the  LED resistors (1k or 4k7 resistors) to get envelopes hitting the desired voltage. The target is to get 5-7V envelopes.



Each module used three 555 timer chips.



Andrew recommends using 22μF capacitors to get envelopes lasting approx. 25 seconds.
I'll stick with this on this build. I guess you can use larger caps if you want longer envelopes or smaller caps for shorter ones. I have two more triad PCBs to build and might experiment with cap sizes (even on the same board) on these later builds.

I usually put the ICs on first, then the rest of the passive SMD.
 pOTS & jacks next.
LEDs
Don't forget the ground leads on the jacks.
Nice !

--------------

Build 2
The LEDs make a big difference to the final voltages
I built a second Triad using green LEDS
The voltage ranges were between 5V and 8V

 




-----------------------------------------------------------------------------------
You can find more NLC builds here.
---------------------------------------------------------------------------------------

Saturday, 7 April 2018

bASTL - Grandpa expander - sampler -spa

Some additional pics to help building the expander for the Bastl Grandpa sampler module.
This is a great little sampler in Euro format.
The official notes are here:
http://www.bastl-instruments.com/modular/grandpa/spa/









Very very nice.

-----------------------------------------------------------------------------------------------
For more Euro DIY builds click here:
http://djjondent.blogspot.com.au/2017/12/diy-index.html
-------------------------------------------------------------------------------------------------

Bastl Grandpa - eurorack sampler - build

Some pics of my Grandpa eurorack module build.
This is a sampler. Love the wooden panel.

 These aren't really build notes. See Bastl's official site for those.
http://www.bastl-instruments.com/grandpa-assembly/

 Though I hope some extra pics of my attempt to assemble it will help a bit more.
I usually put the IC sockets first then the resistors, etc etc.


 tHERE are 2 PCBs.


The upper board: Holds the jacks, pots, LED etc
A small mistake here. I soldered the LED display too close to the PCB.
It has long legs for a reason... so it can sit up against the panel.
You can still view the LED easily even if you did solder it against the PCB, but it will be even clearer if do.



tHE tricky bit .. soldering the SD card.



----------------------
Some pics from my Second build of the Grandpa.
THIS is version 1.2









The RGB LED.


 i soldered the SD card at the end.

-----------------------------------------------------------------------------------------------
For more Euro DIY builds click here:
http://djjondent.blogspot.com.au/2017/12/diy-index.html
-------------------------------------------------------------------------------------------------

Thursday, 5 April 2018

Basic OLED graphics - code

tHE next step with OLEDs is to get your own graphics
we need to convert monochromatic bitmaps to data arrays 
 
The size needs to be a 128 x 64 bitmap image
 Use microsoft paint to convert your image into a bitmap.
 
Next, use this program to convert the bitmap into a data array:
Choose horizontal
 
Another good program is:
 
This code prints the Korg logo, a map of the world, the Buchla logo & some 
music notes .
It's just an example.
This uses the U8glib library

Thanks to educ8s.tv for their excellent video
 
// PROGMEM this stores thebitmap in program memory

//###############################
 
 
#include "U8glib.h"

U8GLIB_SH1106_128X64 u8g(U8G_I2C_OPT_NO_ACK);  

int frame = 0;

const unsigned char PROGMEM frame1 [] = {
//const uint8_t frame1[] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x30, 0x0F, 0xFF, 0xFC, 0x00, 0x07, 0xFF, 0xFC, 0x00,
0x00, 0x04, 0x00, 0x80, 0x01, 0x10, 0x00, 0x08, 0x00, 0x00, 0x01, 0x00, 0x20, 0x00, 0x02, 0x00,
0x00, 0x04, 0x00, 0xA0, 0x00, 0x20, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x02, 0x00,
0x00, 0x04, 0x00, 0xA0, 0x00, 0x40, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00,
0x00, 0x04, 0x00, 0xA0, 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x02, 0x00,
0x00, 0x04, 0x00, 0xA0, 0x02, 0x80, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x00,
0x00, 0x04, 0x00, 0xA0, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x02, 0x00,
0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x02, 0x00,
0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x24, 0x00, 0x00, 0x02, 0x00,
0x00, 0x04, 0x00, 0xC0, 0x04, 0x00, 0x18, 0x00, 0x80, 0x03, 0x00, 0x04, 0x00, 0x00, 0x02, 0x00,
0x00, 0x04, 0x00, 0xC0, 0x04, 0x00, 0x10, 0x00, 0x80, 0x02, 0x00, 0x04, 0x00, 0x7F, 0xFC, 0x00,
0x00, 0x04, 0x00, 0xC0, 0x04, 0x00, 0x10, 0x00, 0x80, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
0x00, 0x04, 0x00, 0xC0, 0x00, 0x00, 0x10, 0x00, 0x80, 0x02, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00,
0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x10, 0x00, 0x80, 0x02, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00,
0x00, 0x04, 0x00, 0x80, 0x08, 0x00, 0x10, 0x00, 0x80, 0x03, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x08, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x04, 0x00, 0x20, 0x01, 0x00,
0x00, 0x04, 0x00, 0x00, 0x08, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x44, 0x00, 0x20, 0x01, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x84, 0x00, 0x20, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x80, 0x00, 0x01, 0x04, 0x00, 0x20, 0x02, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x04, 0x00, 0x20, 0x02, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x44, 0x00, 0x20, 0x02, 0x00,
0x00, 0x04, 0x00, 0x00, 0x08, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x04, 0x00, 0x20, 0x02, 0x00,
0x00, 0x04, 0x00, 0x80, 0x08, 0x00, 0x10, 0x00, 0x80, 0x02, 0x00, 0x04, 0x00, 0x20, 0x02, 0x00,
0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x10, 0x00, 0x80, 0x02, 0x00, 0x24, 0x00, 0x20, 0x02, 0x00,
0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x10, 0x00, 0x80, 0x02, 0x00, 0x24, 0x00, 0x20, 0x02, 0x00,
0x00, 0x04, 0x00, 0xC0, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x24, 0x00, 0x20, 0x02, 0x00,
0x00, 0x04, 0x00, 0xC0, 0x04, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x04, 0x00, 0x20, 0x02, 0x00,
0x00, 0x04, 0x00, 0xC0, 0x04, 0x00, 0x18, 0x00, 0x80, 0x01, 0x00, 0x04, 0x00, 0x20, 0x02, 0x00,
0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x14, 0x00, 0x00, 0x02, 0x00,
0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x14, 0x00, 0x00, 0x02, 0x00,
0x00, 0x04, 0x00, 0xA0, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x02, 0x00,
0x00, 0x04, 0x00, 0xA0, 0x02, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00,
0x00, 0x04, 0x00, 0xA0, 0x02, 0x80, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x02, 0x00,
0x00, 0x04, 0x00, 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x02, 0x00,
0x00, 0x04, 0x00, 0xA0, 0x00, 0x40, 0x00, 0x02, 0x00, 0x00, 0x80, 0x09, 0x00, 0x00, 0x02, 0x00,
0x00, 0x04, 0x00, 0x80, 0x01, 0x20, 0x00, 0x04, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x02, 0x00,
0x00, 0x04, 0x00, 0x80, 0x01, 0x10, 0x00, 0x08, 0x00, 0x00, 0x80, 0x00, 0x40, 0x00, 0x02, 0x00,
0x00, 0x03, 0xFE, 0x0F, 0xFC, 0x06, 0x00, 0x60, 0x0F, 0xF8, 0x7F, 0xF0, 0x10, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

const unsigned char PROGMEM frame2 [] = {
//const uint8_t frame2[] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x03, 0xCC, 0x00, 0x00, 0x00, 0x01, 0xF0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xF0, 0x00, 0x3C, 0x18, 0x00, 0x00, 0x03, 0xFF, 0x80,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x60, 0x03, 0xC0, 0x30, 0x00, 0x03, 0xF8, 0xFC, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xE0, 0xC0, 0x3C, 0x00, 0xC0, 0x03, 0xFC, 0x01, 0xC0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x03, 0x03, 0xC0, 0x01, 0x83, 0xF8, 0x00, 0x1C, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x06, 0x7C, 0x00, 0x07, 0xF8, 0x00, 0x01, 0xE0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x0F, 0x80, 0x00, 0x08, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x07, 0x00, 0x0C, 0x00, 0x00, 0x02, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x70, 0x07, 0xF8, 0x00, 0x00, 0x3E, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x07, 0x83, 0xF8, 0x30, 0x00, 0x07, 0xCC, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x3F, 0xFC, 0x00, 0x60, 0x00, 0x78, 0x18, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xFE, 0x00, 0x00, 0xC0, 0x07, 0x80, 0x20, 0x07, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xC0, 0x00, 0x03, 0x00, 0x78, 0x00, 0xC0, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x40, 0x00, 0x06, 0x0F, 0x80, 0x01, 0x83, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x60, 0x00, 0x0C, 0xF0, 0x00, 0x03, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x20, 0x00, 0x1F, 0x00, 0x00, 0x07, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x30, 0x00, 0x30, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x03, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x01, 0x07, 0x9C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x01, 0xBC, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x03, 0xC0, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x3C, 0xC0, 0xC3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0xE0, 0x41, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0E, 0x00, 0x0F, 0x81, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x18, 0x00, 0xF0, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x30, 0x0F, 0x20, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x60, 0x78, 0x10, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xC7, 0x80, 0x18, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0xF9, 0x00, 0x08, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0x80, 0x80, 0x0C, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0x00, 0xC0, 0x04, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x40, 0x36, 0x18, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x01, 0x80, 0x61, 0xFE, 0x08, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0x23, 0x03, 0x0C, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xC0, 0x3E, 0x03, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x40, 0x18, 0x03, 0x06, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x60, 0x18, 0x03, 0x06, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x20, 0x30, 0x02, 0x79, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x30, 0x30, 0x07, 0x81, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x10, 0x30, 0x0C, 0x01, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x18, 0x30, 0x0C, 0x00, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x08, 0x30, 0x38, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0C, 0x18, 0xE0, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x04, 0x1F, 0x80, 0x07, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x06, 0x30, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x02, 0x20, 0x07, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x03, 0x60, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0xC7, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

const unsigned char PROGMEM frame3 [] = {
//const uint8_t frame3[] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFE, 0x07, 0x87, 0xC0, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFE, 0x07, 0x87, 0xF8, 0xFF, 0x83, 0xC0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x7F, 0xF9, 0xFF, 0xFC, 0x00, 0x00, 0x78, 0x7F, 0x87, 0xE0, 0x00, 0x00, 0x00,
0x00, 0x3E, 0x03, 0xFF, 0xFC, 0x7F, 0xF0, 0x00, 0xF0, 0xCF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x00,
0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xF0, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00,
0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFC, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00,
0x07, 0xFF, 0xFF, 0xFE, 0xFC, 0x7C, 0x3C, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00,
0x07, 0xFF, 0xFF, 0xF0, 0xF8, 0x38, 0x00, 0x3E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0x80, 0x00,
0x00, 0x0F, 0xFF, 0xF8, 0xFC, 0x00, 0x07, 0x9E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x07, 0x80, 0x00,
0x00, 0x0F, 0xFF, 0xFF, 0xFC, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC7, 0x80, 0x00,
0x00, 0x0F, 0xFF, 0xFF, 0xFC, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0x80, 0x00,
0x00, 0x0F, 0xFF, 0xFF, 0xFC, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00,
0x00, 0x0F, 0xFF, 0xDF, 0xEC, 0x00, 0x00, 0xFF, 0xF7, 0xDF, 0xFF, 0xFF, 0xFF, 0xD8, 0x00, 0x00,
0x00, 0x3F, 0xFF, 0xFF, 0xA4, 0x00, 0x07, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xD8, 0x00, 0x00,
0x00, 0x3F, 0xFF, 0xFE, 0x00, 0x00, 0x07, 0xCF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xDE, 0x00, 0x00,
0x00, 0x3F, 0xFF, 0xF8, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDE, 0x00, 0x00,
0x00, 0x3F, 0xFF, 0xF8, 0x00, 0x00, 0x07, 0xFC, 0x07, 0xFF, 0xFF, 0xFF, 0xFE, 0xDE, 0x00, 0x00,
0x00, 0x0F, 0xFF, 0xC0, 0x00, 0x00, 0x07, 0xFE, 0xF7, 0xFF, 0xFF, 0xFF, 0xFE, 0x30, 0x00, 0x00,
0x00, 0x0F, 0xFF, 0xC0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB0, 0x00, 0x00,
0x00, 0x0F, 0xF0, 0xC0, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00,
0x00, 0x0F, 0xF0, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x00,
0x00, 0x07, 0xC6, 0xF0, 0x00, 0x00, 0x7F, 0xFF, 0xFE, 0xFF, 0x0F, 0xFF, 0xFD, 0x80, 0x00, 0x00,
0x00, 0x01, 0xFF, 0xBF, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0x7F, 0x03, 0xE7, 0xEC, 0xC0, 0x00, 0x00,
0x00, 0x01, 0xFF, 0x3F, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0x3F, 0x03, 0xE7, 0xFC, 0xC0, 0x00, 0x00,
0x00, 0x00, 0x3F, 0x8D, 0x80, 0x00, 0x7F, 0xFF, 0xFF, 0xF8, 0x03, 0x87, 0xF0, 0xE0, 0x00, 0x00,
0x00, 0x00, 0x07, 0x9F, 0xC0, 0x00, 0x3F, 0xFF, 0xFF, 0xC0, 0x03, 0x81, 0xF0, 0x30, 0x00, 0x00,
0x00, 0x00, 0x07, 0xFF, 0xC0, 0x00, 0x3F, 0xFF, 0xFF, 0xF8, 0x01, 0x81, 0x81, 0xB0, 0x00, 0x00,
0x00, 0x00, 0x07, 0xFF, 0xF8, 0x00, 0x3F, 0xFF, 0xFF, 0xF8, 0x01, 0xE1, 0xE1, 0xB0, 0x00, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xF8, 0x00, 0x0F, 0xFF, 0xFF, 0xF8, 0x00, 0x61, 0xEF, 0xB0, 0x00, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xF8, 0x00, 0x00, 0x1F, 0xFF, 0xE0, 0x00, 0x01, 0xEF, 0xB0, 0x00, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x1F, 0xFF, 0xC0, 0x00, 0x00, 0x6F, 0xDF, 0xC0, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xFF, 0xE0, 0x00, 0x07, 0xFF, 0x00, 0x00, 0x00, 0x30, 0xC3, 0xF0, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xFF, 0xE0, 0x00, 0x07, 0xFF, 0x00, 0x00, 0x00, 0x3E, 0xF3, 0xF0, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xFF, 0xE0, 0x00, 0x07, 0xFF, 0x00, 0x00, 0x00, 0x0E, 0xF0, 0xF0, 0x00,
0x00, 0x00, 0x00, 0x7F, 0xFF, 0xE0, 0x00, 0x07, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00,
0x00, 0x00, 0x00, 0x1F, 0xFF, 0xC0, 0x00, 0x07, 0xFF, 0x78, 0x00, 0x00, 0x00, 0x3F, 0xF0, 0x00,
0x00, 0x00, 0x00, 0x1F, 0xFF, 0x80, 0x00, 0x07, 0xFF, 0x78, 0x00, 0x00, 0x00, 0xFF, 0xF0, 0x00,
0x00, 0x00, 0x00, 0x07, 0xFF, 0x80, 0x00, 0x07, 0xFE, 0x78, 0x00, 0x00, 0x07, 0xFF, 0xF8, 0x00,
0x00, 0x00, 0x00, 0x07, 0xFF, 0x00, 0x00, 0x07, 0xFE, 0x78, 0x00, 0x00, 0x07, 0xFF, 0xF8, 0x00,
0x00, 0x00, 0x00, 0x07, 0xFC, 0x00, 0x00, 0x01, 0xFE, 0x60, 0x00, 0x00, 0x07, 0xFF, 0xF8, 0x00,
0x00, 0x00, 0x00, 0x07, 0xFC, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xF8, 0x00,
0x00, 0x00, 0x00, 0x07, 0xFC, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xF8, 0x00,
0x00, 0x00, 0x00, 0x07, 0xF8, 0x00, 0x00, 0x01, 0xF0, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xF0, 0x00,
0x00, 0x00, 0x00, 0x07, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xC0, 0x60,
0x00, 0x00, 0x00, 0x07, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x80, 0x60,
0x00, 0x00, 0x00, 0x07, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x83, 0xE0,
0x00, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x87, 0xC0,
0x00, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00,
0x00, 0x00, 0x00, 0x03, 0xC3, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01, 0xEE, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xEC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

//const uint8_t frame4[] PROGMEM = {
const unsigned char PROGMEM frame4 [] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xE7, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x07, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x07, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x07, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x07, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xFF, 0xE7, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x07, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x1F, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x07, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x1F, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x07, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x07, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xF8, 0x07, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x07, 0xFF, 0x00, 0x00, 0x07, 0xFF, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x1F, 0xE0, 0x00, 0x00, 0x00, 0x1F, 0xE0,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x07, 0xF8,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x07, 0xF8,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8,
0x00, 0x00, 0x1F, 0xFF, 0xFF, 0x00, 0xF8, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8,
0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x07, 0xF8,
0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x07, 0xF8,
0x00, 0xFF, 0xE0, 0x00, 0x00, 0xFF, 0xF8, 0x00, 0x00, 0x1F, 0xE0, 0x00, 0x00, 0x00, 0x1F, 0xE0,
0x07, 0xF8, 0x00, 0x00, 0x00, 0x07, 0xF8, 0x00, 0x00, 0x07, 0xFF, 0x00, 0x00, 0x07, 0xFF, 0x00,
0x1F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00,
0x1F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x00,
0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xF8, 0x00, 0x00,
0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x1F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x1F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x07, 0xF8, 0x00, 0x00, 0x00, 0x07, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xFF, 0xE0, 0x00, 0x00, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x1F, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

void draw()
{
  if(frame==0)
   u8g.drawBitmapP( 0, 0, 16, 64, frame1);
  else if (frame == 1)
   u8g.drawBitmapP( 0, 0, 16, 64, frame2);
  else if(frame == 2)
   u8g.drawBitmapP( 0, 0, 16, 64, frame3);
   else if(frame == 3)
   u8g.drawBitmapP( 0, 0, 16, 64, frame4);
}

void setup(void) {
}

void loop(void) {

 u8g.firstPage();
  do{
   draw();
 } while(u8g.nextPage());
 
 frame ++;
 if(frame>3)
 frame = 0;
delay(3000);
}

// &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& 




The code without the images is here:
Just add your own

// *******************************************

#include "U8glib.h"

U8GLIB_SH1106_128X64 u8g(U8G_I2C_OPT_NO_ACK);  

int frame = 0;

// PROGMEM this stores thebitmap in program memory

const unsigned char PROGMEM frame1 [] = {
// add your bitmap array here
};

const unsigned char PROGMEM frame2 [] = {
// add your bitmap array here
};

const unsigned char PROGMEM frame3 [] = {
// add your bitmap array here
};

const unsigned char PROGMEM frame4 [] = {
// add your bitmap array here
};

void draw()
{
  if(frame==0)
   u8g.drawBitmapP( 0, 0, 16, 64, frame1);
  else if (frame == 1)
   u8g.drawBitmapP( 0, 0, 16, 64, frame2);
  else if(frame == 2)
   u8g.drawBitmapP( 0, 0, 16, 64, frame3);
   else if(frame == 3)
   u8g.drawBitmapP( 0, 0, 16, 64, frame4);
}

void setup(void) {
}

void loop(void) {

 u8g.firstPage();
  do{
   draw();
 } while(u8g.nextPage());
 
 frame ++;
 if(frame>3)
 frame = 0;
delay(3000);
}

// &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


Links
-------------------------------------------------------------------------------------------

 ---------------------------------
-------------------------------------

Thursday, 29 March 2018

Switch Case Statements - Arduino

 This is a bit like a roundabout.
It's a control structure.
It lets you choose from many different routes.... depending of the value of a variable.
It's like a series of  "if" statements.

Good for menus... keeps everything tidy.
 
It starts with the word switch(). 
Then in the parenthesis, you type the name of the variable that determines the case

The break keyword exits the switch statement, and is typically used at the end of each case. 
 

 

Example 1
Many thanks to Programming Electronics for the example.
 
The circuit:
 * 5 LEDs attached to digital pins 2 through 6 through 220-ohm resistors

 created 1 Jul 2009
 by Tom Igoe

This example code is in the public domain.

 http://www.arduino.cc/en/Tutorial/SwitchCase2
 

 //************************************************************
/*
  Switch statement  with serial input

 Demonstrates the use of a switch statement.  The switch
 statement allows you to choose from among a set of discrete values
 of a variable.  It's like a series of if statements.

 To see this sketch in action, open the Serial monitor and send any character.
 The characters a, b, c, d, and e, will turn on LEDs.  Any other character will turn
 the LEDs off.

 The circuit:
 * 5 LEDs attached to digital pins 2 through 6 through 220-ohm resistors

 created 1 Jul 2009
 by Tom Igoe

This example code is in the public domain.

 http://www.arduino.cc/en/Tutorial/SwitchCase2
 */

void setup() {
  // initialize serial communication:
  Serial.begin(9600);
  // initialize the LED pins:
  for (int thisPin = 2; thisPin < 7; thisPin++) {
    pinMode(thisPin, OUTPUT);
  }
}

void loop() {
  // read the sensor:
  if (Serial.available() > 0) {
    int inByte = Serial.read();
    // do something different depending on the character received.
    // The switch statement expects single number values for each case;
    // in this exmaple, though, you're using single quotes to tell
    // the controller to get the ASCII value for the character.  For
    // example 'a' = 97, 'b' = 98, and so forth:

    switch (inByte) {
      case 'a':
        digitalWrite(2, HIGH);
        break;
      case 'b':
        digitalWrite(3, HIGH);
        break;
      case 'c':
        digitalWrite(4, HIGH);
        break;
      case 'd':
        digitalWrite(5, HIGH);
        break;
      case 'e':
        digitalWrite(6, HIGH);
        break;
      default:
        // turn all the LEDs off:
        for (int thisPin = 2; thisPin < 7; thisPin++) {
          digitalWrite(thisPin, LOW);
        }
    }
  }
}
//***********************************************************************
 

 
 
 
 Links
+ https://www.arduino.cc/reference/tr/language/structure/control-structure/switchcase/ 
+ https://www.programmingelectronics.com/tutorial-14-5-switch-case-statement-old-version/

 ---------------------------------
-------------------------------------

Tuesday, 27 March 2018

Rotary Encoder & switch/button press - arduino

I was looking for some code that utilised the encoder's switch.
The switch goes LOW when its pressed.
 
This is a very simple test of your encoder.
We Need to use the serial monitor to test.

It has 5 pins:
1. CLK - Clock (Out B)
2. DT - data (Out A)
3. SW - switch (when we press the shaft, the switch connects to GND. Otherwise it is floating.)
4. + : Vcc
5. GND
 

You most often will find encoders without the breakout board.
 
They still have 5 pins.
Here there are two GNDs
There is no Vcc
 
 
 
 
 
 
Make sure you connect both ground pins.
Connect the CLK (out B) to digital pin#2
DT (out A)  to #3 
SW (switch) to digital pin 4
 


 
 This is the code.
// *****************************
// Rotary Encoder Inputs
// the declaration of the Arduino pins to which the encoder’s CLK, DT 
// and SW pins are connected. 
#define CLK 2
#define DT 3
#define SW 4

int counter = 0; //  represents the count that will be modified each time that the knob is rotated one detent (click).
int currentStateCLK; // hold the state of the CLK output and are used for determining the amount of rotation.
int lastStateCLK;
String currentDir =""; //used when printing the current direction of rotation on the serial monitor.
unsigned long lastButtonPress = 0;//  used to debounce a switch

void setup() {
	
	// Set encoder pins as inputs
	pinMode(CLK,INPUT);
	pinMode(DT,INPUT);
	pinMode(SW, INPUT_PULLUP);

	// Setup Serial Monitor
	Serial.begin(9600);

	// Read the initial state of CLK and store it in the lastStateCLK variable
	lastStateCLK = digitalRead(CLK);
}

void loop() {
	
	// Read the current state of CLK
	currentStateCLK = digitalRead(CLK);

	// If last and current state of CLK are different, then pulse occurred
	// React to only 1 state change to avoid double count
	if (currentStateCLK != lastStateCLK  && currentStateCLK == 1){

		// If the DT state is different than the CLK state then
		// the encoder is rotating CCW so decrement
		if (digitalRead(DT) != currentStateCLK) {
			counter --;
			currentDir ="CCW";
		} else {
			// Encoder is rotating CW so increment
			counter ++;
			currentDir ="CW";
		}

		Serial.print("Direction: ");
		Serial.print(currentDir);
		Serial.print(" | Counter: ");
		Serial.println(counter);
	}

	// Remember last CLK state
	lastStateCLK = currentStateCLK;

	// Read the button state
	int btnState = digitalRead(SW);

	//If we detect LOW signal, button is pressed
	if (btnState == LOW) {
		//if 50ms have passed since last LOW pulse, it means that the
		//button has been pressed, released and pressed again
		if (millis() - lastButtonPress > 50) {
			Serial.println("Button pressed!");
		}

		// Remember last button press event
		lastButtonPress = millis();
	}

	// Put in a slight delay to help debounce the reading
	delay(1);
}
//**************************************************


 
 Links
 Last minute engineers provided the code in this post. Many thanks.
 
+ https://www.instructables.com/Improved-Arduino-Rotary-Encoder-Reading/ 
+ https://playground.arduino.cc/Main/RotaryEncoders/
 
 ---------------------------------
-------------------------------------

Tuesday, 20 March 2018

8 LED shift register -arduino 74HC595

 A brief exercise using the 74HC595 Serial to Parallel Converter..
It's a shift register.
This chip has 8 outputs and 3 inputs.
The 74HC/HCT595 is a high-speed Si-gate CMOS device.
 
I remember building a Video synth module a few years ago that also used a shift register.
The Castle used a 4 bit module.... the CD4015
 
This 74HC595 is 8-bit. 
It's a 16 pin chip.
It's all digital  Designed to store 0's and 1's, not analog voltages.
So shouldn't be confused with synthesizer ASRs - analog shift registers (though the idea is the same).
 
Shift registers are basically  memory modules.
 
 
It's useful if you run out of pins on your Arduino.
The 74HC595 will help you make use of the pins you have .
You can even link multiple shift registers together to extend your output even more. 
 Most of the outputs pins are on the left. Inputs on the right. (fig 1)

Here is the data sheet.

The Data sheet describes it as a  8-stage serial shift register with a storage register and 3-state outputs. 
The shift register and storage register have separate clocks
What it does is take data from your Arduino ,& momentary store it, freeing up the pins for new data.
 
The inputs are:
MR (SRCLR) - pin 10 
SHcp - Shift Register clock - pin 11
STcp - Clock (RCLK) - pin 12 - storage register clock (LATCH)
OE - pin 13 - output enable 
Ds/SER - serial input (pin 14)

Both the shift register clock (SRCLK) and storage register clock (RCLK) are positive-edge triggered.
Pin 14 is your important DATA input pin
Pin 11 is the Clock
Pin 12 is the Latch
 
This is a good circuit diagram:

Q0 to Q7 & Q15, are the outputs
 
 
Connect ground & voltage (pins 8 & 16)

We are using digital pins 4, 5, 6.
The important connections are
  • Digital 4 from the arduino goes to pin #14 of the shift register (DATA)
  • Digital 5 from the arduino goes to pin #12 of the shift register (LATCH)
  • Digital 6 from the arduino goes to pin #11 of the shift register (CLOCK)

 The anodes of the LEDs connect via 270 ohm resistors to pins:15, 1, 2, 3, 4, 5, 6, 7.

On the LEDs, the cathode is connected to ground

Note:

Pin 13 is the output enable.
You could attach this to a PWM capable Arduino pin and use 'analogWrite' to control the brightness of the LEDs. At the moment, we need to attach it to ground. 
 
MR must also be connected to 5V

--------------------------------



Code 1

--------------------------------------------

 /*
    Adafruit Arduino - Lesson 4. 8 LEDs and a Shift Register
    */
     // declare your variables
     // these are the pins attached to the clock,latch &
     //data inputs
    int latchPin = 5;
    int clockPin = 6;
    int dataPin = 4;

    int delayTime = 500;

   /*  used to hold the pattern of which LEDs are currently
   turned on or off.
     Data of type 'byte' represents numbers using eight bits.
    */
    byte leds = 0;
     
    void setup()
    {
      pinMode(latchPin, OUTPUT);
      pinMode(dataPin, OUTPUT);  
      pinMode(clockPin, OUTPUT);
    }
     
    void loop()
    {
      leds = 0;
      updateShiftRegister();
      delay(delayTime);
      for (int i = 0; i < 8; i++)
      {
        bitSet(leds, i);
        updateShiftRegister();
        delay(delayTime);
      }
    }
     /*
     the actual data to be shifted into the shift register,
     which in this case is 'leds'.
     */
    void updateShiftRegister()
    {
       digitalWrite(latchPin, LOW);
       shiftOut(dataPin, clockPin, LSBFIRST, leds);
       digitalWrite(latchPin, HIGH);
    }

-------------------------------------------------------------------

 ---------------------------------
-------------------------------------