TSE - VGA Final Project Report - Using Arduino and Gameduino
TSE - VGA Final Project Report - Using Arduino and Gameduino
Chapter 1 Overview of project 1) Introduction 2) Problem Statement 3) User Requirement Specification 4) Definitions 5) Importance and Benefits of the Study 6) Budget 7) Conclusion Chapter 2 Resources and Case Studies 1) Introduction 2) List of Studies 3) The Arduino Development Board 4) Gameduino Shield 5) Tile Studio 6) Conclusion Chapter 3 TSE-VGA V1.5 1) Introduction 2) Operation Principles 3) Sprite Graphics 4) Functions 5) Conclusion Chapter 4 TSE-VGA V2.2 1) Introduction 2) Upgrade Info 3) Principle of Operation 4) Sprite Graphics 5) Background 6) Functions 7) Conclusion Chapter 5 Bibliography 1) List of web sites Appendix A Arduino Programming Tutorial 1) Introduction 2) Schematics 3) I/O Pins 4) The Arduino Platform 5) Basic and Relevant Programming commands 6) Additional Exercises 7) Debugging Tools Appendix B Gameduino Essentials 1) Introduction 2) The Gameduino Shield 3) Memory Map and Background 4) Sprites (Foreground) 5) Text in Gameduino
Page 2
Page 3
Page 4
Page 5
Page 6
Page 7
Page 8
3) The Arduino Development board In the Arduino development board, the studies that had to be conducted were fairly easy due to the simplicity of the interface and the vastness of tutorials. Learning what the input and output commends were the simplest of tasks, all pins were renamed to the labels presented on the board itself so identifying them was not hard. The ADC commands were also very much simplified since all delays and flags were included in one command. Referring to Appendix D, Text D.3.3; the text shows the following codes that serves a good example of input and output data.
Page 9
the above code was the only one that had to be used in the entire program, even so, this data was only used for development purposes to simulate values instead of receiving values. Although in the header files included in the Gameduino (GD.h included in Appendix D text D.3.2), it included the SPI library (SPI.h) which contained very basic input and output commands, the primary source code had no need for input and outputs rather than receiving data serially and displaying them through Gameduino commands. A number of header files were included in the code that contributed massively to the entire project. Many commands in the header files were not used but did serve purpose to debugging such as the following text extracted from Appendix C, text D.3.3;
draw_sprite(random(400), random(300), anim, 0);//used for drawing all your sprites randomly
These header files above contain all the necessary definitions and functions that were used throughout the code. When first installing the Gameduino, there were minor glitches in the code that was downloaded in the program. One very important fix was a clash in the library inclusions on the source codes downloaded. What happened was that the Gameduino source code was adapted for earlier Arduino platform versions, and more recently, the Arduino platform had renamed some of their header files such as the header named WProgram.h has been renamed to Arduino.h. The change in files needs to be corrected as shown in Appendix D Text D.3.2. The Gameduino display driver commands the use of a baud rate set to 10000, this may cause conflicts in the event that multiple boards are connected which require different baud rates but can be corrected by setting the baud rate back and forth for every applicable function. 4) Gameduino shield As you will see further in the document, there were levels in which the final product was developed. The strategy in which sprites and background were used had to be changed entirely. After studying Appendix B, it becomes better understood the functions of sprites, background graphics and all other aspects of the Gameduino shield.
Page 10
Page 11
Page 12
Page 13
Speed RPM Total Battery life Individual battery life GPS longitude and latitude Magnetometer compass direction eter Motor temperature
Not all data had been displayed in this version of the project because before it was completed, the project had been disapproved due to insufficient display functionality. The project had to be remade. Yet sprites were made for these displays and served as a stepping stone for the next version of the project. The following sprites are explained from left to right, top to bottom:
Page 14
The combination of the above sprites were used to draw the display, the display grid sprites were used most frequently and caused the sprite memory to be over used and so there were less sprite spaces available for a well made graphical display. Following further into the document, in the next version, more functions were displayed. 4) Functions Numerous functions were constructed for the display to function smoothly. The functions had to be constructed in such a way that data could be received independently and the corresponding data would instantly be updated on the screen. The following functions were created for this project: I. Setup function The setup function had to initialize the Gamduino and store all the sprites. The function for drawing the grid had also been called during setup. void setup(void) { Serial.begin(1000000); GD.begin(); GD.ascii(); GD.fill(0,' ', 4096); i = 0; prevB = -1;//startup value GD.copy(RAM_SPRIMG, pickups2_img, sizeof(pickups2_img)); GD.copy(RAM_SPRPAL, pickups2_pal, sizeof(pickups2_pal)); dGrid(); } II. Main loop Function
Since the external projects had not yet been completed, a simulated value from an analog input had been used for data. All input data to the functions had been modified to accommodate the data ranges.
Page 15
The battery display was a tricky function and had to be done through a lot of trial and error but it eventually became fully functional so long as the input data was in the right range. void dBatt(int lvl,int lTime)//function = display battery level {//occupies 12 sprites; 0-11+15 //draw top and bottom GD.sprite(11, x*25, y*7 , 7,0,0,0); GD.sprite(10, x*25, y*18,11,0,0,0); lvl = lvl/100; //sprintf(temp,"%d",lvl); //GD.putstr(10,10, temp); if(lvl != prevB) { GD.putstr(35,35," "); switch(lvl) { case 0 : { prevB = 10; while(prevB--) { GD.sprite(prevB, x*25, (8+prevB)*y,8,0,0);//empty battery } prevB = lvl; break; } case 10 : { prevB = lvl;
Page 16
The compass was more complex than anticipated, the lack of rotational options in sprites did not allow a well rotating compass, and this was one key upgrade in the final version of this project. This version of the compass required multiple switch case statements and became almost similar to a nested if statement code that looked bulky void dCompass(int dir) {//requires 2 sprites; 13-14 //dir = dir%8;//converting to a byte GD.sprite(13,20*x,2*y,21,0,0); GD.sprite(14,20*x,3*y,20,0,0); if(dir != prevD)
Page 17
Page 18
The display of temperature was not as hard as one would expect. The function could accommodate for any range of data to be sent as long as it can be converted into the right temperature value void dTemp(int deg) {//1 sprite; 16 deg = deg/10; GD.sprite(16,3*x+5,17*y,19,0,0,0);//display thermometer if(prevT != deg) { GD.putstr(3,33," "); prevT = deg; } sprintf(temp, "%d", deg); GD.putstr(3,33,temp); } VI. Display speed
This is one of the upgraded functions in the next version of this project. The speed display had become like normal text where it demanded a more visual display with bigger text. In this project, the speed display had been put in the middle of the screen but still the font size did not command enough attention. void dSpeed(int spd, int h, int v) {//requires one sprite; 12
Page 19
In this project, displaying plain text would be a disappointment due to all the Gameduino capabilities yet the display is over simplistic. The grid around the text had been drawn for a better display and separation of data. Most of the sprite IDs were used in this function void dGrid(void)//function ot draw framework {//sprites from 17 //draw all bars int b; //x - lines for(b = 1; b<26; b++)//draw horizontal lines { GD.sprite(16+b, b*x, 0*y, 2,0,0,0);//25 sprites; end at 41 GD.sprite(41+b, b*x, 19*y, 2,0,0,0);//25 sprites; end at 66 delay(10); } //y - lines for(b = 1; b<19; b++) { GD.sprite(66+b, 0*x, b*y,2,0,1,0);//17 sprites; end at 84 GD.sprite(84+b,26*x,b*y,2,0,1,0);//17 sprites;end at 103 delay(10); } //draw corners GD.sprite(103, 0*x, 0*y, 4,0,0,0); GD.sprite(104, 26*x, 19*y, 5,0,0,0); GD.sprite(105, 26*x, 0*y, 4,0,2,0); GD.sprite(106, 0*x, 19*y, 5,0,2,0);//ends at 106 //draw T bracket replacements
Page 20
GD.sprite(65, 24*x, 19*y, 1,0,1,0); GD.sprite(56, 15*x, 19*y, 1,0,1,0); GD.sprite(45, 4*x, 19*y, 1,0,1,0); //continue from sprite 106 for(b = 1; b <24; b++)//line at y = 16 for title block { GD.sprite(106+b, b*x, 16*y, 2,0,0,0);//end at } for(b = 0; b<2; b++)//draw columns of title blocks { GD.sprite(130+b,4*x,(17+b)*y,2,0,1,0); GD.sprite(132+b,15*x,(17+b)*y,2,0,1,0);//end at 133 } for(b = 0; b< 13; b++)//battery left bar { GD.sprite(134+b, 24*x, (7+b)*y, 2,0,1,0);//end at 145 } GD.sprite(146, 25*x, 6*y, 2,0,0);//battery top bar for(b = 1; b<10; b++)//GPS location box: x lines { GD.sprite(146+b, b*x, 4*y, 2,0,0);//end at 155 GD.sprite(155+b, b*x, 9*y, 2,0,0);//end at 164 } for(b = 5; b<9; b++)//GPS loacation box: y lines { GD.sprite(160+b, x*10, y*b, 2,0,1,0);//end at 167 } //GPS location corners GD.sprite(170,10*x,y*9, 5,0,1); GD.sprite(169,10*x,y*4, 4,0,2); GD.sprite(171,24*x,6*y,4,0,0,0); //replacing T junction of the title blocks GD.sprite(110,4*x, 16*y,1,0,3,0); GD.sprite(121,15*x,16*y,1,0,3,0); GD.sprite(143,24*x,16*y,1,0,0,0);
Page 21
Page 22
Page 23
Individual battery level 10 Individual battery level 9 Individual battery level 8 Individual battery level 7 Individual battery level 6 Individual battery level 5 Individual battery level 4 Individual battery level 3 Individual battery level 2 Individual battery level 1 Life time battery full bar Display sprite numeral 0 Display sprite numeral 1 Display sprite numeral 2 Display sprite numeral 3 Display sprite numeral 4 Display sprite numeral 5 Display sprite numeral 6 prite Display sprite numeral 7 Display sprite numeral 8 Display sprite numeral 9 Compass pointer sprite used for graphical digital compass use
A slight modification had been implemented in the sprites of this program. Since larger numerals were requested for the display of speed, a noticeable tutorial had been used and adapted into being ested used for this program. If the reader studies the sprites table in Appendix D text D.2.2, it is clear that there are way more sprites than the ones drawn above, this is due to the sprites graphics copied from the Chess example given in the Gameduino program. The Chess program code uses very well drawn numerals that use 2 sprites per number; the numerals were copied and adapted into use in this project with slight modifications that can be better understood by observing the functions such as ications speed and temperature display. These functions uses larger text that is identical to the Chess example but the palettes do not match, therefore the colour does not correspond but the display works just fine but the background is no longer transparent and therefore the area on which the numbers are displayed has been painted to the natural palette background colour, black.
Page 24
Page 25
Page 26
The setup function required a few extra setups to initialize the background void setup() { GD.begin(); //background for (byte y = 0; y < 38; y++) GD.copy(RAM_PIC + y * 64, image_pic + y * 50, 50); GD.copy(RAM_CHR, image_chr, sizeof(image_chr)); GD.copy(RAM_PAL, image_pal, sizeof(image_pal)); //sprites GD.copy(RAM_SPRPAL, sprite_sprpal, sizeof(sprite_sprpal)); GD.copy(RAM_SPRIMG, sprite_sprimg, sizeof(sprite_sprimg)); // For show, randomly scatter the frames on the screen
Page 27
The main loop function had more functions than the previous version, therefore further functions were called void loop() { int i = analogRead(A0); int batMini = i/113; dBatt(5,0,9,batMini,batMini); //batMini = cos (0*PI/180); dSpeed(i/8); compass(i); GD.sprite(223,(22*x)-2,(3*y)-1,21,0,0);//compass center dTemp(i/5); dRPM(i/11); /*GD.sprite(0,9 *x+1,y*11+5,22+1,0,0,0); GD.sprite(1,9 *x+1,y*12+5,33+1,0,0,0); for(i =0; i<25;i++) { GD.sprite(2+ i, x*i, y* 5, i, 0,0); } for(i=25; i< 44; i++) { GD.sprite(i+ 2,x*(i-25), y*8,i,0,0 ); }*/ } III. Display temperature
Temperature remained almost the similar as the previous function but an addition to the sprites had been made, the additional text was used such that larger numerals could be used void dTemp(int celc)//inputs degree Celsius {//this could be a 3 digit value int temp; if(celc < 10)//one digit number
Page 28
Page 29
This function also like the temperature display function uses larger font to display the numbers. void dSpeed(int s)//display speed sprites { //speed sprites are displayed at the center using the larger font //larger font sprite identities start at sprite number 22 and 11 is added for the bottom half of the sprite int temp; if(s < 10)//one digit number { GD.sprite(18,11*x+1,y*11+5,dig+s,0,0); GD.sprite(19,11*x+1,y*12+5,dig+11+s,0,0); GD.sprite(17,10*x+1,y*12+5,dig+11+s,255,0); GD.sprite(16,10*x+1,y*11+5,dig+11+s,255,0); GD.sprite(15, 9*x+1,y*12+5,dig+11+s,255,0); GD.sprite(14, 9*x+1,y*11+5,dig+11+s,255,0); return ; }
Page 30
The battery display worked very much similar to the project TSE-VGA V1.5 but this time it had to display the individual batteries as well and thus had additional input data void dBatt(int b1, int b2, int b3, int b4, int bt)//battery life display {//battery values must be between 0 to 10 //all batteries have a resolution of 10 //input values must be between 0-9!!! int temp; //display mini batteries GD.sprite(10,23*x,18*y,9-b4,0,0);//disp B4 GD.sprite(11,23*x,16*y,9-b3,0,0);//disp B3
Page 31
The compass function required the most logical set of thoughts to compile, to ease the logistics involved in this function, the use of papers for side notes were a big help. Note the commentary on the function for step by step understanding to the function void compass(int ang)//input angle with 0 representing north { float h, v;//horizontal and vertical int u, s;//up-down and sideways //must ensure there is no negative values, they cause problems... stick to simplicity //KNOW YOUR TRIGONOMETRY! while(ang>360) { ang = ang-360; } if(ang <= 90) { v = (cos(ang*PI/180)); h = (sin(ang*PI/180)); GD.sprite(20,(22*x)+(h*10)-2,(3*y)-(v*10)-1,21,0,0); GD.sprite(21,(22*x)+(h*20)-2,(3*y)-(v*20)-1,21,0,0); GD.sprite(22,(22*x)+(h*30)-2,(3*y)-(v*30)-1,21,0,0); return; } if(90<ang<=180) { ang = ang-90; v = (sin(ang*PI/180)); h = (cos(ang*PI/180));
Page 32
Page 33
Page 34
Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments. - Arduino team Homepage (http://arduino.cc )
There are numerous Arduino development boards that offer simplicity to programming micro controllers. Upon a list development boards, the Arduino UNO is one most common that has been revised multiple times until the Arduino UNO REV 3 had been developed as the latest board by February 2012. The Arduino UNO REV 3 has been selected due to the numerous open source examples found on the internet ranging from the Arduino playground (http://arduino.cc/playground/) to other pages out of the Arduino website (http://excamera.com/sphinx/gameduino/). The simplicity of these tutorials makes an excellent resource for a post beginner student to learn Arduino principles. The following list shows you a summary of the Arduino UNO Microcontroller: ATmega328 Operating Voltage: 5V Input Voltage (recommended) 7-12V Input Voltage (limits) 6-20V Digital I/O Pins 14 (of which 6 provide PWM output) Analog Input Pins 6 DC Current per I/O pin 40mA DC Current for 3.3V Pin 50mA Flash Memory 32KB (ATmega328) of which 0.5 KB used by bootloader SRAM 2KB (ATmega328) EEPROM 1KB (ATmega328) Clock Speed 16Mhz 2) Schematics The Arduino UNO REV 3 is a standard board with port expansions and standard circuits ready for use. The following schematic was obtained from the following link http://arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdf
Page 35
Page 36
Serial: 0 RX; 1 TX, used for serial communication UART or RS protocols External interrupts: 2;3, these pins can be configured as normal interrupts and can be set to trigger in different conditions such as rising edge or falling edge etc. PWM: 3; 5; 6; 9; 10; 11, these pins provide an 8 bit PWM output SPI: 10 (SS); 11(MOSI); 12 (MISO); 13 (SCK), these pins support SPI communication using the SPI library, the Gameduino (explained in Appendix B) uses these pins for inter-board SPI communication. LED: 13, this pin is connected to an LED on the board for trouble shooting purposes. When the pin is high, the LED switches on. Analog: the Arduino UNO has 6 analog inputs labeled A0 to A5 clearly marked on the board pins with a resolution of 1024 bits. RST: there is a reset button onboard that restarts the microcontroller from start off the program that is helpful to debugging.
These pins can be combined and used for numerous applications involving a cocktail of sensors or simple singular sensors for smaller projects. Additional texts can be viewed in Appendix D from texts D.3.2 to D.3.5 for basic understanding of the input and output principles. 4) The Arduino platform The Arduino platform is the key ingredient to simplifying the development of micro controllers, this platform requires simple programming knowledge that shaves off any complicating common hardware clashes that can cause fatal errors that baffles most programmers leaving them spending hours debugging and looking for a simple syntax glitch. The Arduino platform can be easily downloaded from the Arduino website and it includes most common libraries that a developer will need. The following link will provide the platform download http://arduino.googlecode.com/files/arduino-1.0.1-windows.zip The download page is the following in case using a different operating system than windows http://arduino.cc/en/Main/Software
Page 37
Download the platform from the Arduino website Paste in your drive, choose a folder near your root folder, avoid multiple sub folders Plug in your Arduino UNO REV 3 board and wait for your computer to detect hardware Go to Start->right-click My Computer->Manage, your computer management window will show up Navigate to device manager on the left pane, it will show you a list of all hardware connected to your computer. Look under ports(COM &LPT). You should an open port named Arduino UNO (COMXX), where XX represents the port number which is usually 03 Right click on the Arduino UNO (COMXX) device and choose the Update Driver Software option Thereupon, if prompted to automatically search the drivers, refuse and select to browse manually Manually navigate to your Arduino folder and continue to the subfolder Drivers, search for the file named ArdunoUNO.inf Windows will then install the drivers to recognize your board.
Step by step screen shots can be viewed in the following link: http://arduino.cc/en/Guide/UnoDriversWindowsXP After installing your platform, the user is required to setup the Arduino platform to use for his/her own board.
Set up your board. Open the application and navigate to Tools->Board->Arduino Uno. Set up your port. The Arduino board uses serial programming that is received from you USB, this programs your board. The port is defined in your device manager as set up before. Select that port by navigating on your Arduino platform application as Tools->Serial Port->COMXX.
After your Arduino has been set up, you are now free to program your board, above your code, there is a panel with common buttons that looks as follows:
Fig A.1: Arduino programming panel of Arduino 1.0 The above panel is used as a compiler control panel that the user can utilize for ease of access to common buttons. Follow the following list for the function of each button
Page 38
Setup() o Used as a one shot program that will not loop itself over and over again o Essential function that is required for all Arduino sketches Loop() o Function that contains all functions and operations that are intended for repetitive execution o Essential function that is required for all Arduino sketches For(;;) o Standard for() loop used in C++ programming If() o Standard if() condition used in C++ programming Switch() case: o Standard Switch statement used in C++ programming Break o Standard break statement used in C++ programming Delay() o Predefined function in Arduino.h pinMode() o setup function that sets input or output mode for a pin DigitalWrite() o Write boolean data to a pin DigitalRead() o Read Digital status of a pin
Page 39
As seen above, many functions are the same as C++ functions that one would learn in basic C programming, more common functions such as functions included in the math.h library can also be used for it is included in the Arduino platform include folder. One should browse the web page shown above in case you are not very familiar in C programming. All functions provide a link to examples on how to use them. One should study them briefly to grasp the concept and utilize them accordingly. 6) Additional exercises After carefully following this appendix, it is vital that the new Arduino programmer instantly familiarize himself with example coding supplied in the examples options in Arduino that can be found by navigating in the application as follows: File->Examples, there are many examples that are very important for further development, it is advisable that all examples are studied briefly, however, studying the following examples will ensure better understanding of this entire documents core programming.
Basics o BareMinimum: this example explains the basic requirements of an Arduino sketch o Blink: explain the setup and data setting o DigitalReadSerial: helps you communicate with your computer serially. Use the serial monitor read the state of a button o AnalogReadSerial: send analog data from the ADC serially to a computer and receive data from the computer o Fade: using the PWM function, control the light intensity of you LED o ReadAnalogVoltage: reads analog voltage and sends to your serial monitor Digital o BlinkwithoutDelay: blinking LED without using the delay() function o Button: simple program to check the status of a button that is pressed o Debounce: using delays to avoid switch bouncing errors o StateChangeDetection: detecting a toggle change Analog o AnalogInOutSerial: serial analog data transfer
Page 40
There are plenty more exercises that one can exercise to polish their skills, however, a debugging board is necessary to have. A few of these exercises have been added in Appendix D in the extra text section. 7) Debugging tools To practice or debug your Arduino, you will need simulated values, buttons and status LEDs connected to your board. This enables you to explore all examples with ease. Making this debugging board should be considered and made very well because of future uses, using the guidelines of Arduino shield standards. During our period in TSE, we were each asked to make an Arduino debugging board of which the following images show an example of my own debugging board.
Page 41
End of Appendix A
Page 42
Page 43
Fig B.1 the Gameduino memory map extracted from the Gameduino official poster
As shown in the memory map, there is a small section titled sprite control. The sprite control is a key and comprehensive section in Gameduino that holds a few key functions in the operation of the shield. A table is shown of its contents in the Gameduino poster.
Page 44
Page 45
Page 46
Fig B.4, the final project complete background including missing data background
Since in the Gameduino source code, there is no way for us to directly upload a .PNG image, this image has to convert into hex code and then put into a look up table for the program to recognize it. The first step is to draw the image and keep in mind to repeat characters, use drawn scales to count the pixels as you draw the image. The image under construction in my project looked something like this:
Fig B.5, background image of project TSE-VGA V2.1 under construction TSE VGA Page 47
Page 48
Page 49
Page 50
Page 51
All sprites allow transparent colors which is a key factor to the difference between the project software code versions V1.5 and V2.2
Page 52
Page 53
static void putstr(int x, int y, const char *s);// can be used to put string at an x and y *s);// coordinate
In the function above, you are required to input a x and y coordinate and insert a string that you may write manually or refer with a variable string. Sometimes however, you are required to write a variable number that you do not know yet; this requires the designer to convert the integers into string that is able to be displayed. I had made use of the following function for such functions
sprintf(temp, "%d", deg);//example line extracted from TSE-VGA V1.5 //example TSE VGA
The use of the above function allows the conversion from an integer variable (temp) scanned into a string variable (deg). For further understanding in the process of displaying, please observe Appendix D, Text D.1.1, for it uses these functions extensively.
End of Appendix B
Page 54
New file, open file, save file etc. - The basic file navigation and operations that are used in usual project creating programs.
Page 55
Fig C.1 Tile Studio basic files operations. New Tile Set - Opens a window where a new tile set can be created, a tile set is a collection of graphical tiles that are drawn as a set. In Gameduino, these tiles are referred to as sprites, a tile set is a collection of sprites. The tile set will have identical parameters such as color palettes and sprite resolutions. The Gameduino doesnt necessarily have any limitations regarding the color palettes as long as all tiles in the set use the same palette as a reference
Fig C.2 upon clicking File->New Tile Set, a window prompts you to set up your tile set. Palette Manager - The Palette manager (refer to the palette definition in Definitions in Chapter 1.4 before reading this) is a configuration that the user has to navigate to before continuing with his/ her designs. Configuring this option will allow the designer to restrict the amount of palettes used in each sprite, even though the Gameduino can display a massive variation of colors, the less variations of colors used means the less references to new colors are needed. This means that if you set your color palette to have 256 different colors, your color palette will only occupy 256 different colors, and of those 256, any color that is not used, will not be included into the resulting graphics. - Also note the option of smooth palette, this option should be unselected whereas it is activated by default and will cause certain palette confusion which leads to many new palettes to be referenced where each color is used only once and a similar shade of that
Page 56
Page 57
Page 58
Fig C6, different tiles in a tile set Drawing tools - The drawing tools are shown on the side and work like any general yet basic drawing program. Functions range from the normal pencil to faded effects or color fill.
Fig C.7 drawing panel showing all drawing tools on the left
Using the above basic functions, it was possible to draw the basic tiles required for the graphics used in the project in this document. Advanced graphics was not required, therefore basic skills in paint was enough. 4) An example The following drawing is an example on the sequence of operations followed when drawing graphics for this project. Screenshots were taken and pasted on the document.
Page 59
Fig C.8 tile sets, Tiles1 is the default tile set with previous tile settings
Click on the Tiles1 tab and go to File->Remove Tile Set, you Tiles2 project will be the only one left. b) Palette settings I. Go to Palette->Smooth Palette and disable the Smooth Palette option. II. Once smooth palette has been disabled, you have an active color palette, each color also has different color depths, therefore you can choose how dark or how light each color should Be
Page 60
Page 61
III.
Fig C.12, Full battery drawing for one tile After completing the first tile on your tile set, go to Tile-> Next Tile or simply click on the Right Arrow, at the bottom pane, a new empty tile will appear and your previous one will have been stored in the project, it is advisable to save as often as you can, there is no significant project backup built in Tile Studio
Fig C13, bottom left corner, the pane shows a new tile
IV. Draw a sequence of all the tiles you wish to display as sprites in your Gameduino, a simple exercise would be to draw the battery in different power levels, decreasing one pixel at a time, after you have completed that, at the bottom, you should have the following sequence of tiles
Fig C.14, bottom left corner, the pane shows all tiles completed. These tiles are ready to be exported
Page 62
Figs C.15, the Export Tiles window, note the transparent color at the bottom right corner, you may choose to set it or not
III. After the export Tiles window is set, you will be requested where to save the image, ensure that you choose a PNG file format when saving, follow the following image as a light guide
Page 63
Fig C.17, exported final product of tiles and ready for conversion to sprites
5) Conclusion In essence, this is a simple program, the tutorial mentioned in the beginning of this Appendix explains the process very well, additional experience has been narrated into this appendix, but certain things were not yet mentioned such as shortcuts. Valuable short cuts in this program are those such as
Right Click sample color (any color on any tile can be sampled to save the user from using a different color each time he/she wants to select a color, this avoids using too many colors and also increases working speed of the designer) Left, right key navigate back and forth between tiles. If you are in the last tile in the project, a new tile will open at the end of the project
Page 64
Page 65