Beltrán's POV

From Curuxa Community

Jump to: navigation, search
Application:
Beltrán's POV
Type Electronics
Author Beltrán Fernández
Status Finished
Date January 2010


Simple Persistence-of-Vision display using a Main Board, eight+one LTIND-A and four SISW-SPST.

Contents

Description

A POV (Persistence-of-Vision display) is an electronic device that prints on air a text or image using a few LEDs moving fast from side to side or in circular motion.

The circuit is powered from 4 double-A batteries and uses 8 LEDs placed on top of a piece of wood (see picture below) which allows me to move this kind of display made of LEDs in circles (or arcs; side to side) to show the text and images.

Its behavior is controlled using 4 push buttons. Two of them (the red and gree ones) are used to switch the display on and off (and yellow Pilot Light off and on, respectively). The other two buttons (both black coloured) change the displayed message (there are 4 different messages fixed by code).

Hardware

Used Main Boards and Modules

MBP18 Main Board: MBP18
  • Based on a PIC16F88
  • Up to 4096 instructions
  • RAM: 360 bytes
  • EEPROM: 256 bytes
  • 31kHz-8MHz internal oscillator
  • 10-bit, 7-channel Analog-to-Digital Converter
  • Up to 16 data input/outputs


LTIND-A 8+1x LTIND-A

Indicator LED.

These LEDs show the message or image + Pilot Light.

Connect them to RB0-RB7 pins + Connect it to RA7.


SISW-SPST 4x SISW-SPST

Simple push button or on-off switch. Two positions. Microcontroller can receive either 0 or 1.

Two of them switch on-off the device (and Pilot Light). The other two switch between messages.

Connect them to RA0-RA3.

Pictures

POV POV POV POV POV POV POV POV POV POV

Videos

POV working, waving it with my hand:


POV resting on the table. Testing LEDs and switches:

Source Code

This program has four hard-coded messages. The first one shows my name, BELTRAN. The second one is Hello World in spanish: Hola Mundo. The third one shows B (heart) N and the fourth one is IEEE in negative, which means the background is bright and the letters dark.

Note the delay: it used to be a big loop doing nothing. While testing the device I set the loop to lower and lower iterations until it disappeared. The internal code added by the compiler just for calling the delay function is enough delay for this application.

/*==================================================================
* Beltran's POV
*
* Connections:
* SISW-SPST: RA0, RA1, RA2, RA3
* LTIND-A: RB1, RB2, RB3, RB4, RB5, RB6, RB7
*
* Beltran Fernandez
*
* http://community.curuxa.org
*
*=================================================================*/
 
#include <pic16f88.h>
 
typedef unsigned int config;
config at _CONFIG1 __CONFIG = _CP_OFF & _DEBUG_OFF & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_OFF & _PWRTE_ON & _WDT_OFF & _INTRC_IO;
 
void delay(){
    long i;
//    for(i=0; i<1; i++){}
}
 
