POV - Persistence of vision als Weltkugel
Schaltplan
Bauteile
| Bauteil | Menge | Einzelpreis [€] | Summe [€] |
|---|---|---|---|
| Kippschalter Ein/Ein | 1 | 0,96 | 0,96 |
| Widerstand 10KΩ | 2 | 0,03 | 0,06 |
| Kondensator 10uF | 2 | 0,04 | 0,08 |
| Kondensator 100nF | 1 | 0,04 | 0,04 |
| Kondensator 22pF | 2 | 0,06 | 0,12 |
| Spannungsregler 7805 | 1 | 0,35 | 0,35 |
| IC-Sockel, 28-polig | 1 | 0,43 | 0,43 |
| Streifenrasterplatine 50x100mm | 1 | 0,58 | 0,58 |
| Standardquarz 16 MHz | 1 | 0,16 | 0,16 |
| Atmel ATmega328 | 1 | 4,00 | 4,00 |
| Widerstand 560KΩ | 1 | 0,03 | 0,03 |
| Hohlstecker-Buchse Øi= 2,1mm | 1 | 0,23 | 0,23 |
| Reed-Kontakt | 1 | 0,39 | 0,39 |
| SMD-LED grün | 72 | 0,10 | 7,20 |
| Klinkenbuchse, 6,3mm Mono | 1 | 0,24 | 0,24 |
| Klinkenstecker, 6,3mm Mono | 1 | 0,69 | 0,69 |
| Kupferlackdraht 0,1mm | 1 | 1,55 | 1,55 |
| Magnet, Ø= 4,0mm Länge= 19mm | 1 | 0,30 | 0,30 |
| PC-Lüfter 9cm | 1 | 10,00 | 10,00 |
| 27,41 |
Platine
Bilder
Sourcecode
// Compiled with Arduino 1.01
include "Arduino.h"
include <avr/pgmspace.h>
include "world.h"
define SpinInterrupt 0
define SpinInput 2
//Define cols/rows to ports //column +
define col0 3
define col1 4
define col2 5
define col3 6
define col4 7
define col5 8
define col6 9
define col7 10
define col8 11
//row -
define row0 12
define row1 13
define row2 14
define row3 15
define row4 16
define row5 17
define row6 18
define row7 19
define LEDOrientation false
volatile unsigned long microsPerPixelColumn = 10000; volatile unsigned long microsPerPixelEight = 0; volatile unsigned long lastSpinTime = 0; volatile int column = 0; volatile int row = 0; volatile int LEDEight = 0; volatile int CurrentColumns = 0;
unsigned long inturruptDebounce = 80; bool bStop; int eightpins[9] = {col0, col1, col2, col3, col4, col5, col6, col7, col8};
int pins[72][2] = {{col0, row0},
{col0, row1},
{col0, row2},
{col0, row3},
{col0, row4},
{col0, row5},
{col0, row6},
{col0, row7},
{col1, row0},
{col1, row1},
{col1, row2},
{col1, row3},
{col1, row4},
{col1, row5},
{col1, row6},
{col1, row7},
{col2, row0},
{col2, row1},
{col2, row2},
{col2, row3},
{col2, row4},
{col2, row5},
{col2, row6},
{col2, row7},
{col3, row0},
{col3, row1},
{col3, row2},
{col3, row3},
{col3, row4},
{col3, row5},
{col3, row6},
{col3, row7},
{col4, row0},
{col4, row1},
{col4, row2},
{col4, row3},
{col4, row4},
{col4, row5},
{col4, row6},
{col4, row7},
{col5, row0},
{col5, row1},
{col5, row2},
{col5, row3},
{col5, row4},
{col5, row5},
{col5, row6},
{col5, row7},
{col6, row0},
{col6, row1},
{col6, row2},
{col6, row3},
{col6, row4},
{col6, row5},
{col6, row6},
{col6, row7},
{col7, row0},
{col7, row1},
{col7, row2},
{col7, row3},
{col7, row4},
{col7, row5},
{col7, row6},
{col7, row7},
{col8, row0},
{col8, row1},
{col8, row2},
{col8, row3},
{col8, row4},
{col8, row5},
{col8, row6},
{col8, row7}
};
void setup() {
pinMode(SpinInput, INPUT); //Reed switch
pinMode(col0, OUTPUT);
pinMode(col1, OUTPUT);
pinMode(col2, OUTPUT);
pinMode(col3, OUTPUT);
pinMode(col4, OUTPUT);
pinMode(col5, OUTPUT);
pinMode(col6, OUTPUT);
pinMode(col7, OUTPUT);
pinMode(col8, OUTPUT);
pinMode(row0, OUTPUT);
pinMode(row1, OUTPUT);
pinMode(row2, OUTPUT);
pinMode(row3, OUTPUT);
pinMode(row4, OUTPUT);
pinMode(row5, OUTPUT);
pinMode(row6, OUTPUT);
pinMode(row7, OUTPUT);
CurrentColumns = ImageColumns;
lastSpinTime = micros();
Clear();
for(int j = 0; j < ImageRows; j++)
{
Clear();
digitalWrite(pins[j][0], !LEDOrientation);
digitalWrite(pins[j][1], LEDOrientation);
delay(30);
}
attachInterrupt(SpinInterrupt, spinInterrupt, FALLING);
}
bool inInterrupt = false; unsigned long spinTime = 0; void spinInterrupt() {
if(lastSpinTime == 0)
{
lastSpinTime = micros();
return;
}
if(!inInterrupt && micros() - lastSpinTime > inturruptDebounce)
{
inInterrupt = true;
unsigned long newSpinTime = micros() - lastSpinTime;
if(spinTime != 0 && (newSpinTime > spinTime*2 || newSpinTime < spinTime/2))
{
inInterrupt = false;
return;
}
spinTime = newSpinTime;
microsPerPixelColumn = spinTime / CurrentColumns;
microsPerPixelEight = microsPerPixelColumn / LEDEights;
lastSpinTime = micros();
inInterrupt = false;
}
}
void loop() {
for(column = 0; column < CurrentColumns; column++)
{
for(LEDEight = 0; LEDEight < LEDEights ; LEDEight++)
{
DrawLEDGroupsAtOnce(LEDEight, column);
}
}
}
void DrawLEDGroupsAtOnce(int eight, int column) {
prog_uint8_t imageEights = pgm_read_byte(&(Image[column][eight]));
PORTB = (PORTB | B00110000) & ((imageEights << 4) | B11001111);
PORTC = (PORTC | B00111111) & ((imageEights >> 2) | B11000000);
digitalWrite(eightpins[eight], !LEDOrientation);
if (microsPerPixelEight > 20)
delayMicroseconds(microsPerPixelEight - 17);
digitalWrite(eightpins[eight], LEDOrientation);
}
void Clear() {
for(int j = 0; j < ImageRows; j++)
{
digitalWrite(pins[j][0], LEDOrientation);
digitalWrite(pins[j][1], !LEDOrientation);
}
}
world.h
define ImageColumns 131
define ImageRows 72
define LEDEights 9
prog_uint8_t Image[ImageColumns][LEDEights] PROGMEM = {
{
B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B10110111, B10111001, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B10000111, B10111000, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B00000001, B11011000, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B00000001, B11100000, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B00000001, B11100000, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B00000001, B11111100, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B00000001, B11111110, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B00000011, B11111110, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B00000011, B11111000, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B00000011, B11111000, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B00000111, B11111000, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B00000111, B11110000, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B00000111, B11100000, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B00000011, B00000000, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B00000001, B00000000, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B00011111, B00000011, B00000000, B11111100, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B00001011, B00000110, B00000000, B10000000, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B00011001, B00000111, B00000000, B00000000, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B00110000, B00000010, B00000000, B00000000, B11111100, B11111111, B11111111, B11111111, B11111111 }
, {
B00100001, B00000000, B00000000, B00000000, B11110000, B11111111, B11111111, B11111111, B11111111 }
, {
B01100011, B00000000, B00000000, B00000000, B11100000, B11111111, B11111111, B11111111, B11111111 }
, {
B01110001, B00000000, B00000000, B00000000, B11110000, B11111111, B11111111, B11111111, B11111111 }
, {
B00110011, B00000000, B00000000, B00000000, B11000000, B11111111, B11111111, B11111111, B11111111 }
, {
B11110011, B00000001, B00000000, B00000000, B10000000, B11111111, B11111111, B11111111, B11111111 }
, {
B00010111, B00001111, B00000000, B00000000, B00000000, B11111111, B11111111, B11111111, B11111111 }
, {
B00110000, B00001111, B00000000, B00000000, B00111000, B11111111, B11111111, B11111111, B11111111 }
, {
B10011000, B00001001, B00000100, B00000000, B01111100, B11111111, B11111111, B11111111, B11111111 }
, {
B01110111, B00000110, B00001110, B00000000, B01111000, B11111111, B11111111, B11111111, B11111111 }
, {
B00111111, B10000110, B00011111, B00000000, B00011100, B11111110, B11111111, B11111111, B11111111 }
, {
B00100111, B10011100, B00011111, B00000000, B11111100, B11111100, B11111111, B11111111, B11111111 }
, {
B00000111, B01001000, B00111110, B00000000, B11011000, B11111011, B11111111, B11111111, B11111111 }
, {
B01110111, B01111100, B11111110, B00000000, B11010010, B01111011, B11111111, B11111111, B11111111 }
, {
B01111111, B11111000, B00000000, B00000000, B11110110, B00000011, B11111100, B11111111, B11111111 }
, {
B11111111, B00110000, B00000000, B11000000, B10111111, B00000001, B11111000, B11111111, B11111111 }
, {
B11111111, B00010001, B00000001, B11100000, B11111111, B00000001, B11110000, B00000111, B11111000 }
, {
B11111111, B00000001, B00000110, B11110000, B11111111, B00000001, B00000000, B00000000, B11010100 }
, {
B11111111, B00001111, B00000110, B11110010, B11111111, B00000001, B00000000, B10000000, B11011110 }
, {
B11111111, B11001111, B00000111, B11111010, B11111111, B00000001, B00000000, B11100000, B11111111 }
, {
B11111111, B11111111, B00011111, B11111011, B11111111, B00000011, B00000000, B11100000, B11111111 }
, {
B11111111, B11111111, B00111111, B11111100, B11111111, B00000111, B00000000, B11110000, B11111111 }
, {
B11111111, B11111111, B11111111, B11111001, B11111111, B00000111, B00000000, B11111000, B11111111 }
, {
B11111111, B11111111, B11111111, B11111111, B11111111, B00001111, B00000000, B11111100, B11111111 }
, {
B11111111, B11111111, B11111111, B11111111, B11111111, B00111111, B00000000, B11111111, B11111111 }
, {
B11111111, B11111111, B11111111, B11111111, B11111111, B00111111, B11000000, B11111111, B11111111 }
, {
B11111111, B11111111, B11111111, B11111111, B11111111, B00111111, B11000000, B11111111, B11111111 }
, {
B11111111, B11111111, B11111111, B11111111, B11111111, B00111111, B11000000, B11111111, B11111111 }
, {
B11111111, B11111111, B11111111, B11111111, B11111111, B01111111, B11111100, B11111111, B11111111 }
, {
B11111111, B11111111, B11111111, B11111111, B11111111, B01111111, B11111110, B11111111, B11111111 }
, {
B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B00111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B00011111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B10011111, B11111111, B11111111, B00011111, B11111110, B11111111, B11111111, B11111111 }
, {
B11111111, B10111111, B11111111, B11111111, B00000111, B11111100, B11111111, B11111111, B11111111 }
, {
B11111111, B11111111, B11111111, B11111111, B00000111, B11110000, B11111111, B11111111, B11111111 }
, {
B11111111, B11111111, B00101111, B10001111, B00000000, B11110000, B11111111, B11111111, B11111111 }
, {
B11111111, B11111111, B00000111, B10001110, B00000000, B11110000, B11111111, B11111111, B11111111 }
, {
B11111111, B11111111, B00011111, B10001110, B00000000, B11110000, B11111111, B11111111, B11111111 }
, {
B11111111, B11111111, B00111111, B01000001, B00000000, B11110000, B11111111, B11111111, B11111111 }
, {
B11111111, B11111111, B11111111, B01100000, B00000000, B11110000, B11111111, B11111111, B11111111 }
, {
B11111111, B11111111, B11110000, B01110000, B00000000, B11110000, B11111111, B11111111, B11111111 }
, {
B11111111, B11111111, B01110000, B01110000, B00000000, B11110000, B11111111, B11111111, B11111111 }
, {
B11111111, B00111111, B00100000, B11100000, B00000001, B00000000, B11110111, B11111111, B11111111 }
, {
B11111111, B00000111, B01100000, B11111000, B00000001, B00000000, B10000000, B11111111, B11111111 }
, {
B11111111, B00000011, B00111000, B11100000, B00000011, B00000000, B00000000, B11111110, B11111111 }
, {
B11111111, B00000001, B00011011, B11100000, B00000001, B00000000, B00000000, B11111000, B11111111 }
, {
B11111111, B11000001, B00001000, B11000000, B00000001, B00000000, B00000000, B11111000, B11111111 }
, {
B11111111, B00000001, B00000000, B11000000, B00000011, B00000000, B00000000, B11111100, B11111111 }
, {
B11111111, B00000001, B00000100, B10010000, B00000011, B00000000, B00000000, B11111100, B11111111 }
, {
B11111111, B00000011, B00000010, B10011000, B00000011, B00000000, B00000000, B11111110, B11111111 }
, {
B11111111, B01100111, B00000000, B00011000, B00001111, B00000000, B10000000, B11111111, B11111111 }
, {
B11111111, B11001111, B00000000, B00011000, B00010000, B00000000, B11110000, B11111111, B11111111 }
, {
B11111111, B00001111, B00000000, B00010000, B11000000, B10000000, B11110000, B11111111, B11111111 }
, {
B11111111, B00111111, B00000000, B00000000, B10000000, B11000001, B11111111, B11111111, B11111111 }
, {
B11111111, B00011111, B00000000, B00000000, B00000000, B11100000, B10000111, B11111111, B11111111 }
, {
B11111111, B00001111, B00000000, B00000000, B00000100, B11110000, B11100011, B11111111, B11111111 }
, {
B11111111, B00001111, B00000000, B00000000, B00001000, B11111011, B11111111, B11111111, B11111111 }
, {
B00011111, B00001110, B00000000, B00000000, B10000000, B11111111, B11111111, B11111111, B11111111 }
, {
B10000111, B00001100, B00000000, B00000000, B10000000, B11111111, B11111111, B11111111, B11111111 }
, {
B11100111, B00000111, B00000000, B00000000, B11100000, B11111111, B11111111, B11111111, B11111111 }
, {
B11110011, B00000011, B00000000, B00000000, B11110000, B11111111, B11111111, B11111111, B11111111 }
, {
B11111011, B00000111, B00000000, B00000000, B11110000, B11111111, B11111111, B11111111, B11111111 }
, {
B01111101, B00001000, B00000000, B00000000, B11100000, B11111111, B11111111, B11111111, B11111111 }
, {
B00111111, B00000000, B00000000, B00000000, B11000000, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B00000000, B00000000, B00000000, B00000000, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B00000001, B00000000, B00000000, B00000000, B11111100, B11111111, B11111111, B11111111 }
, {
B11111111, B00000000, B00000000, B00000000, B00000000, B11111000, B11111111, B11111111, B11111111 }
, {
B10111111, B00000000, B00000000, B00000000, B10000000, B11111111, B11111111, B11111111, B11111111 }
, {
B00111111, B00000000, B00000000, B00000000, B11000000, B11111111, B11111111, B11111111, B11111111 }
, {
B00001111, B00000000, B00000000, B00000000, B11100000, B11111111, B11111111, B11111111, B11111111 }
, {
B00000111, B00000000, B00000000, B00000000, B11100000, B11111111, B11111111, B11111111, B11111111 }
, {
B00000111, B00000000, B00000000, B00000000, B11100000, B11111111, B11111111, B11111111, B11111111 }
, {
B00000011, B00000000, B00000000, B00000000, B00000000, B11111111, B11111111, B11111111, B11111111 }
, {
B00000011, B00000000, B00000000, B00000000, B10000000, B11101111, B11111111, B11111111, B11111111 }
, {
B00000000, B00000000, B00000000, B00000000, B00000000, B10000110, B11111111, B11111111, B11111111 }
, {
B00000000, B00000000, B00000000, B00000000, B00000000, B00101110, B11111111, B11111111, B11111111 }
, {
B01000011, B00000000, B00000000, B00000000, B01000000, B11111000, B11111111, B11111111, B11111111 }
, {
B00100011, B00000000, B00000000, B00000000, B11000000, B11001111, B11111111, B11111111, B11111111 }
, {
B00110011, B00000000, B00000000, B00000000, B11000000, B10001111, B11111111, B11111111, B11111111 }
, {
B00111111, B00000000, B00000000, B00000000, B11100000, B10001111, B00011110, B11111000, B11111111 }
, {
B00111111, B00000000, B00000000, B00000000, B11110000, B11001111, B00011110, B11111000, B11111111 }
, {
B01111111, B00000000, B00000000, B01000000, B11110000, B10111111, B00001110, B11111100, B11111111 }
, {
B00111111, B00000000, B00000000, B11000000, B11111111, B10110001, B00000110, B11111100, B11111111 }
, {
B00111111, B00000000, B00000000, B10000000, B11111111, B10111001, B00000111, B11111100, B11111111 }
, {
B11111111, B00000000, B00000000, B11100000, B11111101, B10111111, B00000011, B11111100, B11111111 }
, {
B11111111, B00000000, B00000000, B11100000, B11111100, B11111111, B00000011, B11111100, B11111111 }
, {
B11111111, B00000000, B00000000, B01100000, B11111110, B11111111, B00000011, B11111100, B11111111 }
, {
B11110011, B00000000, B00100000, B01110000, B11111111, B00111111, B00000111, B11110000, B11111111 }
, {
B00010011, B00000000, B00110000, B00011100, B11111111, B00111111, B00000111, B11110000, B11111111 }
, {
B01110111, B00000000, B11111000, B11101111, B11111111, B01111111, B00000011, B11100000, B11111111 }
, {
B01110111, B00000000, B11111000, B11111111, B11111111, B01111111, B00000110, B10000000, B11111111 }
, {
B11110111, B00000000, B11111000, B11111111, B11111111, B01111111, B00011110, B11110000, B11111111 }
, {
B11111111, B00000001, B11111000, B11111111, B11111111, B01111111, B00111111, B11111100, B11111111 }
, {
B11111111, B00000001, B11111100, B11111111, B11111111, B01111111, B01111111, B11111100, B11111111 }
, {
B11111111, B00000001, B00001110, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B00000001, B10000110, B11111111, B11111111, B11111111, B11111110, B11111111, B11111111 }
, {
B11111111, B00000111, B11111000, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B00000111, B11111000, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B00000111, B11111000, B11111111, B11111111, B11111111, B11111111, B01111111, B11111111 }
, {
B11111111, B00000011, B11111000, B11111111, B11111111, B11111111, B11111111, B01111111, B11111111 }
, {
B11111111, B00000011, B11111100, B11111111, B11111111, B11111111, B11111111, B11011111, B11111111 }
, {
B11111111, B00000111, B11111110, B11111111, B11111111, B11111111, B11111111, B11101111, B11111111 }
, {
B11111111, B00000111, B11111110, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B11001111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B10011111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B10011111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
, {
B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111, B11111111 }
};
Links
https://code.google.com/archive/p/povglobe/
Video

















