+ All Categories
Home > Documents > Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

Date post: 01-Jan-2016
Category:
Upload: bineeshbhasi
View: 1,303 times
Download: 16 times
Share this document with a friend
Description:
3D LED CUBE DISPLAY (
Popular Tags:
92
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
Transcript
Page 1: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

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

Page 2: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

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 UNIVERSITY Kottayam-686560

May 2011

Page 3: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

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 charge Head of the Department

Place:

Date:

Internal Examiner: External Examiner

Page 4: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

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

HOD’s well wishes, whole hearted co-operation and contribution one form or another has

helped us throughout this venture.

We are 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 wouldn’t have materialized.

Page 5: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

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 microcontroller’s 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………

Page 6: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

CONTENTS

Page No

Chapter 1 INTRODUCTION 1

Chapter 2 BLOCK DIAGRAM AND EXPLANATION 2

2.1 Block diagram 2

2.2 Explanation 3

Chapter 3 CIRCUIT DIAGRAMS AND EXPLANATION 5

3.1 Circuit Diagrams 6

3.1.1 Schematic Controller Board 6

3.1.2 Wiring 3x3x3 LED Cube 7

3.2 Explanation 8

Chapter 4 PCB 10

4.1 PCB Component Layout 10

4.2 Jumper Layer 11

4.3 Soldering Layer 12

4.4 PCB Fabrication 13

Chapter 5 HARDWARE AND SOFTWARE SECTION 15

5.1 Hardware section 15

5.2 Software platforms used 16

5.3 Flow chart 19

Page 7: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

Chapter 6 RESULTS 21

Chapter 7 CONCLUSION & FUTURE SCOPE 22

Components List 23

References 24

Appendix 25

Page 8: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

1. INTRODUCTION

Page 9: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 1

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 LED‟s and LCD‟s. 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 they‟re 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 LED‟s.

By moving them fast enough, the output will be a human identifiable pattern or character.

Page 10: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

2. BLOCK DIAGRAM AND EXPLANATION

Page 11: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 2

2. BLOCK DIAGRAM AND EXPLANATION

2.1 Block Diagram

230 V, 50 Hz AC Supply

Fig 2.1 Block Diagram

Page 12: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 3

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

Page 13: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 4

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 led‟s. 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.

Page 14: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3. CIRCUIT DIAGRAMS AND EXPLANATION

Page 15: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 5

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,

Microcontroller ATMEGA32-P

Q1 - Q8 (N-Mosfet) IRFZ44

P1 2 Pin Header

P2 ISP Header

P3 – P11 8 Pin Header

U2 – U9 (D – Latch) 74HC573

R2 – R9 1KΩ Resistors

R10 – R17, R20 – R27, R30 – R37

R40 – R47, R50 – R57, R60 – R67 20 Ω

R70 – R77, R80 – R87

X (Crystal Oscillator) 16MHz

C1, C3 22PF

C2 10PF

Page 16: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 6

Fig 3.1

schematic

controller board

Page 17: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 7

3.1.2 Wiring 3x3x3 LED Cube

Fig 3.2 wiring

3x3x3 led cube

Page 18: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 8

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,

for this led cube.

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

Page 19: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 9

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

transistor for the next layer. Rinse and repeat very fast.

The layers will be referred to as layers, cathode layers or ground layers.

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.

Page 20: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

4. PCB

Page 21: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 10

4. PCB

4.1 PCB Component Layout

Fig 4.1 component layout

Page 22: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 11

4.2 Jumper Layer

Fig 4.2 jumper layer

Page 23: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 12

4.3 Soldering Layer

Fig 4.3 Soldering layer

Page 24: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 13

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).

PCB‟s 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

industry‟s 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.

Page 25: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 14

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 PCB‟s 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.

Page 26: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

5. HARDWARE AND SOFTWARE SECTION

Page 27: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 15

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

Page 28: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 16

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

Page 29: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 17

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 I²C Bus, Micro wire, SPI EEPROM,

the Atmel AVR and Microchip PIC micro.

Fig 5.3 pony prog

Page 30: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 18

Fig 5.4 connections

for programming

Fig 5.5 pin out of

ATMEGA32

Page 31: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 19

5.3 Flow Chart

START

Port Configurations

Initialization

While (1)

Call the

function

cube

explosion ()

Display

String

“FISAT”

A

YES

B

Page 32: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 20

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

Page 33: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

6. RESULTS

Page 34: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 21

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 LED‟s it should be kept in a dark room for the perfect output.

Page 35: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

7. CONCLUSION & FUTURE SCOPE

Page 36: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 22

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………

Page 37: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 23

Table 1: Components List

SL.NO: COMPONENT SPECIFICATION QUANTITY

1 LED‟S BLUE COLOR,

DOM TYPE

512

2 RESISTORS 20 Ω, 1KΩ, 10KΩ,

22KΩ, 4.7KΩ

64, 8, 2, 3, 3

3 MOSFET IRFZ44 (N

CHANNEL)

8

4 LARGE PROTOTYPE

PCB‟S

MEDIUM SIZE 3

5 MICROCONTROLLER ATMEGA32 1

6 D LATCH 74HC573 8

7 CAPACITORS 22PF, .01µF 5, 5

8 TRANSISTOR BC547 1

9 CRYSTAL

OSCILLATOR

16MHz 1

10 POWER SUPPLY 5V, 2A 1

11 SERIAL CABLE AND

4PIN FEMALE PIN

HEADER

FOR

PROGRAMMING

1

12 STAINLESS STEEL

RODS

FOR THE

STRUCTURE

1.25 KG

13 8 PIN CONNECTORS WITH JACK 18

14 HEAT SINKS WING TYPE 8

15 MISCELLANEOUS - -

Page 38: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 24

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).

Page 39: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

APPENDIX

Page 40: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 25

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Page 41: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 26

Program

Header Files

AB

#ifndef AB_H

#define AB_H

#include <inttypes.h>

void cube_char( char ch, uint8_t z );

#endif

ANIMATIONS

#ifndef ANIMATIONS_H

#define ANIMATIONS_H

#include <stdlib.h>

#include <avr/io.h>

#include <inttypes.h>

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 );