void main(){
        unsigned char doing = 1;
        unsigned char msg = 0;
        unsigned char msgsw = 0;
        ANSEL = 0;
        TRISA = 0xFF;
        TRISA7 = 0;
        TRISB = 0;
 
        RA7 = 1; PORTB = 0b00000000;
        while(1){
        if(msgsw){
                switch(msg){
                        case 0:
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
 
                                PORTB=0b01111110; delay(); delay();
                                PORTB=0b01001010; delay(); delay();
                                PORTB=0b01001100; delay(); delay();
                                PORTB=0b00110000; delay(); delay();
                                PORTB=0b00000000; delay(); delay();
                                PORTB=0b01111110; delay(); delay();
                                PORTB=0b01001010; delay(); delay();
                                PORTB=0b01001010; delay(); delay();
                                PORTB=0b01000010; delay(); delay();
                                PORTB=0b00000000; delay(); delay();
                                PORTB=0b01111110; delay(); delay();
                                PORTB=0b01000000; delay(); delay();
                                PORTB=0b01000000; delay(); delay();
                                PORTB=0b01000000; delay(); delay();
                                PORTB=0b00000010; delay(); delay();
                                PORTB=0b01111110; delay(); delay();
                                PORTB=0b01111110; delay(); delay();
                                PORTB=0b00000010; delay(); delay();
                                PORTB=0b00000000; delay(); delay();
                                PORTB=0b01111110; delay(); delay();
                                PORTB=0b00010010; delay(); delay();
                                PORTB=0b00101100; delay(); delay();
                                PORTB=0b01000010; delay(); delay();
                                PORTB=0b00000000; delay(); delay();
                                PORTB=0b01111110; delay(); delay();
                                PORTB=0b00010010; delay(); delay();
                                PORTB=0b00010010; delay(); delay();
                                PORTB=0b01111110; delay(); delay();
                                PORTB=0b00000000; delay(); delay();
                                PORTB=0b01111110; delay(); delay();
                                PORTB=0b00001100; delay(); delay();
                                PORTB=0b00110000; delay(); delay();
                                PORTB=0b01111110; delay(); delay();
                                PORTB=0b00000000; delay(); delay();
 
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay(); break;
                        case 1:
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
 
                                PORTB = 0b11111110; delay();
                                PORTB = 0b10010010; delay();
                                PORTB = 0b00010000; delay();
                                PORTB = 0b10010010; delay();
                                PORTB = 0b11111110; delay();
                                PORTB = 0b10000010; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b01110000; delay();
                                PORTB = 0b10001000; delay();
                                PORTB = 0b10001000; delay();
                                PORTB = 0b10001000; delay();
                                PORTB = 0b01110000; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b10000000; delay();
                                PORTB = 0b10000010; delay();
                                PORTB = 0b11111110; delay();
                                PORTB = 0b10000000; delay();
                                PORTB = 0b10000000; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b11010000; delay();
                                PORTB = 0b10101000; delay();
                                PORTB = 0b10101000; delay();
                                PORTB = 0b10101000; delay();
                                PORTB = 0b11110000; delay();
                                PORTB = 0b10000000; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b10000010; delay();
                                PORTB = 0b11111110; delay();
                                PORTB = 0b10001110; delay();
                                PORTB = 0b00010000; delay();
                                PORTB = 0b10001110; delay();
                                PORTB = 0b11111110; delay();
                                PORTB = 0b10000010; delay();
                                PORTB = 0b00001000; delay();
                                PORTB = 0b01111000; delay();
                                PORTB = 0b10000000; delay();
                                PORTB = 0b10000000; delay();
                                PORTB = 0b01001000; delay();
                                PORTB = 0b11111000; delay();
                                PORTB = 0b10000000; delay();
                                PORTB = 0b10001000; delay();
                                PORTB = 0b11111000; delay();
                                PORTB = 0b10010000; delay();
                                PORTB = 0b00001000; delay();
                                PORTB = 0b10001000; delay();
                                PORTB = 0b11110000; delay();
                                PORTB = 0b10000000; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b01110000; delay();
                                PORTB = 0b10001000; delay();
                                PORTB = 0b10001000; delay();
                                PORTB = 0b10010010; delay();
                                PORTB = 0b11111110; delay();
                                PORTB = 0b10000000; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b01110000; delay();
                                PORTB = 0b10001000; delay();
                                PORTB = 0b10001000; delay();
                                PORTB = 0b10001000; delay();
                                PORTB = 0b01110000; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b00000000; delay();
 
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay(); break;
                        case 2:
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
 
                                PORTB = 0b10000010; delay();
                                PORTB = 0b11111110; delay();
                                PORTB = 0b10010010; delay();
                                PORTB = 0b10010010; delay();
                                PORTB = 0b10010010; delay();
                                PORTB = 0b01101100; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b00011000; delay();
                                PORTB = 0b00111100; delay();
                                PORTB = 0b01111100; delay();
                                PORTB = 0b11111000; delay();
                                PORTB = 0b01111100; delay();
                                PORTB = 0b00111100; delay();
                                PORTB = 0b00011000; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b10000010; delay();
                                PORTB = 0b11111110; delay();
                                PORTB = 0b10001110; delay();
                                PORTB = 0b00110000; delay();
                                PORTB = 0b11000010; delay();
                                PORTB = 0b11111110; delay();
                                PORTB = 0b00000010; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b00000000; delay();
 
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay(); break;
                        case 3:
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
 
                                PORTB = 0b11111111; delay();
                                PORTB = 0b00111100; delay();
                                PORTB = 0b00111100; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b00111100; delay();
                                PORTB = 0b00111100; delay();
                                PORTB = 0b11111111; delay();
                                PORTB = 0b11111111; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b00100100; delay();
                                PORTB = 0b00100100; delay();
                                PORTB = 0b00111100; delay();
                                PORTB = 0b00111100; delay();
                                PORTB = 0b11111111; delay();
                                PORTB = 0b11111111; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b00100100; delay();
                                PORTB = 0b00100100; delay();
                                PORTB = 0b00111100; delay();
                                PORTB = 0b00111100; delay();
                                PORTB = 0b11111111; delay();
                                PORTB = 0b11111111; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b00000000; delay();
                                PORTB = 0b00100100; delay();
                                PORTB = 0b00100100; delay();
                                PORTB = 0b00111100; delay();
                                PORTB = 0b00111100; delay();
                                PORTB = 0b11111111; delay();
 
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay();
                                PORTB=0b00000000; delay(); break;
                }
        }
        if(RA0 == 0) {msgsw = 0; RA7 = 1;}                      //Rojo - apagar (piloto on).
        if(RA1 == 0) {msgsw = 1; RA7 = 0;}                      //Verde - encender (piloto off).
        if(RA2 == 0) {msg++; if(msg > 3) {msg = 0;} delay();}   //Negro1 - Mensaje siguiente.
        if(RA3 == 0) {msg--; if(msg < 0) {msg = 3;} delay();}   //Negro2 - Mensaje previo.
 
        }
}
Personal tools