A demo code for "mbeduino" + "4x4x4 LED Cube shield". More complex (fancy) demo is available at ... \\ http://mbed.org/users/okano/programs/LED_Cube444_mbeduino_demo/\\ A class library of LED_Cube444...\\ http://mbed.org/users/okano/libraries/LED_Cube444/\\ Hardware test code...\\ http://mbed.org/users/okano/programs/mbeduino_LED_Cube444_test/\\ About the hardware : \\ http://mbed.org/users/okini3939/notebook/mbeduino/\\ http://www.galileo-7.com/?pid=20015630\\
LED_Cube444_demo.cpp@0:828a93c038cd, 2010-10-14 (annotated)
- Committer:
- okano
- Date:
- Thu Oct 14 23:57:36 2010 +0000
- Revision:
- 0:828a93c038cd
- Child:
- 1:90dd1edfce17
Very simple "main" function version demo
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
okano | 0:828a93c038cd | 1 | /** mbeduino demo code (with 4x4x4 LED Cube shield) |
okano | 0:828a93c038cd | 2 | * |
okano | 0:828a93c038cd | 3 | * This is a very simple demo code of mbeduino + 4x4x4 LED Cube shield |
okano | 0:828a93c038cd | 4 | * |
okano | 0:828a93c038cd | 5 | * mbeduino = http://mbed.org/users/okini3939/notebook/mbeduino/ (Japanese) |
okano | 0:828a93c038cd | 6 | * 4x4x4 LED Cube shield = http://www.galileo-7.com/?pid=20015630 (Japanese) |
okano | 0:828a93c038cd | 7 | * |
okano | 0:828a93c038cd | 8 | * Released under the MIT License: http://mbed.org/license/mit |
okano | 0:828a93c038cd | 9 | * |
okano | 0:828a93c038cd | 10 | * revision 0.5 15-Oct-2010 1st release |
okano | 0:828a93c038cd | 11 | */ |
okano | 0:828a93c038cd | 12 | |
okano | 0:828a93c038cd | 13 | #include "mbed.h" |
okano | 0:828a93c038cd | 14 | #include "LED_Cube444.h" |
okano | 0:828a93c038cd | 15 | |
okano | 0:828a93c038cd | 16 | LED_Cube444 cube; |
okano | 0:828a93c038cd | 17 | |
okano | 0:828a93c038cd | 18 | int main() { |
okano | 0:828a93c038cd | 19 | |
okano | 0:828a93c038cd | 20 | int v = 1; |
okano | 0:828a93c038cd | 21 | |
okano | 0:828a93c038cd | 22 | while ( 1 ) { |
okano | 0:828a93c038cd | 23 | |
okano | 0:828a93c038cd | 24 | for ( int x = 0; x < 4; x++ ) { |
okano | 0:828a93c038cd | 25 | for ( int y = 0; y < 4; y++ ) { |
okano | 0:828a93c038cd | 26 | for ( int z = 0; z < 4; z++ ) { |
okano | 0:828a93c038cd | 27 | cube.set_bit( x, y, z, v ); |
okano | 0:828a93c038cd | 28 | wait( 0.01 ); |
okano | 0:828a93c038cd | 29 | } |
okano | 0:828a93c038cd | 30 | } |
okano | 0:828a93c038cd | 31 | } |
okano | 0:828a93c038cd | 32 | |
okano | 0:828a93c038cd | 33 | v = !v; |
okano | 0:828a93c038cd | 34 | } |
okano | 0:828a93c038cd | 35 | } |