Page 42: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 27

#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 );

Page 43: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 28

#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 <stdlib.h>

#include <avr/io.h>

#include <inttypes.h>

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

Page 44: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 29

#ifndef TRANSLATION_H

#define TRANSLATION_H

#include <stdlib.h>

#include <avr/io.h>

#include <inttypes.h>

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 <stdlib.h>

#include <avr/io.h>

#include <inttypes.h>

#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

Page 45: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 30

Source Files

AB

#include "ledcube.h"

#include <stdlib.h>

#include <inttypes.h>

#include <math.h>

#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;

Page 46: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 31

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;

Page 47: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 32

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;

Page 48: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 33

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;

Page 49: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 34

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;

Page 50: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 35

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;

Page 51: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 36

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':

Page 52: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 37

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;

Page 53: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 38

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;

Page 54: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 39

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;

Page 55: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 40

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;

Page 56: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 41

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;

Page 57: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 42

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;

Page 58: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 43

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;

Page 59: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 44

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;

Page 60: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 45

default:

break;

ANIMATIONS

#include "ab.h"

#include "ledcube.h"

#include "animations.h"

#include <stdlib.h>

#include <avr/io.h>

#include <inttypes.h>

#include <avr/interrupt.h>

#include <util/delay.h>

#include <math.h>

#include "rotation.h"

#include "translation.h"

void cube_stripes( void )

cube_clear();

for (uint8_t i = 0; i < 8; i++)

cube[0][0] |= ( 1 << i );

cube[1][7] |= ( 1 << (7-i) );

cube[2][0] |= ( 1 << i );

cube[3][7] |= ( 1 << (7-i) );

cube[4][0] |= ( 1 << i );

cube[5][7] |= ( 1 << (7-i) );

cube[6][0] |= ( 1 << i );

cube[7][7] |= ( 1 << (7-i) );

cube_show_loop(STRIPES_DELAY);

for (uint8_t j = 1; j < 8; j++)

cube_clear();

for (uint8_t i = 0; i < 8; i++)

cube[0][j] |= ( 1 << i );

cube[1][7-j] |= ( 1 << i );

cube[2][j] |= ( 1 << i );

cube[3][7-j] |= ( 1 << i );

cube[4][j] |= ( 1 << i );

cube[5][7-j] |= ( 1 << i );

cube[6][j] |= ( 1 << i );

Page 61: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 46

cube[7][7-j] |= ( 1 << i );

cube_show_loop(STRIPES_DELAY);

void cube_2_auto( void )

cube_clear();

char cube2_arr[4][4];

for (uint8_t i = 0; i < 4; i++)

for (uint8_t j = 0; j < 4; j++)

cube2_arr[i][j] = 0;

cube2_arr[0][0] |= (1 << 0);

cube2_arr[0][1] |= (1 << 0);

cube2_arr[0][2] |= (1 << 0);

cube2_arr[0][3] |= (1 << 0);

cube2_arr[1][0] |= (1 << 0);

cube2_arr[1][1] |= (1 << 0);

cube2_arr[1][2] |= (1 << 0);

cube2_arr[1][3] |= (1 << 0);

cube2_arr[0][0] |= (1 << 1);

cube2_arr[0][1] |= (1 << 1);

cube2_arr[0][2] |= (1 << 1);

cube2_arr[0][3] |= (1 << 1);

Page 62: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 47

cube2_arr[0][0] |= (1 << 2);

cube2_arr[0][1] |= (1 << 2);

cube2_arr[0][2] |= (1 << 2);

cube2_arr[0][3] |= (1 << 2);

cube2_arr[0][0] |= (1 << 3);

cube2_arr[0][1] |= (1 << 3);

cube2_arr[0][2] |= (1 << 3);

cube2_arr[0][3] |= (1 << 3);

cube2_arr[1][0] |= (1 << 3);

cube2_arr[1][1] |= (1 << 3);

cube2_arr[1][2] |= (1 << 3);

cube2_arr[1][3] |= (1 << 3);

cube_2_auto_show(cube2_arr);

for (uint16_t i = 0; i < 2000; i++)

uint8_t x = rand()%4;

uint8_t y = rand()%4;

uint8_t z = rand()%4;

if (cube2_arr[y][x] & (1 << z))

switch (rand()%6)

case 0:

while(y < 3)

Page 63: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 48

if (cube2_move_y_fwd(cube2_arr, y, x, z) == 0)

cube_2_auto_show(cube2_arr);

y++;

else break;

break;

case 1:

while(y > 0)

if (cube2_move_y_rev(cube2_arr, y, x, z) == 0)

cube_2_auto_show(cube2_arr);

y--;

else break;

break;

case 2:

while(x < 3)

if (cube2_move_x_fwd(cube2_arr, y, x, z) == 0)

cube_2_auto_show(cube2_arr);

x++;

else break;

break;

case 3:

while(x > 0)

if (cube2_move_x_rev(cube2_arr, y, x, z) == 0)

cube_2_auto_show(cube2_arr);

x--;

else break;

break;

case 4:

while(z < 3)

if (cube2_move_z_fwd(cube2_arr, y, x, z) == 0)

cube_2_auto_show(cube2_arr);

z++;

else break;

break;

Page 64: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 49

case 5:

while(z > 0)

if (cube2_move_z_rev(cube2_arr, y, x, z) == 0)

cube_2_auto_show(cube2_arr);

z--;

else break;

break;

default:

break;

uint8_t cube2_move_y_fwd( char cube2[4][4], uint8_t y, uint8_t x, uint8_t z )

if (!(cube2[y+1][x] & (1 << z)))

cube2[y][x] &= ~(1 << z);

cube2[y+1][x] |= (1 << z);

return 0;

return 1;

uint8_t cube2_move_y_rev( char cube2[4][4], uint8_t y, uint8_t x, uint8_t z )

if (!(cube2[y-1][x] & (1 << z)))

cube2[y][x] &= ~(1 << z);

cube2[y-1][x] |= (1 << z);

return 0;

return 1;

uint8_t cube2_move_x_fwd( char cube2[4][4], uint8_t y, uint8_t x, uint8_t z )

