main:
' LETRA B
let pins = %00011111
let pins = %00010101
let pins = %00010101
let pins = %00001010
goto main
/* FIRST PROGRAM IN ARDUINO 0017
BY: AndréD.
Project POV FiBre Clock */
int timer=300; // Tempo entre cada letra em MicroSegundos
int timer1=500; // Tempo entre cada letra em MicroSegundos
int x=0;
int var_sensorIR = 0; |
int sensorIR = 0; |-> Variaveis Correspondentes ao Sensor de Infravermelhos
void setup() {
Serial.begin(9600);
pinMode (8, OUTPUT); |
pinMode (9, OUTPUT); |
pinMode (10, OUTPUT); |---- > Configuração das portas para os leds
pinMode (11, OUTPUT); |
pinMode (12, OUTPUT); |
}
void loop()
{
var_sensorIR = analogRead(sensorIR); \\ Leitura do valor do Sensor e escrita desse mesmo valor na variavel "val_sensorIR"
if(var_sensorIR < 400){ \\ Condição SE o valor do sensor for menos que 400 entao começa a sequencia dos Leds.
/* LETRA L */
PORTB = B00000000; \\ Escrita em varios Pinos o que permite acender os leds pretendidos.
delayMicroseconds(timer); \\ Tempo de espera em Microsegundos
PORTB = B00011111;
delayMicroseconds(timer);
PORTB = B00010000;
delayMicroseconds(timer);
PORTB = B00010000;
delayMicroseconds(timer);
PORTB = B00010000;
delayMicroseconds(timer1);
PORTB = B00000000;
delayMicroseconds(timer);
/* LETRA U */
PORTB = B00001111;
delayMicroseconds(timer);
PORTB = B00010000;
delayMicroseconds(timer);
PORTB = B00010000;
delayMicroseconds(timer);
PORTB = B00010000;
delayMicroseconds(timer);
PORTB = B00001111;
delayMicroseconds(timer);
PORTB = B00000000;
delayMicroseconds(timer1);
/* LETRA S */
PORTB = B00010010;
delayMicroseconds(timer);
PORTB = B00010101;
delayMicroseconds(timer);
PORTB = B00010101;
delayMicroseconds(timer);
PORTB = B00010101;
delayMicroseconds(timer);
PORTB = B00001001;
delayMicroseconds(timer);
PORTB = B00000000;
delayMicroseconds(timer1);
/* LETRA O */
PORTB = B00001110;
delayMicroseconds(timer);
PORTB = B00010001;
delayMicroseconds(timer);
PORTB = B00010001;
delayMicroseconds(timer);
PORTB = B00010001;
delayMicroseconds(timer);
PORTB = B00001110;
delayMicroseconds(timer);
PORTB = B00000000;
delayMicroseconds(timer1);
/* ESPAÇO */
PORTB = B00000000;
delayMicroseconds(timer);
PORTB = B00000000;
delayMicroseconds(timer);
/* LETRA R */
PORTB = B00011111;
delayMicroseconds(timer);
PORTB = B00000101;
delayMicroseconds(timer);
PORTB = B00000101;
delayMicroseconds(timer);
PORTB = B00001101;
delayMicroseconds(timer);
PORTB = B00010010;
delayMicroseconds(timer);
PORTB = B00000000;
delayMicroseconds(timer1);
/* LETRA O */
PORTB = B00001110;
delayMicroseconds(timer);
PORTB = B00010001;
delayMicroseconds(timer);
PORTB = B00010001;
delayMicroseconds(timer);
PORTB = B00010001;
delayMicroseconds(timer);
PORTB = B00001110;
delayMicroseconds(timer);
PORTB = B00000000;
delayMicroseconds(timer1);
/* LETRA B */
PORTB = B00011111;
delayMicroseconds(timer);
PORTB = B00010001;
delayMicroseconds(timer);
PORTB = B00010101;
delayMicroseconds(timer);
PORTB = B00010101;
delayMicroseconds(timer);
PORTB = B00001010;
delayMicroseconds(timer);
PORTB = B00000000;
delayMicroseconds(timer1);
/* LETRA O */
PORTB = B00001110;
delayMicroseconds(timer);
PORTB = B00010001;
delayMicroseconds(timer);
PORTB = B00010001;
delayMicroseconds(timer);
PORTB = B00010001;
delayMicroseconds(timer);
PORTB = B00001110;
delayMicroseconds(timer);
PORTB = B00000000;
delayMicroseconds(timer1);
/* LETRA T */
PORTB = B00000001;
delayMicroseconds(timer);
PORTB = B00000001;
delayMicroseconds(timer);
PORTB = B00011111;
delayMicroseconds(timer);
PORTB = B00000001;
delayMicroseconds(timer);
PORTB = B00000001;
delayMicroseconds(timer);
PORTB = B00000000;
delayMicroseconds(timer1);
/* LETRA I */
PORTB = B00000000;
delayMicroseconds(timer);
PORTB = B00010001;
delayMicroseconds(timer);
PORTB = B00011111;
delayMicroseconds(timer);
PORTB = B00010001;
delayMicroseconds(timer);
PORTB = B00000000;
delayMicroseconds(timer);
PORTB = B00000000;
delayMicroseconds(timer1);
/* LETRA C */
PORTB = B00011111;
delayMicroseconds(timer);
PORTB = B00010001;
delayMicroseconds(timer);
PORTB = B00010001;
delayMicroseconds(timer);
PORTB = B00010001;
delayMicroseconds(timer);
PORTB = B00000000;
delayMicroseconds(timer);
PORTB = B00000000;
delayMicroseconds(timer1);
/* LETRA A */
PORTB = B00011110;
delayMicroseconds(timer);
PORTB = B00000101;
delayMicroseconds(timer);
PORTB = B00000101;
delayMicroseconds(timer);
PORTB = B00000101;
delayMicroseconds(timer);
PORTB = B00011110;
delayMicroseconds(timer);
PORTB = B00000000;
delayMicroseconds(timer1);
}
}
:O está bem fixe, deve dar um efeito altamente em pessoa.
só uma pergunta, se eu for para o outro lado, tmb consigo ler o que está escrito á frente? ou é necessa´rio outro programa?
Eu ia sugerir apenas rodar a base 180º ... x)
Estou impressionado com o aparelho.
Só com cinco leds escrever várias letras à vista desarmada parece surreal.
E ainda não acredito que é verdade.
Mas fiquei curioso, se calhar podes-me responder AndréD.
O robot faz muito barulho? Ou é silencioso?
Obrigado por leres estas linhas.
Cumprimentos,
Tiago Silva
acho que vou fazer uma coisa destas... mas com um PIC, talvez o 16f876 que tenho aqui alguns parados ;)