LOGO Emulator Using AVR
![DSC09319.JPG](/proxy/?url=https://content.instructables.com/FTN/OG8F/HPFZYBT1/FTNOG8FHPFZYBT1.jpg&filename=DSC09319.JPG)
![DSC09323.JPG](/proxy/?url=https://content.instructables.com/FIA/F9L3/HPFZYC1B/FIAF9L3HPFZYC1B.jpg&filename=DSC09323.JPG)
Forty years ago, researchers developed a programming language that would become a brilliant educational tool. Logo was an interesting Programming Language, designed by Seymour Papert for children, once much used in schools, but never fully appreciated. Logo was about manipulating a triangle on the screen (a dot in my project) that can leave a mark behind it, with the intention of drawing pictures. Logo is rarely used these days in today’s classroom. In order to take a trip down the memory lane I have designed a machine capable of emulating some of the basic Logo commands.
Operation
![turtle3.gif](/proxy/?url=https://content.instructables.com/F27/J3GQ/HPFZYCLC/F27J3GQHPFZYCLC.gif&filename=turtle3.gif)
Back in 80's the turtle looked like a little triangle in the middle of the screen. The head indicated the turtles direction. When the turtle moved it drew a line behind him. Using a mere 8 x 8 LED matrix for display, implementation of a triangle was not feasible. The project uses a blinking dot to represent the turtle. Some of the supported commands are given below.
Basic Supported Commands :
- FD 0-7 (Move the turtle forward 0-7 steps)
- BK 0-7 (Move the turtle forward 0-7 steps)
- RT 45/90 (Turn the turtle to the right 90º or 45º)
- LT 45/90 (Turn the turtle to the right 90º or 45º)
- PU (Pick the turtle's pen up off the display)
- PD (Put the turtle's pen back down on display)
- CS (Clear the screen and start over)
- HT (Hide the turtle)
- ST (Show the turtle)
Design
![DSC09326.JPG](/proxy/?url=https://content.instructables.com/F5I/GLMB/HPFZYC3Z/F5IGLMBHPFZYC3Z.jpg&filename=DSC09326.JPG)
![LedMatrix.jpg](/proxy/?url=https://content.instructables.com/FTZ/W5P9/HPFZYDU0/FTZW5P9HPFZYDU0.jpg&filename=LedMatrix.jpg)
The project uses an 8x8 LED matrix to display the player’s move.The LED matrix is controlled by a display driver from Maxim Integrated- MAX7219. The MAX7219 are compact, serial input/output common-cathode display drivers that interface microprocessors (µPs) to LED Matrix.The MAX7219 takes care of all the multiplexing, decoding and refresh circuitry.
MAX7219 is controlled by a ledcontrol library. The library provides a basic set of functions by which either individual or groups of LED's can be switched on and off. Below is a code snippet which is used in the project to address individual LED's:
//switch on the led in the 3'rd row 8'th column
//and remember that indices start at 0!
lc.setLed(0,2,7,true);
//Led at row 0 second from left too
lc.setLed(0,0,1,true);
delay(500);
//switch the first Led off (second one stays on)
lc.setLed(0,2,7,false);
A LED Bargraph is also wired to display the turtle's orientation. For any given orientation the turtle can either move forward or backward. 8 different orientation are possible namely: N , NE , E , SE , S , SW , W , NW , N.
Input is taken via a normal PS/2 keyboard. The CLK and Data pins of PS/2 keyboard are connected to pin 5 & pin 6 of Atmega328 respectively.Command input size is restricted to 4 characters only.
//switch on the led in the 3'rd row 8'th column
//and remember that indices start at 0!
lc.setLed(0,2,7,true);
//Led at row 0 second from left too
lc.setLed(0,0,1,true);
delay(500);
//switch the first Led off (second one stays on)
lc.setLed(0,2,7,false);
A LED Bargraph is also wired to display the turtle's orientation. For any given orientation the turtle can either move forward or backward. 8 different orientation are possible namely: N , NE , E , SE , S , SW , W , NW , N.
Input is taken via a normal PS/2 keyboard. The CLK and Data pins of PS/2 keyboard are connected to pin 5 & pin 6 of Atmega328 respectively.Command input size is restricted to 4 characters only.
Schematics
![logo.jpg](/proxy/?url=https://content.instructables.com/FKC/VG3K/HPFZYFLG/FKCVG3KHPFZYFLG.jpg&filename=logo.jpg)
Code
The code is written using arduino IDE. Import all the necessary libraries before compiling and uploading the code. Follow the instruction here to import the libraries.
Pictures & Video
![DSC09321.JPG](/proxy/?url=https://content.instructables.com/FLW/YX5B/HPFZYBUH/FLWYX5BHPFZYBUH.jpg&filename=DSC09321.JPG)
![DSC09322.JPG](/proxy/?url=https://content.instructables.com/FAM/DV57/HPFZYBX8/FAMDV57HPFZYBX8.jpg&filename=DSC09322.JPG)
![DSC09329.JPG](/proxy/?url=https://content.instructables.com/F92/WLPY/HPFZYC8B/F92WLPYHPFZYC8B.jpg&filename=DSC09329.JPG)
![DSC09328.JPG](/proxy/?url=https://content.instructables.com/FJ7/ZK09/HPFZYC6G/FJ7ZK09HPFZYC6G.jpg&filename=DSC09328.JPG)