if (!(cube2[y][x+1] & (1 << z)))

cube2[y][x] &= ~(1 << z);

cube2[y][x+1] |= (1 << z);

return 0;

Page 65: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 50

return 1;

uint8_t cube2_move_x_rev( char cube2[4][4], uint8_t y, uint8_t x, uint8_t z )

if (!(cube2[y][x-1] & (1 << z)))

cube2[y][x] &= ~(1 << z);

cube2[y][x-1] |= (1 << z);

return 0;

return 1;

uint8_t cube2_move_z_fwd( char cube2[4][4], uint8_t y, uint8_t x, uint8_t z )

if (!(cube2[y][x] & (1 << (z+1))))

cube2[y][x] &= ~(1 << z);

cube2[y][x] |= (1 << (z+1));

return 0;

return 1;

uint8_t cube2_move_z_rev( char cube2[4][4], uint8_t y, uint8_t x, uint8_t z )

if (!(cube2[y][x] & (1 << (z-1))))

cube2[y][x] &= ~(1 << z);

cube2[y][x] |= (1 << (z-1));

return 0;

return 1;

void cube_2_auto_show( char cube2[4][4] )

for (uint8_t layer = 0; layer < 4; layer++)

cube_clear_layer(layer*2+1);

cube_clear_layer(layer*2);

for (uint8_t x = 0; x < 4; x++)

for (uint8_t z = 0; z < 4; z++)

if (cube2[layer][x] & ( 1 << z))

cube[layer*2][x*2] |= (1 << (z*2));

cube[layer*2][x*2] |= (1 << (z*2+1));

cube[layer*2][x*2+1] |= (1 << (z*2));

cube[layer*2][x*2+1] |= (1 << (z*2+1));

cube[layer*2+1][x*2] |= (1 << (z*2));

Page 66: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 51

cube[layer*2+1][x*2] |= (1 << (z*2+1));

cube[layer*2+1][x*2+1] |= (1 << (z*2));

cube[layer*2+1][x*2+1] |= (1 << (z*2+1));

cube_show_loop(CUBE_AUTO_DELAY);

void cubes_2( void )

cube_clear();

for (uint8_t i = 0; i < 8; i++ )

cube[0][i] = 0xFF;

cube[1][i] = 0xFF;

cube_show_loop(CUBES2_DELAY);

for (uint8_t i = 0; i < 6; i++)

move_y_fwd(2,2,3,3);

move_y_fwd(2,6,3,7);

move_y_fwd(6,2,7,3);

move_y_fwd(6,6,7,7);

cube_show_loop(CUBES2_DELAY);

for (uint8_t i = 0; i < 4; i++)

move_y_fwd(0,0,1,1);

move_y_fwd(0,4,1,5);

move_y_fwd(4,0,5,1);

move_y_fwd(4,4,5,5);

cube_show_loop(CUBES2_DELAY);

for (uint8_t i = 0; i < 2; i++)

move_y_fwd(2,0,3,1);

move_y_fwd(6,0,7,1);

move_y_fwd(2,4,3,5);

move_y_fwd(6,4,7,5);

cube_show_loop(CUBES2_DELAY);

for (uint8_t i = 0; i < 4; i++)

move_y_rev(6,2,7,3);

cube_show_loop(CUBES2_DELAY);

for (uint8_t i = 0; i < 2; i++)

Page 67: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 52

move_y_rev(4,0,5,1);

cube_show_loop(CUBES2_DELAY);

for (uint8_t i = 0; i < 6; i++)

move_z_fwd(2,4,3,5);

cube_show_loop(CUBES2_DELAY);

for (uint8_t i = 0; i < 2; i++)

move_y_rev(2,0,3,1);

cube_show_loop(CUBES2_DELAY);

for (uint8_t i = 0; i < 6; i++)

move_z_fwd(0,2,1,3);

cube_show_loop(CUBES2_DELAY);

for (uint8_t i = 0; i < 4; i++)

move_y_fwd(0,2,1,3);

cube_show_loop(CUBES2_DELAY);

for (uint8_t i = 0; i < 2; i++)

move_x_fwd(2,4,3,5);

cube_show_loop(CUBES2_DELAY);

cube_show_loop(CUBES2_DELAY*10);

/* cubemoving 4x4 */

void cubes_4( void )

cube_clear();

for (uint8_t layer = 0; layer <= 3; layer++)

cube[layer][0] = 0b00001111;

cube[layer][1] = 0b00001111;

cube[layer][2] = 0b00001111;

cube[layer][3] = 0b00001111;

for (uint8_t layer = 4; layer <= 7; layer++)

cube[layer][4] = 0b11111111;

cube[layer][5] = 0b11111111;

cube[layer][6] = 0b11111111;

cube[layer][7] = 0b11111111;

Page 68: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 53

cube_show_loop(CUBES4_DELAY);

for (uint8_t fourtimes = 0; fourtimes <= 3; fourtimes++)

move_y_rev(4,0,7,3);

cube_show_loop(CUBES4_DELAY);

for (uint8_t fourtimes = 0; fourtimes <= 3; fourtimes++)

move_z_fwd(0,0,3,3);

cube_show_loop(CUBES4_DELAY);

for (uint8_t fourtimes = 0; fourtimes <= 3; fourtimes++)

move_y_fwd(0,4,3,7);

cube_show_loop(CUBES4_DELAY);

for (uint8_t fourtimes = 0; fourtimes <= 3; fourtimes++)

move_y_rev(4,4,7,7);

cube_show_loop(CUBES4_DELAY);

for (uint8_t fourtimes = 0; fourtimes <= 3; fourtimes++)

move_x_rev(0,0,3,3);

cube_show_loop(CUBES4_DELAY);

for (uint8_t fourtimes = 0; fourtimes <= 3; fourtimes++)

move_z_rev(4,0,7,3);

cube_show_loop(CUBES4_DELAY);

for (uint8_t fourtimes = 0; fourtimes <= 3; fourtimes++)

move_z_fwd(4,0,7,3);

cube_show_loop(CUBES4_DELAY);

for (uint8_t fourtimes = 0; fourtimes <= 3; fourtimes++)

