For this week I wanted to try different output devices, so I decided to design and manufacture an electronic development board similar to an arduino ONE board.
For the design of the electronic development board use the EAGLE software of Autodesk
To test the board, load the arduino blink program
The assignment for this week is add an output device to a microcontroller board you've designed and program it to do something, in this case I am going to add a graphic lcd screen the 128 x 64 pixels to visualize differents images.
To program use the integrated development environment of Arduino, it is necessary to download the library GLCD.h
For viewing images on the GLCD screen it is also necessary to download the LCDAssistant program
LCD Assistant allows us to convert an image into hexadecimal code
Now with the code we must generate two files with the extension .h, for which you can use the SublimeText software.
#ifndef ArduinoIcon2_H
#define ArduinoIcon2_H
#define ArduinoIcon2 ArduinoIcon64x642
#include "bitmaps/ArduinoIcon64x642.h"
#endif
#include
#include
#ifndef ArduinoIcon64x642_H
#define ArduinoIcon64x642_H
const static uint8_t ArduinoIcon64x642[] PROGMEM = {
120, // width
43, // height
0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xC0, 0xC0, 0xC0, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xF0, 0xF0, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF8, 0xF0, 0xC0, 0x80, 0x00, 0x00,
0x00, 0x00, 0x80, 0x80, 0xC0, 0xC0, 0xC0, 0xC0, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xC0, 0xC0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0x00, 0x00,
0x00,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 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x08, 0x3F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x3F, 0x03, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0C, 0x0F, 0x0F, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x0F, 0x0F, 0x0C, 0x00, 0x03, 0x07, 0x0E, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C,
0x0F, 0x07, 0x03, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x0F,
0x00, 0x0E, 0x0F, 0x07, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03, 0x0F, 0x0E, 0x08, 0x00, 0x00, 0x0F,
0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00,
};
#endif
The two files must be saved in the folder bitmaps located in the library folder GLCD.h
Now it is necessary to do the programming that will be loaded in the microcontroller, for this I use arduino programming
#include < glcd.h>
#include "bitmaps/ArduinoIcon.h" // bitmap
#include "bitmaps/ArduinoIcon2.h" // bitmap
#include "bitmaps/ArduinoIcon3.h" // bitmap
#include "bitmaps/ArduinoIcon4.h" // bitmap
#include "bitmaps/ArduinoIcon5.h" // bitmap
#if DISPLAY_HEIGHT < 64
#error ks0108 example requires a display at least 64 pixels tall
#endif
#if DISPLAY_WIDTH < 128
#error ks0108 example requires a display at least 128 pixels wide
#endif
unsigned long startMillis;
unsigned int loops = 0;
unsigned int iter = 0;
void setup(){
GLCD.Init(NON_INVERTED); // initialise the library, non inverted writes pixels onto a clear screen
GLCD.ClearScreen();
GLCD.DrawBitmap(ArduinoIcon, 39,6, BLACK); //draw the bitmap at the given x,y position
GLCD.ClearScreen();
}
void loop(){ // run over and over again
GLCD.DrawBitmap(ArduinoIcon, 39,6, BLACK); //draw the bitmap at the given x,y position
delay(500);
GLCD.ClearScreen();
delay(500);
GLCD.DrawBitmap(ArduinoIcon2, 4,10, BLACK); //draw the bitmap at the given x,y position
delay(500);
GLCD.ClearScreen();
delay(500);
GLCD.DrawBitmap(ArduinoIcon3, 8,0, BLACK); //draw the bitmap at the given x,y position
delay(500);
GLCD.ClearScreen();
delay(500);
GLCD.DrawBitmap(ArduinoIcon5, 4,11, BLACK); //draw the bitmap at the given x,y position
delay(500);
GLCD.ClearScreen();
delay(500);
}
At the suggestion of Roberto Gallo instructor of Fablab ZOI, I have designed a shield that allows me to directly connect the graphic screen to the development board that I designed in the week of Interface and Application.