View
55
Download
4
Category
Tags:
Preview:
DESCRIPTION
bhonki
Citation preview
3D LED CUBE DISPLAY (8x8x8 PIXELS)
Mini Project Report
Submitted by
RANDEEP KUMAR
SHARUK K.A
UNNI V.S
VISHNU PRASAD C.V
Focus on Excellence
Department of Electronics & Communication Engineering
FEDERAL INSTITUTE OF SCIENCE AND TECHNOLOGY (FISAT) Angamaly-683577, Ernakulam
Affiliated to
MAHATMA GANDHI UNIVERSITY
Kottayam-686560
May 2011
3D LED CUBE DISPLAY (8x8x8 PIXELS)
Mini Project Report
Submitted by
RANDEEP KUMAR
SHARUK K.A
UNNI V.S
VISHNU PRASAD C.V
In partial fulfillment of the requirements for award of the degree of Bachelor of
Technology in Electronics & Communication Engineering
Focus on Excellence
Department of Electronics & Communication Engineering
FEDERAL INSTITUTE OF SCIENCE AND TECHNOLOGY (FISAT) Angamaly-683577, Ernakulam
Affiliated to
MAHATMA GANDHI UNIVERSITYKottayam-686560
May 2011
FEDERAL INSTITUTE OF SCIENCE AND TECHNOLOGY (FISAT) Mookkannoor (P.O), Angamaly-683577
Focus on Excellence
CERTIFICATE
This is to certify that the mini project report titled 3D LED CUBE DISPLAY (8x8x8 PIXELS) submitted by Randeep Kumar, Sharuk K.A, Unni V.S, Vishnu Prasad C.V, towards partial fulfillment of the requirements for the award of the degree of Bachelor of Technology in Electronics and Communication Engineering is a record of bonafide work carried out by them during the academic year 2010 2011
Staff in chargeHead of the Department
Place:
Date:
Internal Examiner:External Examiner
ACKNOWLEDGEMENT
We express our deep sense of gratitude to our principal Dr. K.V Sundaresan who extended all resources for the successful completion of our project. Mrs. P.R Mini our
HODs well wishes, whole hearted co-operation and contribution one form or another has helped us throughout this venture.
Weare greatly indebted to our project guides Mrs. Hima Mary John,
Mr.Nandakumar, Mrs. Shamseena M.A for this scholarly assistance, kind treatment encouragement and timely help in every possible manner. We feel it due mentioning the dedication, sincerity and whole hearted co-operation that they extended to us. We hereby extended our sincere thanks to the laboratory staff Mrs. Bini T Abraham and all others as well for giving their support in realizing the goal.
Our sincere gratitude is expressed and extended to all our friends and to all those who have contributed directly or indirectly to make this endeavour a success. Above all, we express our overwhelming gratitude to the almighty for the success of our project. Without the divine grace, our dream project wouldnt have materialized.
ABSTRACT
The project is a 3D LED CUBE DISPLAY (8x8x8 PIXELS) which displays different patterns stored in the microcontroller. This LED cube is like a LED screen, but it is special in that it has a third dimension, making it 3D. Think of it as many transparent low resolution displays. In normal displays it is normal to try to stack the pixels as close as possible in order to make it look better, but in a cube one must be able to see through it, and more spacing between the pixels (actually it's voxels since it is in 3d) is needed. The spacing is a trade-off between how easy the layers behind it are seen, and voxel fidelity. Since it is a lot more work making a LED cube than a LED display, they are usually low resolution. A LED display of 8x8 pixels are only 64 LEDs, but a LED cube in 8x8x8 is 512 LEDs, an order of magnitude harder to make! This is the reason LED cubes are only made in low resolution. A LED cube does not have to be symmetrical; it is possible to make a 7x8x9, or even oddly shaped ones. Here we have an 8x8x8 shaped one. The code is written in the C language using AVR studio and it is burned into the microcontroller using the pony prog 2000.The circuit needs to be mounted on the mechanical structure or platform where it displays the patterns that are stored in the microcontroller as indicated in the codes. The patterns are displayed on a 3D structure which is made up of stainless steel rods. The messages can be changed as per user need by rewriting the microcontrollers in-built memory. The complete display system circuit is power supply run on 5V, 2A which is provided externally. This unique way of displaying messages is a very eye catching; therefore its uses can in the field of advertising, toys, etc
CONTENTS
Page No
Chapter 1INTRODUCTION1
Chapter 2BLOCK DIAGRAM AND EXPLANATION2
2.1Block diagram2
2.2Explanation3
Chapter 3CIRCUIT DIAGRAMS AND EXPLANATION 5
3.1Circuit Diagrams6
3.1.1Schematic Controller Board6
3.1.2Wiring 3x3x3 LED Cube7
3.2Explanation8
Chapter 4PCB10
4.1PCB Component Layout10
4.2Jumper Layer11
4.3Soldering Layer12
4.4PCB Fabrication13
Chapter 5HARDWARE AND SOFTWARE SECTION15
5.1Hardware section15
5.2Software platforms used16
5.3Flow chart19
Chapter 6RESULTS21
Chapter 7CONCLUSION & FUTURE SCOPE22
Components List23
References24
Appendix25
1. INTRODUCTION
3D LED CUBE DISPLAY (8x8x8 PIXELS)
1. INTRODUCTION
A microcontroller is a computer. All computers whether talk about a personal desktop computer or a large mainframe computer or microcontrollers have several things in common like the CPU (central processing unit), execution of programs, presence of RAM (random-access memory) etc Microcontrollers are special purpose computers.
Microcontrollers are often low- power devices. A desktop computer is almost always plugged into a wall socket and might consume 50 watts of electricity. A microcontroller has a dedicated input device and often (but not always) has a small LED or LCD display for output. A microcontroller is often small and low cost. Today the technology has advanced to such an extent that has come a need to display electronic messages to satisfy all purposes, whether it is business or domestic use. The solution found to satisfy this need is the matrix display systems using LEDs and LCDs. Different kinds of matrix systems are available today which are capable of displaying messages, graphics, logos and moving animation that are sure to capture and hold the attention of any audience. It provides instantaneous, flexible communications when and where theyre needed most. This LED cube has 512 LEDs. Obviously, having a dedicated IO port for each LED would be very impractical. We would need a micro controller with 512 IO ports, and run 512 wires through the cube. Instead, LED cubes rely on an optical phenomenon called persistence of vision (POV).If we flash a led really fast, the image will stay on our retina for a little while after the led turns off. By flashing each layer of the cube one after another really fast, it gives the illusion of a 3d image, when in fact we are looking at a series of 2d images stacked onto one another. This is also called multiplexing. With this setup, we only need 64 (for the anodes) + 8 (for each layer) IO ports to control the LED cube. The main purpose of our project is to build a 3D LED cube display using an ATMEGA32, high performance, low power Atmel AVR 8-bit Microcontroller. It has advanced RISC architecture and 131 powerful instructions with most single clock cycle execution and 32 x 8 general purpose working registers. Its function is to display the different patterns in 3D using 512 LEDs.
By moving them fast enough, the output will be a human identifiable pattern or character.
Electronics & Communication Engineering, FISAT1
2. BLOCK DIAGRAM AND EXPLANATION
3D LED CUBE DISPLAY (8x8x8 PIXELS)
2. BLOCK DIAGRAM AND EXPLANATION
2.1 Block Diagram
230 V, 50 Hz AC Supply
Fig 2.1 Block Diagram
Electronics & Communication Engineering, FISAT2
3D LED CUBE DISPLAY (8x8x8 PIXELS)
2.2 Explanation
2.2.1 Power Supply
Power supply is used to provide a +5 volt, 2A from 230V 50Hz ac supply with the use of bridge rectifier and regulator.
2.2.2 Microcontroller
Microcontroller ATMEGA32 is used to control the D latch and MOSFET. The ATMEGA32 is a low power, high performance CMOS 8-bit microcomputer with 32K bytes of Flash programmable and 1K bytes of EEPROM .The on chip Flash allows the program memory to be reprogrammed in system or by a conventional nonvolatile memory programmer. It has 32x8 general purpose working registers with 131 powerful instructions.
2.2.3 Mosfet (Irfz44)
IRFZ44 is an N-channel (MOSFET) enhancement mode standard level field-effect power transistor in a plastic envelope using trench technology. The device features very low on-state resistance and has integral zener diodes giving ESD protection up to 2kV. It is intended for use in switched mode power supplies and general purpose switching applications.
2.2.4 D Latch (74HC573)
The 74HC/HCT573 are high-speed Si-gate CMOS devices and are pin compatible with low power Schottky TTL (LSTTL). They are specified incompliance with JEDEC standard no.7A.The 74HC/HCT573 are octal D-type transparent latches
Electronics & Communication Engineering, FISAT3
3D LED CUBE DISPLAY (8x8x8 PIXELS)
featuring separate D-type inputs for each latch and 3-state outputs for bus oriented applications. A latch enable (LE) input and an output enable (OE) input are common to all latches.
2.2.5 3d Led Cube Structure
This 3D led cube is made up of stainless steel rods with 512 leds. There are
64 anodes 8 cathodes. The LED cube is made up of columns and layers. The cathode legs of every LED in a layer are soldered together. All the anode legs in one column are soldered together. Each of the 64 columns is connected to the controller board with a separate wire. Each column can be controlled individually. Each of the 8 layers also has a separate wire going to the controller board. Each of the layers is connected to a transistor that enables the cube to turn on and off the flow of current through each layer.
Electronics & Communication Engineering, FISAT4
3. CIRCUIT DIAGRAMS AND EXPLANATION
3D LED CUBE DISPLAY (8x8x8 PIXELS)
3. CIRCUIT DIAGRAMS AND EXPLANATION
3.1 Circuit Diagrams
3.1.1 schematic controller board
The components used in the Fig 3.1 and their values are given below,
MicrocontrollerATMEGA32-P
Q1 - Q8 (N-Mosfet)IRFZ44
P12 Pin Header
P2ISP Header
P3 P118 Pin Header
U2 U9 (D Latch)74HC573
R2 R91K Resistors
R10 R17, R20 R27, R30 R37
R40 R47, R50 R57, R60 R6720
R70 R77, R80 R87
X (Crystal Oscillator)16MHz
C1, C322PF
C210PF
Electronics & Communication Engineering, FISAT5
3D LED CUBE DISPLAY (8x8x8 PIXELS)
Fig 3.1 schematic controller board
Electronics & Communication Engineering, FISAT6
3D LED CUBE DISPLAY (8x8x8 PIXELS)
3.1.2 Wiring 3x3x3 LED Cube
Fig 3.2 wiring 3x3x3 led cube
Electronics & Communication Engineering, FISAT7
3D LED CUBE DISPLAY (8x8x8 PIXELS)
3.2 Explanation
A LED cube is like a LED screen, but it is special in that it has a third dimension, making it 3D. Think of it as many transparent low resolution displays. In normal displays it is normal to try to stack the pixels as close as possible in order to make it look better, but in a cube one must be able to see trough it, and more spacing between the pixels (actually it's voxels since it is in 3d) is needed. The spacing is a trade-off between how easy the layers behind it are seen, and voxel fidelity. Since it is a lot more work making a LED cube than a LED display, they are usually low resolution. A LED display of 8x8 pixels are only 64 LEDs, but a LED cube in 8x8x8 is 512 LEDs, an order of magnitude harder to make! This is the reason LED cubes are only made in low resolution. A LED cube does not have to be symmetrical; it is possible to make a 7x8x9, or even oddly shaped ones.
This LED cube has 512 LEDs. Obviously, having a dedicated IO port for each LED would be very impractical. Thus there comes the need of a micro controller with 512 IO ports, and run 512 wires through the cube. Instead, LED cubes rely on an optical phenomenon called persistence of vision (POV). When a led is flashed really fast, the image will stay on the retina for a little while after the led turns off. By flashing each layer of the cube one after another really fast, it gives the illusion of a 3d image, when in fact we are looking at a series of 2d images stacked onto one another. This is also called multiplexing. With this setup, there exists the need of only 64 (for the anodes) + 8 (for each layer) IO ports to control the LED cube. There are anodes, cathodes, columns and layers,
forthisledcube.
In order to light up an LED, we have to run current from the anode to the cathode. The LED cube is made up of columns and layers. The cathode legs of every LED in a layer are soldered together. All the anode legs in one column are soldered together. Each of the 64 columns is connected to the controller board with a separate wire. Each column can be
Electronics & Communication Engineering, FISAT8
3D LED CUBE DISPLAY (8x8x8 PIXELS)
controlled individually. Each of the 8 layers also has a separate wire going to the controller board. Each of the layers is connected to a transistor that enables the cube to turn on and off the flow of current through each layer. By only turning on the transistor for one layer, current from the anode columns can only flow through that layer. The transistors for the other layers are off, and the image outputted on the 64 anode wires are only shown on the selected layer. To display the next layer, simply turn off the transistor for the current layer, change the image on the 64 anode wires to the image for the next layer. Then turn on the
transistorforthenextlayer.Rinseandrepeatveryfast.
The layerswillbereferred toaslayers, cathodelayers orgroundlayers.
The columns will be referred to as columns, anode columns or anodes.
The control unit is quite simple, 3 ports of the Mega32 were used:
one port controls 8 FETs for sinking the 8 ground layers one port is wired to all 8 8bit d-latch inputs
the last port is used to enable the d-latch inputs
Since the d-latches are only able to sink or source 70mA on all 8 latches, we had to limit the diode current to ~9mA, which is fairly enough for this type of LED.
Electronics & Communication Engineering, FISAT9
4. PCB
3D LED CUBE DISPLAY (8x8x8 PIXELS)
4. PCB
4.1 PCB Component Layout
Fig 4.1 component layout
Electronics & Communication Engineering, FISAT10
3D LED CUBE DISPLAY (8x8x8 PIXELS)
4.2 Jumper Layer
Fig 4.2 jumper layer
Electronics & Communication Engineering, FISAT11
3D LED CUBE DISPLAY (8x8x8 PIXELS)
4.3 Soldering Layer
Fig 4.3 Soldering layer
Electronics & Communication Engineering, FISAT12
3D LED CUBE DISPLAY (8x8x8 PIXELS)
4.4 PCB Fabrication
A printed circuit board, or PCB, is used to mechanically support and electrically connect electronic components using conductive pathways, tracks or traces etched from copper sheets laminated onto a non-conductive substrate. It is also referred to as printed wiring board (PWB) or etched wiring board. A PCB populated with electronic components is a printed circuit board assembly (PCBA).
PCBs are inexpensive, and can be highly reliable. They require much more layout effort and higher initial cost than either wire-wrapped or pint-to-point constructed circuits, but are much cheaper and faster for high- volume production. Much of the electronics industrys PCB design, assembly and quality control needs are set by standards that are published by the IPC organization.
4.4.1 materials
Conducting layers are typically made of thin copper foil. Insulating layers dielectric are typically laminated together with epoxy resin prepreg. The board is typically coated with a solder mask that is green in color. Other colors that are normally available are blue and red. There are quite a few different dielectrics that can be chosen to provide different insulating values depending on the requirements of the circuit. Some of these dielectrics are polytetrafluroethylene (Teflon), FR-4, FR-1, CEM-1 or CEM-3. Well known prepreg materials used in the PCB industry are FR-2 (Phenolic cotton paper), FR-3 (Cotton paper and epoxy), FR-4 (Woven glass and epoxy), FR-5 (Woven glass and epoxy), FR-6 (Matte glass and polyester), G-10 (Woven glass and epoxy), CEM-1 (Cotton paper and epoxy), CEM-2 (Cotton paper and epoxy) CEM-3 (Woven glass and epoxy), CEM-4 (Woven glass and epoxy), CEM-5 (Woven glass and polyester). Thermal expansion is an important consideration especially with BGA and naked die technologies, and glass fiber offers the best dimensional stability.
Electronics & Communication Engineering, FISAT13
3D LED CUBE DISPLAY (8x8x8 PIXELS)
4.4.2 patterning (etching)
The vast majority of printed circuit boards are made by bonding a layer of copper over the entire substrate, sometimes on both sides, (creating a blank PCB) then removing unwanted copper after applying a temporary mask (e.g. by etching), leaving only the desired copper traces. A few PCBs are made by adding traces to the substrate (or a substrate with a very thin layer of copper) usually by a complex process of multiple electroplating steps.
There are three common subtractive methods (methods that remove copper) used for the production of printed circuit boards.
1. Silk Screen printing uses etch-resistant inks to protect the copper foil. Subsequent etching removes the unwanted copper. Alternatively, the ink may be conductive, printed on a blank (non conductive) board. The latter technique is also used in the manufacture of hybrid circuits.
2. Photoengraving uses a photomask and chemical etching to remove the copper foil from the substrate. The photomask is usually prepared with a photo plotter from data produced by a technician using CAM, or computer-aided manufacturing software.
3. PCB milling uses a two or three-axis mechanical milling system to mill away the copper foil from the substrate. A PCB milling machine (referred to as a PCB Prototype) operates
in a similar way to a plotter of the milling head in the x, y, and (if relevant z axis). Data to drive the Prototypes is extracted from files generated in PCB design software and stored in HPGL or Gerber file format.
Electronics & Communication Engineering, FISAT14
5. HARDWARE AND SOFTWARE SECTION
3D LED CUBE DISPLAY (8x8x8 PIXELS)
5. HARDWARE AND SOFTWARE SECTION
5.1 Hardware Section
5.1.1 isp programmer
This simple AVR Programmer will allow you to painlessly transfer hex programs to most ATMEL AVR microcontrollers without sacrificing your budget and time. It is more reliable than most other simple AVR programmers available out there and can be built in very short amount of time.
Fig 5.1 serial programmer
Electronics & Communication Engineering, FISAT15
3D LED CUBE DISPLAY (8x8x8 PIXELS)
5.2 Software Platforms Used
5.2.1 avr studio
AVR Studio is used by embedded programmers for programming and debugging for many of the Atmel microprocessors such as the Atmega8 or even the Atmega128. While it has support for assembly programming for those who prefer to use higher languages, it uses the coff format for debugging. Beginning with version 4 AVR Studio has now moved to dwarf2, and can be more readily used in conjunction with the open source gcc based compiler WinAVR.
Fig 5.2 AVR studio
Electronics & Communication Engineering, FISAT16
3D LED CUBE DISPLAY (8x8x8 PIXELS)
5.2.2 pony prog 2000
Pony Prog is a serial device programmer software with a user-friendly GUI frame work available for Windows95, 98, 2000 & NT and Intel Linux. Its purpose is reading and writing every serial device. At the moment it supports IC Bus, Micro wire, SPI EEPROM, the Atmel AVR and Microchip PIC micro.
Fig 5.3 pony prog
Electronics & Communication Engineering, FISAT17
3D LED CUBE DISPLAY (8x8x8 PIXELS)
Fig 5.4 connections for programming
Fig 5.5 pin out of
ATMEGA32
Electronics & Communication Engineering, FISAT18
3D LED CUBE DISPLAY (8x8x8 PIXELS)
5.3 Flow Chart
START
Port Configurations
Initialization
While (1)
YES
Call the function cube explosion ()
Display
String
FISAT
AB
Electronics & Communication Engineering, FISAT19
3D LED CUBE DISPLAY (8x8x8 PIXELS)
A
Call Block
wipe ()
Rotate string
3D
Call functions block wipe (), cube_2_auto (), cube_wipe (), cube_waves (),
cube_explosion (), cube_stripes ()
Call functions cube_belt_wipe(); outline_shrink(); cube_explosion(); cubes_4(); cubes_4(); cube_belt_wipe();
cube_outline(); cube_explosion(); cube_stars(); cube_explosion(); cube_sonic(); cube_belt_wipe(); cube_string_belt("
.thank you");
B
Electronics & Communication Engineering, FISAT20
6. RESULTS
3D LED CUBE DISPLAY (8x8x8 PIXELS)
6. RESULTS
After successfully completing this project we came to know more about our project. It gave us a lot of experience which will help in our future. The main advantages and limitations of the project were identified. There are many applications for our project like in the field of advertising, for making toys, to use as a study material, etc. but the only limitation of this project we had found is that it requires complete darkness, as it deals with the light. Since it consists of the LEDs it should be kept in a dark room for the perfect output.
Electronics & Communication Engineering, FISAT21
7. CONCLUSION & FUTURE SCOPE
3D LED CUBE DISPLAY (8x8x8 PIXELS)
7. CONCLUSION & FUTURE SCOPE
We were successful in completing our mini project 3D LED CUBE DISPLAY (8x8x8 Pixels). It was a wonderful experience as we attained basic knowledge on different steps in circuit manufacturing such as circuit testing and debugging, soldering components, PCB fabrication etc that will surely help us in our career in electronics field. By doing this project we also came to know about the advantages and disadvantages of our project and its future development. Today we have a 3D world; a 3D revolution will be formed in the upcoming years. This project can be upgraded to a great extent by suitable add-ons and we expect a bright future for our project in the coming years. The main applications of our project include toys, advertisements, study material, research purposes etc
Electronics & Communication Engineering, FISAT22
3D LED CUBE DISPLAY (8x8x8 PIXELS)
Table 1: Components List
SL.NO:COMPONENTSPECIFICATIONQUANTITY
1LEDSBLUE COLOR,512
DOM TYPE
2RESISTORS20 , 1K, 10K,64, 8, 2, 3, 3
22K, 4.7K
3MOSFETIRFZ44 (N8
CHANNEL)
4LARGE PROTOTYPEMEDIUM SIZE3
PCBS
5MICROCONTROLLERATMEGA321
6D LATCH74HC5738
7CAPACITORS22PF, .01F5, 5
8TRANSISTORBC5471
9CRYSTAL16MHz1
OSCILLATOR
10POWER SUPPLY5V, 2A1
11SERIAL CABLE ANDFOR1
4PIN FEMALE PINPROGRAMMING
HEADER
12STAINLESS STEELFOR THE1.25 KG
RODSSTRUCTURE
138 PIN CONNECTORSWITH JACK18
14HEAT SINKSWING TYPE8
15MISCELLANEOUS--
Electronics & Communication Engineering, FISAT23
3D LED CUBE DISPLAY (8x8x8 PIXELS)
References
[1] (2010, Aug). Atmel: ATMEGA32 DATASHEET [Online].
Available: http://www.atmel.com/dyn/resources/prod_documents/doc2503.pdf
[2] (2011, Apr). Atmel AVR Microcontroller Primer: Programming and Interfacing (Synthesis Lectures on Digital Circuits and Systems)
[3] (2000, Sep).
[4] (2005-2010).
[5] (2005-2010).
Electronics & Communication Engineering, FISAT24
APPENDIX
3D LED CUBE DISPLAY (8x8x8 PIXELS)
3D LED CUBE DISPLAY (8x8x8 PIXELS)
Electronics & Communication Engineering, FISAT25
3D LED CUBE DISPLAY (8x8x8 PIXELS)
Program
Header Files
AB
#ifndef AB_H #define AB_H
#include
void cube_char( char ch, uint8_t z );
#endif
ANIMATIONS
#ifndef ANIMATIONS_H #define ANIMATIONS_H
#include #include #include
void cube_string_belt(char *string);
void set_char_to_belt(char character, char *belt); void move_belt_left(char *belt);
#define SHOW_BELT_DELAY 50 void show_belt(char *belt);
void cube_string_to_front(char *string);
void cube_fixed_string( void );
Electronics & Communication Engineering, FISAT26
3D LED CUBE DISPLAY (8x8x8 PIXELS)
#define CUBE_AUTO_DELAY 60 void cube_2_auto( void );void cube_2_auto_show( char cube2[4][4] );
uint8_t cube2_move_y_fwd( char cube2[4][4], uint8_t y, uint8_t x, uint8_t z ); uint8_t cube2_move_y_rev( char cube2[4][4], uint8_t y, uint8_t x, uint8_t z ); uint8_t cube2_move_x_fwd( char cube2[4][4], uint8_t y, uint8_t x, uint8_t z ); uint8_t cube2_move_x_rev( char cube2[4][4], uint8_t y, uint8_t x, uint8_t z ); uint8_t cube2_move_z_fwd( char cube2[4][4], uint8_t y, uint8_t x, uint8_t z ); uint8_t cube2_move_z_rev( char cube2[4][4], uint8_t y, uint8_t x, uint8_t z );
void cube_diamond( void );
#define CUBES2_DELAY 15 void cubes_2( void );
#define CUBES4_DELAY 50 void cubes_4( void );
#define STRIPES_DELAY 60 void cube_stripes( void );
#define OUT_SHRINK_DELAY 140 void outline_shrink( void );
#define EXPLOSION_DELAY 10 void cube_explosion( void );
#define SWIPE_DELAY 60 void cube_wipe( void );
#define BLINK_DELAY 3 void cube_flash( uint8_t cycle );
#define CUBE_STRING_DELAY 5 void cube_string( char *string );
#define OUTLINE_DELAY 60 void cube_outline( void );
#define SONIC_DELAY 40 void cube_sonic( void );
#define WAVES_DELAY 3 #define WAVES_DEPTH 255 void cube_waves( void );
Electronics & Communication Engineering, FISAT27
3D LED CUBE DISPLAY (8x8x8 PIXELS)
#define STARS_DELAY 40 void cube_stars( void );
#define BLOCK_WIPE_DELAY 50 void cube_block_wipe( void );
#define BELT_WIPE_DELAY 50 void cube_belt_wipe( void ); #endif
LEDCUBE
#ifndef LEDCUBE_H #define LEDCUBE_H
#include #include #include
uint8_t cube[8][8];
void cube_show_init( void );
void cube_clear ( void );
void cube_clear_layer(uint8_t layer); void cube_full ( void );
void cube_cube_3 ( void ); void cube_cube_4_line ( void ); void cube_random( void ); void cube_test_z( void );
void cube_test_y( void ); void cube_test_x( void );
void cube_show( void );
void cube_show_loop( uint8_t cycle );
void cube_show_loop_wo_int( uint8_t cycle ); #endif
TRANSLATION
Electronics & Communication Engineering, FISAT28
3D LED CUBE DISPLAY (8x8x8 PIXELS)
#ifndef TRANSLATION_H #define TRANSLATION_H
#include #include #include
void move_z_fwd ( uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2 ); void move_z_rev ( uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2 ); void move_y_fwd( uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2 ); void move_y_rev( uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2 ); void move_x_fwd( uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2 ); void move_x_rev( uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2 );
#endif
ROTATION
#ifndef ROTATION_H #define ROTATION_H
#include #include #include
#define CL_LOOP_DELAY 30 //was 6 void rotate_90_auto ( uint8_t cycle );
void rotate_15_deg( void ); void rotate_30_deg( void ); void rotate_45_deg( void ); void rotate_60_deg( void ); void rotate_75_deg( void ); void rotate_90_deg( void );
#endif
Electronics & Communication Engineering, FISAT29
3D LED CUBE DISPLAY (8x8x8 PIXELS)
Source Files
AB
#include "ledcube.h" #include #include #include #include "ab.h"
void cube_char( char ch, uint8_t z )
{switch (ch)
{case '0':
cube[0][2] |= z; cube[0][3] |= z; cube[0][4] |= z; cube[1][1] |= z; cube[1][5] |= z; cube[2][1] |= z; cube[2][2] |= z; cube[2][5] |= z; cube[3][1] |= z; cube[3][3] |= z; cube[3][5] |= z; cube[4][1] |= z; cube[4][4] |= z; cube[4][5] |= z; cube[5][1] |= z; cube[5][5] |= z; cube[6][2] |= z; cube[6][3] |= z; cube[6][4] |= z; break;
case '1':
cube[0][2] |= z; cube[0][3] |= z; cube[0][4] |= z;
Electronics & Communication Engineering, FISAT30
3D LED CUBE DISPLAY (8x8x8 PIXELS)
cube[1][3] |= z; cube[2][3] |= z; cube[3][3] |= z; cube[4][3] |= z; cube[5][2] |= z; cube[5][3] |= z; cube[6][3] |= z; break;
case '2':
cube[0][1] |= z; cube[0][2] |= z; cube[0][3] |= z; cube[0][4] |= z; cube[0][5] |= z; cube[1][2] |= z; cube[2][3] |= z; cube[3][4] |= z; cube[4][5] |= z; cube[5][1] |= z; cube[5][5] |= z; cube[6][2] |= z; cube[6][3] |= z; cube[6][4] |= z; break;
case '3':
cube[0][2] |= z; cube[0][3] |= z; cube[0][4] |= z; cube[1][1] |= z; cube[1][5] |= z; cube[2][5] |= z; cube[3][4] |= z; cube[4][3] |= z; cube[5][4] |= z; cube[6][1] |= z; cube[6][2] |= z; cube[6][3] |= z; cube[6][4] |= z; cube[6][5] |= z; break;
case '4':
cube[0][4] |= z; cube[1][4] |= z; cube[2][1] |= z; cube[2][2] |= z; cube[2][3] |= z;
Electronics & Communication Engineering, FISAT31
3D LED CUBE DISPLAY (8x8x8 PIXELS)
cube[2][4] |= z; cube[2][5] |= z; cube[3][1] |= z; cube[3][4] |= z; cube[4][2] |= z; cube[4][4] |= z; cube[5][3] |= z; cube[5][4] |= z; cube[6][4] |= z; break;
case '5':
cube[0][2] |= z; cube[0][3] |= z; cube[0][4] |= z; cube[1][1] |= z; cube[1][5] |= z; cube[2][5] |= z; cube[3][5] |= z; cube[4][1] |= z; cube[4][2] |= z; cube[4][3] |= z; cube[4][4] |= z; cube[5][1] |= z; cube[6][1] |= z; cube[6][2] |= z; cube[6][3] |= z; cube[6][4] |= z; cube[6][5] |= z; break;
case '6':
cube[0][2] |= z; cube[0][3] |= z; cube[0][4] |= z; cube[1][1] |= z; cube[1][5] |= z; cube[2][1] |= z; cube[2][5] |= z; cube[3][1] |= z; cube[3][2] |= z; cube[3][3] |= z; cube[3][4] |= z; cube[4][1] |= z; cube[5][2] |= z; cube[6][3] |= z; cube[6][4] |= z; break;
Electronics & Communication Engineering, FISAT32
3D LED CUBE DISPLAY (8x8x8 PIXELS)
case '7':
cube[0][2] |= z; cube[1][2] |= z; cube[2][2] |= z; cube[3][3] |= z; cube[4][4] |= z; cube[5][5] |= z; cube[6][1] |= z; cube[6][2] |= z; cube[6][3] |= z; cube[6][4] |= z; cube[6][5] |= z; break;case '8':
cube[0][2] |= z; cube[0][3] |= z; cube[0][4] |= z; cube[1][1] |= z; cube[1][5] |= z; cube[2][1] |= z; cube[2][5] |= z; cube[3][2] |= z; cube[3][3] |= z; cube[3][4] |= z; cube[4][1] |= z; cube[4][5] |= z; cube[5][1] |= z; cube[5][5] |= z; cube[6][2] |= z; cube[6][3] |= z; cube[6][4] |= z; break;
case '9':
cube[0][2] |= z; cube[0][3] |= z; cube[1][4] |= z; cube[2][5] |= z; cube[3][2] |= z; cube[3][3] |= z; cube[3][4] |= z; cube[3][5] |= z; cube[4][1] |= z; cube[4][5] |= z; cube[5][1] |= z; cube[5][5] |= z; cube[6][2] |= z;
Electronics & Communication Engineering, FISAT33
3D LED CUBE DISPLAY (8x8x8 PIXELS)
cube[6][3] |= z; cube[6][4] |= z; break;
case '!':
cube[0][3] |= z; cube[3][3] |= z; cube[4][3] |= z; cube[5][2] |= z; cube[5][3] |= z; cube[5][4] |= z; cube[6][1] |= z; cube[6][2] |= z; cube[6][3] |= z; cube[6][4] |= z; cube[6][5] |= z; break;case ':':
cube[1][2] |= z; cube[1][3] |= z; cube[2][2] |= z; cube[2][3] |= z; cube[4][2] |= z; cube[4][3] |= z; cube[5][2] |= z; cube[5][3] |= z; break;
case '.':
cube[1][2] |= z; cube[1][3] |= z; cube[2][2] |= z; cube[2][3] |= z; break;
case '?':
cube[0][3] |= z; cube[2][3] |= z; cube[3][4] |= z; cube[4][5] |= z; cube[5][1] |= z; cube[5][5] |= z; cube[6][2] |= z; cube[6][3] |= z; cube[6][4] |= z; break;
case '&':cube[0][2] |= z;
Electronics & Communication Engineering, FISAT34
3D LED CUBE DISPLAY (8x8x8 PIXELS)
cube[0][3] |= z; cube[0][5] |= z; cube[1][1] |= z; cube[1][4] |= z; cube[2][1] |= z; cube[2][3] |= z; cube[2][5] |= z; cube[3][2] |= z; cube[4][1] |= z; cube[4][3] |= z; cube[5][1] |= z; cube[5][4] |= z; cube[6][2] |= z; cube[6][3] |= z; break;
case 'a':
cube[0][1] |= z; cube[0][5] |= z; cube[1][1] |= z; cube[1][5] |= z; cube[2][1] |= z; cube[2][2] |= z; cube[2][3] |= z; cube[2][4] |= z; cube[2][5] |= z; cube[3][1] |= z; cube[3][5] |= z; cube[4][1] |= z; cube[4][5] |= z; cube[5][1] |= z; cube[5][5] |= z; cube[6][2] |= z; cube[6][3] |= z; cube[6][4] |= z; break;
case 'b':
cube[0][1] |= z; cube[0][2] |= z; cube[0][3] |= z; cube[0][4] |= z; cube[1][1] |= z; cube[1][5] |= z; cube[2][1] |= z; cube[2][5] |= z; cube[3][1] |= z; cube[3][2] |= z;
Electronics & Communication Engineering, FISAT35
3D LED CUBE DISPLAY (8x8x8 PIXELS)
cube[3][3] |= z; cube[3][4] |= z; cube[4][1] |= z; cube[4][5] |= z; cube[5][1] |= z; cube[5][5] |= z; cube[6][1] |= z; cube[6][2] |= z; cube[6][3] |= z; cube[6][4] |= z; break;
case 'c':
cube[0][2] |= z; cube[0][3] |= z; cube[0][4] |= z; cube[1][5] |= z; cube[1][1] |= z; cube[2][1] |= z; cube[3][1] |= z; cube[4][1] |= z; cube[5][1] |= z; cube[5][5] |= z; cube[5][1] |= z; cube[6][2] |= z; cube[6][3] |= z; cube[6][4] |= z; break;
case 'd':
cube[0][1] |= z; cube[0][2] |= z; cube[0][3] |= z; cube[1][1] |= z; cube[1][4] |= z; cube[2][1] |= z; cube[2][5] |= z; cube[3][1] |= z; cube[3][5] |= z; cube[4][1] |= z; cube[4][5] |= z; cube[5][1] |= z; cube[5][4] |= z; cube[6][1] |= z; cube[6][2] |= z; cube[6][3] |= z; break;case 'e':
Electronics & Communication Engineering, FISAT36
3D LED CUBE DISPLAY (8x8x8 PIXELS)
cube[0][1] |= z; cube[0][2] |= z; cube[0][3] |= z; cube[0][4] |= z; cube[0][5] |= z; cube[1][1] |= z; cube[2][1] |= z; cube[3][1] |= z; cube[3][2] |= z; cube[3][3] |= z; cube[3][4] |= z; cube[4][1] |= z; cube[5][1] |= z; cube[6][1] |= z; cube[6][2] |= z; cube[6][3] |= z; cube[6][4] |= z; cube[6][5] |= z; break;
case 'f':
cube[0][1] |= z; cube[1][1] |= z; cube[2][1] |= z; cube[3][1] |= z; cube[3][2] |= z; cube[3][3] |= z; cube[3][4] |= z; cube[4][1] |= z; cube[5][1] |= z; cube[6][1] |= z; cube[6][2] |= z; cube[6][3] |= z; cube[6][4] |= z; cube[6][5] |= z; break;
case 'g':
cube[0][2] |= z; cube[0][3] |= z; cube[0][4] |= z; cube[0][5] |= z; cube[1][1] |= z; cube[1][5] |= z; cube[2][1] |= z; cube[2][5] |= z; cube[3][1] |= z; cube[3][3] |= z;
Electronics & Communication Engineering, FISAT37
3D LED CUBE DISPLAY (8x8x8 PIXELS)
cube[3][4] |= z; cube[3][5] |= z; cube[4][1] |= z; cube[5][1] |= z; cube[5][5] |= z; cube[6][2] |= z; cube[6][3] |= z; cube[6][4] |= z; break;
case 'h':
cube[0][1] |= z; cube[0][5] |= z; cube[1][1] |= z; cube[1][5] |= z; cube[2][1] |= z; cube[2][5] |= z; cube[3][1] |= z; cube[3][2] |= z; cube[3][3] |= z; cube[3][4] |= z; cube[3][5] |= z; cube[4][1] |= z; cube[4][5] |= z; cube[5][1] |= z; cube[5][5] |= z; cube[6][1] |= z; cube[6][5] |= z; break;
case 'i':
cube[0][2] |= z; cube[0][3] |= z; cube[0][4] |= z; cube[1][3] |= z; cube[2][3] |= z; cube[3][3] |= z; cube[4][3] |= z; cube[5][3] |= z; cube[6][2] |= z; cube[6][3] |= z; cube[6][4] |= z; break;case 'j':
cube[0][2] |= z; cube[0][3] |= z; cube[1][1] |= z; cube[1][4] |= z;
Electronics & Communication Engineering, FISAT38
3D LED CUBE DISPLAY (8x8x8 PIXELS)
cube[2][4] |= z; cube[3][4] |= z; cube[4][4] |= z; cube[5][4] |= z; cube[6][3] |= z; cube[6][4] |= z; cube[6][5] |= z; break;
case 'k':
cube[0][1] |= z; cube[0][5] |= z; cube[1][1] |= z; cube[1][4] |= z; cube[2][1] |= z; cube[2][3] |= z; cube[3][1] |= z; cube[3][2] |= z; cube[4][1] |= z; cube[4][3] |= z; cube[5][1] |= z; cube[5][4] |= z; cube[6][1] |= z; cube[6][5] |= z; break;
case 'l':
cube[0][1] |= z; cube[0][2] |= z; cube[0][3] |= z; cube[0][4] |= z; cube[0][5] |= z; cube[1][1] |= z; cube[2][1] |= z; cube[3][1] |= z; cube[4][1] |= z; cube[5][1] |= z; cube[6][1] |= z; break;case 'm':
cube[0][1] |= z; cube[0][5] |= z; cube[1][1] |= z; cube[1][5] |= z; cube[2][1] |= z; cube[2][5] |= z; cube[3][1] |= z; cube[3][3] |= z;
Electronics & Communication Engineering, FISAT39
3D LED CUBE DISPLAY (8x8x8 PIXELS)
cube[3][5] |= z; cube[4][1] |= z; cube[4][3] |= z; cube[4][5] |= z; cube[5][1] |= z; cube[5][2] |= z; cube[5][4] |= z; cube[5][5] |= z; cube[6][1] |= z; cube[6][5] |= z; break;
case 'n':
cube[0][1] |= z; cube[0][5] |= z; cube[1][1] |= z; cube[1][5] |= z; cube[2][1] |= z; cube[2][4] |= z; cube[2][5] |= z; cube[3][1] |= z; cube[3][3] |= z; cube[3][5] |= z; cube[4][1] |= z; cube[4][2] |= z; cube[4][5] |= z; cube[5][1] |= z; cube[5][5] |= z; cube[6][1] |= z; cube[6][5] |= z; break;
case 'o':
cube[0][2] |= z; cube[0][3] |= z; cube[0][4] |= z; cube[1][1] |= z; cube[1][5] |= z; cube[2][1] |= z; cube[2][5] |= z; cube[3][1] |= z; cube[3][5] |= z; cube[4][1] |= z; cube[4][5] |= z; cube[5][1] |= z; cube[5][5] |= z; cube[6][2] |= z; cube[6][3] |= z;
Electronics & Communication Engineering, FISAT40
3D LED CUBE DISPLAY (8x8x8 PIXELS)
cube[6][4] |= z; break;
case 'p':
cube[0][1] |= z; cube[1][1] |= z; cube[2][1] |= z; cube[3][1] |= z; cube[3][2] |= z; cube[3][3] |= z; cube[3][4] |= z; cube[4][1] |= z; cube[4][5] |= z; cube[5][1] |= z; cube[5][5] |= z; cube[6][1] |= z; cube[6][2] |= z; cube[6][3] |= z; cube[6][4] |= z; break;case 'q':
cube[0][2] |= z; cube[0][3] |= z; cube[0][5] |= z; cube[1][1] |= z; cube[1][4] |= z; cube[2][1] |= z; cube[2][3] |= z; cube[2][5] |= z; cube[3][1] |= z; cube[3][5] |= z; cube[4][1] |= z; cube[4][5] |= z; cube[5][1] |= z; cube[5][5] |= z; cube[6][2] |= z; cube[6][3] |= z; cube[6][4] |= z; break;
case 'r':
cube[0][1] |= z; cube[0][5] |= z; cube[1][1] |= z; cube[1][4] |= z; cube[2][1] |= z; cube[2][3] |= z; cube[3][1] |= z;
Electronics & Communication Engineering, FISAT41
3D LED CUBE DISPLAY (8x8x8 PIXELS)
cube[3][2] |= z; cube[3][3] |= z; cube[3][4] |= z; cube[4][1] |= z; cube[4][5] |= z; cube[5][1] |= z; cube[5][5] |= z; cube[6][1] |= z; cube[6][2] |= z; cube[6][3] |= z; cube[6][4] |= z; break;
case 's':
cube[0][1] |= z; cube[0][2] |= z; cube[0][3] |= z; cube[0][4] |= z; cube[1][5] |= z; cube[2][5] |= z; cube[3][2] |= z; cube[3][3] |= z; cube[3][4] |= z; cube[4][1] |= z; cube[5][1] |= z; cube[6][2] |= z; cube[6][3] |= z; cube[6][4] |= z; cube[6][5] |= z; break;case 't':
cube[0][3] |= z; cube[1][3] |= z; cube[2][3] |= z; cube[3][3] |= z; cube[4][3] |= z; cube[5][3] |= z; cube[6][1] |= z; cube[6][2] |= z; cube[6][3] |= z; cube[6][4] |= z; cube[6][5] |= z; break;
case 'u':
cube[0][2] |= z; cube[0][3] |= z; cube[0][4] |= z;
Electronics & Communication Engineering, FISAT42
3D LED CUBE DISPLAY (8x8x8 PIXELS)
cube[1][1] |= z; cube[1][5] |= z; cube[2][1] |= z; cube[2][5] |= z; cube[3][1] |= z; cube[3][5] |= z; cube[4][1] |= z; cube[4][5] |= z; cube[5][1] |= z; cube[5][5] |= z; cube[6][1] |= z; cube[6][5] |= z; break;case 'v':
cube[0][3] |= z; cube[1][2] |= z; cube[1][4] |= z; cube[2][1] |= z; cube[2][5] |= z; cube[3][1] |= z; cube[3][5] |= z; cube[4][1] |= z; cube[4][5] |= z; cube[5][1] |= z; cube[5][5] |= z; cube[6][1] |= z; cube[6][5] |= z; break;
case 'w':
cube[0][2] |= z; cube[0][4] |= z; cube[1][1] |= z; cube[1][3] |= z; cube[1][5] |= z; cube[2][1] |= z; cube[2][3] |= z; cube[2][5] |= z; cube[3][1] |= z; cube[3][3] |= z; cube[3][5] |= z; cube[4][1] |= z; cube[4][5] |= z; cube[5][1] |= z; cube[5][5] |= z; cube[6][1] |= z; cube[6][5] |= z;
Electronics & Communication Engineering, FISAT43
3D LED CUBE DISPLAY (8x8x8 PIXELS)
break; case 'x':
cube[0][1] |= z; cube[0][5] |= z; cube[1][1] |= z; cube[1][5] |= z; cube[2][2] |= z; cube[2][4] |= z; cube[3][3] |= z; cube[4][2] |= z; cube[4][4] |= z; cube[5][1] |= z; cube[5][5] |= z; cube[6][1] |= z; cube[6][5] |= z; break;
case 'y':
cube[0][3] |= z; cube[1][3] |= z; cube[2][3] |= z; cube[3][2] |= z; cube[3][4] |= z; cube[4][1] |= z; cube[4][5] |= z; cube[5][1] |= z; cube[5][5] |= z; cube[6][1] |= z; cube[6][5] |= z; break;case 'z':
cube[0][1] |= z; cube[0][2] |= z; cube[0][3] |= z; cube[0][4] |= z; cube[0][5] |= z; cube[1][1] |= z; cube[2][2] |= z; cube[3][3] |= z; cube[4][4] |= z; cube[5][5] |= z; cube[6][1] |= z; cube[6][2] |= z; cube[6][3] |= z; cube[6][4] |= z; cube[6][5] |= z; break;
Electronics & Communication Engineering, FISAT44
3D LED CUBE DISPLAY (8x8x8 PIXELS)
default:break;
}}
ANIMATIONS
#include "ab.h" #include "ledcube.h" #include "animations.h" #include #include #include
#include #include #include #include "rotation.h" #include "translation.h"
void cube_stripes( void ){
cube_clear();
for (uint8_t i = 0; i < 8; i++) { cube[0][0] |= ( 1
Recommended