move_y_fwd(4,4,7,7);

cube_show_loop(CUBES4_DELAY);

for (uint8_t fourtimes = 0; fourtimes <= 3; fourtimes++)

move_x_fwd(0,0,3,3);

cube_show_loop(CUBES4_DELAY);

for (uint8_t fourtimes = 0; fourtimes <= 3; fourtimes++)

move_y_fwd(4,0,7,3);

cube_show_loop(CUBES4_DELAY);

for (uint8_t fourtimes = 0; fourtimes <= 3; fourtimes++)

move_y_rev(0,4,3,7);

cube_show_loop(CUBES4_DELAY);

Page 69: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 54

for (uint8_t fourtimes = 0; fourtimes <= 3; fourtimes++)

move_z_rev(0,0,3,3);

cube_show_loop(CUBES4_DELAY);

/* shrinking outline */

void outline_shrink( void )

cube_clear();

for (uint8_t i = 1; i < 7; i++ )

cube[i][0] = 0b10000001;

cube[i][7] = 0b10000001;

for (uint8_t i = 1; i < 7; i++)

cube[0][i] = 0b10000001;

cube[7][i] = 0b10000001;

cube[0][0] = 0xFF;

cube[7][0] = 0xFF;

cube[0][7] = 0xFF;

cube[7][7] = 0xFF;

cube_show_loop(OUT_SHRINK_DELAY);

for (uint8_t i = 2; i < 6; i++ )

cube[i][1] = 0b01000010;

cube[i][6] = 0b01000010;

for (uint8_t i = 2; i < 6; i++)

cube[1][i] = 0b01000010;

cube[6][i] = 0b01000010;

cube[1][1] = 0b01111110;

cube[6][1] = 0b01111110;

cube[1][6] = 0b01111110;

cube[6][6] = 0b01111110;

cube_show_loop(OUT_SHRINK_DELAY);

for (uint8_t i = 3; i < 5; i++ )

cube[i][2] = 0b00100100;

cube[i][5] = 0b00100100;

for (uint8_t i = 3; i < 5; i++)

cube[2][i] = 0b00100100;

cube[5][i] = 0b00100100;

Page 70: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 55

cube[2][2] = 0b00111100;

cube[5][2] = 0b00111100;

cube[2][5] = 0b00111100;

cube[5][5] = 0b00111100;

cube_show_loop(OUT_SHRINK_DELAY);

cube[3][3] = 0b00011000;

cube[4][3] = 0b00011000;

cube[3][4] = 0b00011000;

cube[4][4] = 0b00011000;

cube_show_loop(10*OUT_SHRINK_DELAY);

void cube_explosion( void )

uint8_t led_state = 0b00011000;

for (uint8_t i = 0; i <= 4; i++)

for (uint8_t j = 3; j <= (i+3); j++)

for (uint8_t k = 3; k <= (i+3); k++)

cube[j][7-k] = led_state;

cube[j][k] = led_state;

cube[7-j][7-k] = led_state;

cube[7-j][k] = led_state;

cube_show_loop(EXPLOSION_DELAY*(2*i+1));

led_state |= (1 << (3-i)) | (1 << (4+i));

cube_show_loop(EXPLOSION_DELAY);

for (uint8_t i = 0; i <= 4; i++)

led_state &= ~((1 << (3-i)) | (1 << (4+i)));

for (uint8_t j = 3; j <= (i+3); j++)

for (uint8_t k = 3; k <= (i+3); k++)

cube[j][7-k] = led_state;

cube[j][k] = led_state;

cube[7-j][7-k] = led_state;

cube[7-j][k] = led_state;

cube_show_loop(EXPLOSION_DELAY*(2*i+1));

cube_show_loop(EXPLOSION_DELAY);

Page 71: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 56

/* wipe */

void cube_wipe( void )

cube_test_y();

cube_show_loop(SWIPE_DELAY);

for (uint8_t layer = 0; layer < 7; layer++)

for (uint8_t i = 0; i < 8; i++)

cube[layer][i] = 0;

cube[layer+1][i] = 0xFF;

cube_show_loop(SWIPE_DELAY);

for (uint8_t layer = 0; layer < 7; layer++)

move_y_rev(0,0,7,7);

cube_show_loop(SWIPE_DELAY);

void cube_string_belt( char *string )

char cube_belt[25];

for (uint8_t i = 0; i < 25; i++) cube_belt[i] = 0;

string++;

string++;

while(*string)

set_char_to_belt(*string, cube_belt);

for (uint8_t i = 0; i < 6; i++)

show_belt(cube_belt);

move_belt_left(cube_belt);

string++;

/* move the rest out */

for (uint8_t i = 0; i < 18; i++)

show_belt(cube_belt);

move_belt_left(cube_belt);

void move_belt_left( char *belt )

for (uint8_t i = 25; i > 1; i--)

Page 72: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 57

belt[i-1] = belt[i-2];

belt[0] = 0;

void set_char_to_belt( char character, char *belt )

cube_clear();

cli();

PORTC = 0x00;

cube_char(character, 1);

for (uint8_t layer = 0; layer < 8; layer++)

for (uint8_t i = 1; i < 6; i++)

if (cube[layer][i] & 0x01)

belt[5-i] |= (1 << layer);

cube_clear();

sei();

void show_belt( char *belt )

cube_clear();

/* right side */

for (uint8_t i = 5; i <= 11; i++)

for (uint8_t j = 0; j < 8; j++)

if (belt[i] & (1 << j))

cube[j][7] |= (1 << (12-i));

/* front side */

for (uint8_t i = 12; i <= 17; i++)

for (uint8_t j = 0; j < 8; j++)

if (belt[i] & (1 << j))

cube[j][18-i] |= (1 << 0);

/* left side */

for (uint8_t i = 18; i <= 24; i++)

for (uint8_t j = 0; j < 8; j++)

if (belt[i] & (1 << j))

cube[j][0] |= (1 << (i-17));

cube_show_loop(SHOW_BELT_DELAY);

Page 73: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 58

/* 2 fixed chars rotating */

void cube_fixed_string( void )

cube_clear();

_delay_ms(600);

cube_clear();

_delay_ms(600);

cube_char('3', 2);

_delay_ms(600);

rotate_90_deg();

_delay_ms(600);

rotate_90_deg();

_delay_ms(600);

cube_char('d', 2);

_delay_ms(600);

rotate_90_deg();

_delay_ms(600);

rotate_90_auto(8);

_delay_ms(600);

/* back to front moving */

void cube_string_to_front( char *string )

while(*string)

_delay_ms(200);

for (uint8_t i = 8; i > 0; i--)

_delay_ms(200);

cube_clear();

_delay_ms(200);

cube_char(*string, (1 << (i-1)));

_delay_ms(300);

cube_show_loop(3);

_delay_ms(300);

string++;

_delay_ms(300);

void cube_string( char *string )

Page 74: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 59

while(*string)

cube_clear();

cli();

PORTC = 0x00;

cube_char(*string, 16);

string++;

rotate_90_deg();

rotate_90_deg();

rotate_90_deg();

move_x_rev(1,0,6,7);

move_x_rev(1,0,6,7);

move_x_rev(1,0,6,7);

sei();

cube_show_loop(CUBE_STRING_DELAY);

move_x_fwd(1,0,6,7);

cube_show_loop(CUBE_STRING_DELAY);

move_x_fwd(1,0,6,7);

cube_show_loop(CUBE_STRING_DELAY);

move_x_fwd(1,0,6,7);

cube_show_loop(CUBE_STRING_DELAY);

rotate_90_auto(1);

move_z_rev(0,0,7,7);

cube_show_loop(CUBE_STRING_DELAY);

move_z_rev(0,0,7,7);

cube_show_loop(CUBE_STRING_DELAY);

move_z_rev(0,0,7,7);

cube_show_loop(CUBE_STRING_DELAY);

move_z_rev(0,0,7,7);

cube_show_loop(CUBE_STRING_DELAY);

cube_flash(5);

cube_explosion();

cube_explosion();

cube_explosion();

void cube_outline( void )

cube_clear();

cube_show_loop(OUTLINE_DELAY);

for (uint8_t i = 0; i < 8; i++)

cube[0][0] |= (1 << i);

cube[i][0] |= 1;

cube[0][i] |= 1;

cube_show_loop(OUTLINE_DELAY);

Page 75: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 60

for (uint8_t i = 1; i < 8; i++)

cube[7][0] |= (1 << i);

cube[7][i] |= 1;

cube[i][0] |= 128;

cube[0][i] |= 128;

cube[0][7] |= (1 << i);

cube[i][7] |= 1;

cube_show_loop(OUTLINE_DELAY);

for (uint8_t i = 1; i < 8; i++)

cube[7][i] |= 128;

cube[7][7] |= (1 << i);

cube[i][7] |= 128;

cube_show_loop(OUTLINE_DELAY);

cube_show_loop(20);

/* shrink */

cube_clear();

cube[1][1] = 0b01111110;

cube[1][6] = 0b01111110;

cube[6][1] = 0b01111110;

cube[6][6] = 0b01111110;

for (uint8_t i=2; i< 6; i++)

cube[1][i] = 0b01000010;

cube[6][i] = 0b01000010;

cube[i][1] = 0b01000010;

cube[i][6] = 0b01000010;

cube_show_loop(30);

rotate_90_auto( 8 );

void cube_stars( void )

for (uint8_t j = 1; j < 30; j++)

for (uint8_t loops = 0; loops < 18; loops++)

cube_clear();

for (uint8_t i = 0; i< j; i++)

uint8_t randx = (uint8_t)rand()%8;

uint8_t randy = (uint8_t)rand()%8;

uint8_t randz = (uint8_t)rand()%8;

cube[randy][randx] = (1 << randz);

// cube[randy][randx] &= ~(1 << randz);

Page 76: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 61

cube_show_loop(STARS_DELAY);

void cube_waves( void )

cube_clear();

for (uint8_t i = 0; i < 10; i++)

move_x_rev(0,0,7,7);

_delay_ms(300);

cube[3][7] |= WAVES_DEPTH;

_delay_ms(300);

cube_show_loop(WAVES_DELAY);

_delay_ms(300);

move_x_rev(0,0,7,7);

_delay_ms(300);

cube[2][7] |= WAVES_DEPTH;

_delay_ms(300);

cube_show_loop(WAVES_DELAY);

_delay_ms(300);

move_x_rev(0,0,7,7);

_delay_ms(300);

cube[1][7] |= WAVES_DEPTH;

_delay_ms(300);

cube_show_loop(WAVES_DELAY);

_delay_ms(300);

move_x_rev(0,0,7,7);

_delay_ms(300);

cube[0][7] |= WAVES_DEPTH;

_delay_ms(300);

cube_show_loop(WAVES_DELAY);

_delay_ms(300);

move_x_rev(0,0,7,7);

_delay_ms(300);

cube[0][7] |= WAVES_DEPTH;

_delay_ms(300);

cube_show_loop(WAVES_DELAY);

_delay_ms(300);

move_x_rev(0,0,7,7);

_delay_ms(300);

cube[1][7] |= WAVES_DEPTH;

_delay_ms(300);

cube_show_loop(WAVES_DELAY);

_delay_ms(300);

Page 77: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 62

move_x_rev(0,0,7,7);

_delay_ms(300);

cube[2][7] |= WAVES_DEPTH;

_delay_ms(300);

cube_show_loop(WAVES_DELAY);

_delay_ms(300);

move_x_rev(0,0,7,7);

_delay_ms(300);

cube[3][7] |= WAVES_DEPTH;

_delay_ms(300);

cube_show_loop(WAVES_DELAY);

_delay_ms(00);

move_x_rev(0,0,7,7);

_delay_ms(300);

cube[4][7] |= WAVES_DEPTH;

_delay_ms(300);

cube_show_loop(WAVES_DELAY);

_delay_ms(300);

move_x_rev(0,0,7,7);

_delay_ms(300);

cube[5][7] |= WAVES_DEPTH;

_delay_ms(300);

cube_show_loop(WAVES_DELAY);

_delay_ms(300);

move_x_rev(0,0,7,7);

_delay_ms(300);

cube[6][7] |= WAVES_DEPTH;

_delay_ms(300);

cube_show_loop(WAVES_DELAY);

_delay_ms(300);

move_x_rev(0,0,7,7);

_delay_ms(300);

cube[7][7] |= WAVES_DEPTH;

_delay_ms(300);

cube_show_loop(WAVES_DELAY);

_delay_ms(300);

move_x_rev(0,0,7,7);

_delay_ms(300);

cube[7][7] |= WAVES_DEPTH;

_delay_ms(300);

cube_show_loop(WAVES_DELAY);

_delay_ms(300);

move_x_rev(0,0,7,7);

_delay_ms(300);

cube[6][7] |= WAVES_DEPTH;

_delay_ms(300);

Page 78: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 63

cube_show_loop(WAVES_DELAY);

_delay_ms(300);

move_x_rev(0,0,7,7);

_delay_ms(300);

cube[5][7] |= WAVES_DEPTH;

_delay_ms(300);

cube_show_loop(WAVES_DELAY);

_delay_ms(300);

move_x_rev(0,0,7,7);

_delay_ms(300);

cube[4][7] |= WAVES_DEPTH;

_delay_ms(300);

cube_show_loop(WAVES_DELAY);

_delay_ms(300);

void cube_sonic( void )

cli();

for (uint8_t i = 0; i < 10; i++)

cube_clear();

cube_show_loop(20);

uint8_t mode = rand()%5;

uint8_t sonic_layers = (rand()%8)+1;

if (mode <= 3)

cube_clear();

for (uint8_t layer = 0; layer < sonic_layers; layer++)

cube[layer][0] = 0b10000000;

for (uint8_t deg = 0; deg < mode; deg++)

rotate_90_deg();

cube_show_loop_wo_int(SONIC_DELAY);

cube_clear();

for (uint8_t layer = 0; layer < sonic_layers; layer++)

cube[layer][0] = 0b01000000;

cube[layer][1] = 0b10000000;

for (uint8_t deg = 0; deg < mode; deg++)

rotate_90_deg();

cube_show_loop_wo_int(SONIC_DELAY);

Page 79: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 64

cube_clear();

for (uint8_t layer = 0; layer < sonic_layers; layer++)

cube[layer][0] = 0b00100000;

cube[layer][1] = 0b00100000;

cube[layer][2] = 0b11000000;

for (uint8_t deg = 0; deg < mode; deg++)

rotate_90_deg();

cube_show_loop_wo_int(SONIC_DELAY);

cube_clear();

for (uint8_t layer = 0; layer < sonic_layers; layer++)

cube[layer][0] = 0b00010000;

cube[layer][1] = 0b00010000;

cube[layer][2] = 0b00100000;

cube[layer][3] = 0b11000000;

for (uint8_t deg = 0; deg < mode; deg++)

rotate_90_deg();

cube_show_loop_wo_int(SONIC_DELAY);

cube_clear();

for (uint8_t layer = 0; layer < sonic_layers; layer++)

cube[layer][0] = 0b00001000;

cube[layer][1] = 0b00001000;

cube[layer][2] = 0b00010000;

cube[layer][3] = 0b00110000;

cube[layer][4] = 0b11000000;

for (uint8_t deg = 0; deg < mode; deg++)

rotate_90_deg();

cube_show_loop_wo_int(SONIC_DELAY);

cube_clear();

for (uint8_t layer = 0; layer < sonic_layers; layer++)

cube[layer][0] = 0b00000100;

cube[layer][1] = 0b00000100;

cube[layer][2] = 0b00000100;

cube[layer][3] = 0b00001000;

cube[layer][4] = 0b00010000;

cube[layer][5] = 0b11100000;

for (uint8_t deg = 0; deg < mode; deg++)

Page 80: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 65

rotate_90_deg();

cube_show_loop_wo_int(SONIC_DELAY);

cube_clear();

for (uint8_t layer = 0; layer < sonic_layers; layer++)

cube[layer][0] = 0b00000010;

cube[layer][1] = 0b00000010;

cube[layer][2] = 0b00000010;

cube[layer][3] = 0b00000100;

cube[layer][4] = 0b00001000;

cube[layer][5] = 0b00010000;

cube[layer][6] = 0b11100000;

for (uint8_t deg = 0; deg < mode; deg++)

rotate_90_deg();

cube_show_loop_wo_int(SONIC_DELAY);

cube_clear();

for (uint8_t layer = 0; layer < sonic_layers; layer++)

cube[layer][0] = 0b00000001;

cube[layer][1] = 0b00000001;

cube[layer][2] = 0b00000001;

cube[layer][3] = 0b00000010;

cube[layer][4] = 0b00000010;

cube[layer][5] = 0b00000100;

cube[layer][6] = 0b00011000;

cube[layer][7] = 0b11100000;

for (uint8_t deg = 0; deg < mode; deg++)

rotate_90_deg();

cube_show_loop_wo_int(SONIC_DELAY);

cube_clear();

for (uint8_t layer = 0; layer < sonic_layers; layer++)

cube[layer][4] = 0b00000001;

cube[layer][5] = 0b00000010;

cube[layer][6] = 0b00000100;

cube[layer][7] = 0b00001000;

for (uint8_t deg = 0; deg < mode; deg++)

rotate_90_deg();

cube_show_loop_wo_int(SONIC_DELAY);

Page 81: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 66

cube_clear();

for (uint8_t layer = 0; layer < sonic_layers; layer++)

cube[layer][6] = 0b00000001;

cube[layer][7] = 0b00000010;

for (uint8_t deg = 0; deg < mode; deg++)

rotate_90_deg();

cube_show_loop_wo_int(SONIC_DELAY);

cube_clear();

for (uint8_t layer = 0; layer < sonic_layers; layer++)

cube[layer][7] = 0b00000001;

for (uint8_t deg = 0; deg < mode; deg++)

rotate_90_deg();

cube_show_loop_wo_int(SONIC_DELAY);

else

/* center wave */

cube_clear();

for (uint8_t layer = 0; layer < sonic_layers; layer++)

cube[layer][3] = 0b00011000;

cube[layer][4] = 0b00011000;

cube_show_loop_wo_int(SONIC_DELAY);

cube_clear();

for (uint8_t layer = 0; layer < sonic_layers; layer++)

cube[layer][2] = 0b00011000;

cube[layer][3] = 0b00100100;

cube[layer][4] = 0b00100100;

cube[layer][5] = 0b00011000;

cube_show_loop_wo_int(SONIC_DELAY);

cube_clear();

for (uint8_t layer = 0; layer < sonic_layers; layer++)

cube[layer][1] = 0b00011000;

cube[layer][2] = 0b00100100;

cube[layer][3] = 0b01000010;

cube[layer][4] = 0b01000010;

cube[layer][5] = 0b00100100;

cube[layer][6] = 0b00011000;

cube_show_loop_wo_int(SONIC_DELAY);

cube_clear();

Page 82: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 67

for (uint8_t layer = 0; layer < sonic_layers; layer++)

cube[layer][0] = 0b00011000;

cube[layer][1] = 0b01100110;

cube[layer][2] = 0b01000010;

cube[layer][3] = 0b10000001;

cube[layer][4] = 0b10000001;

cube[layer][5] = 0b01000010;

cube[layer][6] = 0b01100110;

cube[layer][7] = 0b00011000;

cube_show_loop_wo_int(SONIC_DELAY);

cube_clear();

for (uint8_t layer = 0; layer < sonic_layers; layer++)

cube[layer][0] = 0b01000010;

cube[layer][1] = 0b10000001;

cube[layer][6] = 0b10000001;

cube[layer][7] = 0b01000010;

cube_show_loop_wo_int(SONIC_DELAY);

cube_clear();

for (uint8_t layer = 0; layer < sonic_layers; layer++)

cube[layer][0] = 0b10000001;

cube[layer][7] = 0b10000001;

cube_show_loop_wo_int(SONIC_DELAY);

sei();

void cube_diamond( void )

cube_clear();

for ( uint8_t i = 0; i < 3; i++ )

cube[4][2] = 0b01111110;

void cube_block_wipe( void )

for (uint8_t i = 0; i < 8; i++)

move_x_fwd(0,0,7,7);

for(uint8_t layer = 0; layer < 8; layer++)

cube[layer][0] |= 0xFF;

Page 83: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 68

cube_show_loop(BLOCK_WIPE_DELAY);

_delay_ms(100);

cube_show_loop(BLOCK_WIPE_DELAY);

_delay_ms(100);

for (uint8_t i = 8; i != 0; i--)

for(uint8_t layer = 0; layer < 8; layer++)

cube[layer][i-1] = 0x00;

cube_show_loop(BLOCK_WIPE_DELAY);

_delay_ms(100);

void cube_belt_wipe( void )

for (uint8_t layer = 8; layer != 0; layer--)

cube[layer-1][0] |= 0xFF;

cube[layer-1][7] |= 0xFF;

for (uint8_t i = 1; i < 7; i++) cube[layer-1][i] |= 0b10000001;

cube_show_loop(BELT_WIPE_DELAY);

for (uint8_t layer = 8; layer != 0; layer--)

for (uint8_t i = 0; i < 8; i++) cube[layer-1][i] = 0x00;

cube_show_loop(BELT_WIPE_DELAY);

void cube_flash( uint8_t cycle )

for (; cycle > 0; cycle--)

cli();

PORTC = 0x00;

_delay_ms(BLINK_DELAY*5);

_delay_ms(BLINK_DELAY*5);

_delay_ms(BLINK_DELAY*5);

_delay_ms(BLINK_DELAY*5);

_delay_ms(BLINK_DELAY*5);

_delay_ms(BLINK_DELAY*5);

sei();

_delay_ms(BLINK_DELAY*5);

_delay_ms(BLINK_DELAY*5);

_delay_ms(BLINK_DELAY*5);

_delay_ms(BLINK_DELAY*5);

Page 84: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 69

_delay_ms(BLINK_DELAY*5);

_delay_ms(BLINK_DELAY*5);

TRANSLATION

#include <stdlib.h>

#include <avr/io.h>

#include <inttypes.h>

#include <util/delay.h>

#include <math.h>

#include "ab.h"

#include "rotation.h"

#include "ledcube.h"

#include "translation.h"

void move_z_fwd (uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2 )

for (; x1 <= x2; x1++)

for (uint8_t i = y1; i <= y2; i++)

cube[x1][i] = (cube[x1][i] << 1);

void move_z_rev ( uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2 )

for (; x1 <= x2; x1++)

for (uint8_t i= y1; i <= y2; i++)

cube[x1][i] = (cube[x1][i] >> 1);

void move_y_fwd( uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2 )

Page 85: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 70

for (uint8_t i = 7; i > 0; i--)

for (uint8_t j = x1; j <= x2; j++)

for (uint8_t k = y1; k <= y2; k++)

if ((cube[i-1][j] & (1 << k)))

cube[i][j] |= (1 << k);

cube[i-1][j] &= ~(1 << k);

else

cube[i-1][j] &= ~(1 << k);

void move_y_rev( uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2 )

for (uint8_t i = 1; i < 8; i++)

for (uint8_t j = x1; j <= x2; j++)

for (uint8_t k = y1; k <= y2; k++)

if ((cube[i][j] & (1 << k)))

cube[i-1][j] |= (1 << k);

cube[i][j] &= ~(1 << k);

else

cube[i-1][j] &= ~(1 << k);

void move_x_fwd( uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2 )

for (uint8_t layer = y1; layer <= y2; layer++)

for (uint8_t j = 7; j > 0; j--)

for (uint8_t k = x1; k <= x2; k++)

if ((cube[layer][j-1] & (1 << k)))

cube[layer][j] |= (1 << k);

cube[layer][j-1] &= ~(1 << k);

else

Page 86: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 71

cube[layer][j] &= ~(1 << k);

void move_x_rev( uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2 )

for (uint8_t layer = y1; layer <= y2; layer++)

for (uint8_t j = 0; j < 7; j++)

for (uint8_t k = x1; k <= x2; k++)

if ((cube[layer][j+1] & (1 << k)))

cube[layer][j] |= (1 << k);

cube[layer][j+1] &= ~(1 << k);

else

cube[layer][j] &= ~(1 << k);

ROTATION

#include <stdlib.h>

#include <avr/io.h>

#include <inttypes.h>

#include <util/delay.h>

#include <math.h>

#include "ledcube.h"

#include "animations.h"

#include "rotation.h"

void rotate_90_auto ( uint8_t cycle )

for (uint8_t loopcnt = 0; loopcnt < cycle; loopcnt++) _delay_ms(30);

uint8_t cube_org[8][8];

_delay_ms(30);

Page 87: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 72

for (uint8_t i = 0; i < 8; i++)

_delay_ms(30);

for (uint8_t j = 0; j < 8; j++)

_delay_ms(30);

cube_org[i][j] = cube[i][j];

_delay_ms(30);

cube_clear();

void rotate_90_deg ( void )

uint8_t cube_org[8][8];

for (uint8_t i = 0; i < 8; i++)

for (uint8_t j = 0; j < 8; j++)

cube_org[i][j] = cube[i][j];

cube_clear();

for ( uint8_t layer = 0; layer < 8; layer++ )

for ( uint8_t x = 0; x < 8; x++)

for ( uint8_t y = 0; y < 8; y++)

if ( cube_org[layer][y] & (0x80 >> x))

cube[layer][(7-x)] |= (1 << (7-y));

LED CUBE

#include "ledcube.h"

#include <stdlib.h>

#include <avr/io.h>

#include <inttypes.h>

#include <util/delay.h>

#include <math.h>

#include <avr/interrupt.h>

Page 88: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 73

#include "ab.h"

#include "rotation.h"

void cube_show_init( void )

TCCR0 |= (1 << CS02) | (0 << CS00);

TIMSK |= (1 << TOIE0);

ISR( TIMER0_OVF_vect )

TCNT0 = 0xB0;

PORTC = 0x0;

static uint8_t cube_show_layer = 0;

asm volatile("nop");

asm volatile("nop");

asm volatile("nop");

asm volatile("nop");

asm volatile("nop");

for(uint8_t j = 0; j < 8; j++)

PORTD = cube[cube_show_layer][j];

asm volatile("nop");

PORTA |= (1 << j);

asm volatile("nop");

PORTA = 0;

asm volatile("nop");

PORTC |= (1 << cube_show_layer);

asm volatile("nop");

if (cube_show_layer < 7)

cube_show_layer++;

else

cube_show_layer = 0;

void cube_clear ( void )

for (uint8_t i = 0; i < 8; i++)

for (uint8_t j = 0; j < 8; j++)

cube[i][j] = 0;

Page 89: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 74

void cube_clear_layer(uint8_t layer)

for (uint8_t j = 0; j < 8; j++)

cube[layer][j] = 0;

void cube_full ( void )

for (uint8_t i = 0; i < 8; i++)

for (uint8_t j = 0; j < 8; j++)

cube[i][j] = 255;

void cube_cube_3 ( void )

cube[0][0] = 7;

cube[0][1] = 7;

cube[0][2] = 7;

cube[1][0] = 7;

cube[1][1] = 7;

cube[1][2] = 7;

cube[2][0] = 7;

cube[2][1] = 7;

cube[2][2] = 7;

void cube_cube_4_line ( void )

cube[0][0] = 15;

cube[0][1] = 9;

cube[0][2] = 9;

cube[0][3] = 15;

cube[1][0] = 9;

cube[1][3] = 9;

cube[2][0] = 9;

cube[2][3] = 9;

cube[3][0] = 15;

cube[3][1] = 9;

cube[3][2] = 9;

cube[3][3] = 15;

Page 90: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 75

void cube_random( void )

for ( uint8_t i = 0; i < 8; i++ )

for ( uint8_t j= 0; j < 8; j++)

cube[i][j] = rand()%255;

void cube_test_z( void )

for (uint8_t i = 0; i < 8; i++)

for (uint8_t j = 0; j < 8; j++)

cube[i][j] = 1;

void cube_test_y( void )

for (uint8_t i = 0; i < 8; i++)

cube[0][i] = 255;

void cube_test_x( void )

for (uint8_t i = 0; i < 8; i++)

cube[i][0] = 255;

void cube_show( void )

asm volatile("nop");

for (uint8_t i = 0; i < 8; i++)

for(uint8_t j = 0; j < 8; j++)

PORTD = cube[i][j];

asm volatile("nop");

PORTA |= (1 << j);

asm volatile("nop");

PORTA = 0;

asm volatile("nop");

PORTC |= (1 << i);

Page 91: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 76

_delay_ms(1);

PORTC = 0x00;

asm volatile("nop");

asm volatile("nop");

asm volatile("nop");

asm volatile("nop");

asm volatile("nop");

void cube_show_loop( uint8_t cycle )

for (uint16_t i = 0; i < cycle*2; i++)

_delay_ms(8);

void cube_show_loop_wo_int( uint8_t cycle )

for (uint16_t i = 0; i < cycle*2; i++)

cube_show();

MAIN

#include <stdlib.h>

#include <avr/io.h>

#include <inttypes.h>

#include <util/delay.h>

#include <math.h>

#include <avr/interrupt.h>

#include "ledcube.h"

#include "animations.h"

void init(void)

PORTC = 0;

DDRC = 0xFF;

DDRA = 0xFF;

Page 92: Mini Project Report (Topic - 3D LED CUBE DISPLAY (8x8x8 Pixels))

3D LED CUBE DISPLAY (8x8x8 PIXELS)

Electronics & Communication Engineering, FISAT 77

DDRD = 0xFF;

PORTA = 0;

PORTD = 0;

cube_show_init();

_delay_ms(1);

sei();

_delay_ms(1);

int main(void)

init();

_delay_ms(100);

_delay_ms(100);

cube_clear(); /* never forget this */

while ( 1 )

cube_explosion();

cube_string_to_front("fisat");

cube_belt_wipe();

cube_fixed_string();

cube_block_wipe();

cube_2_auto();

cube_wipe();

cube_waves();

cube_explosion();

cube_stripes();

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");


Recommended