Caros,
Há alguns dias conclui a montagem de minha Falcon 1:72 Foi meu primeiro trabalho com Arduino.
Vou compartilhar com vocês o código (fiz inspirado no video citado abaixo.
Espero que seja útil para algem!!
=======================
// https://www.youtube.com/watch?v=_irfK9FXTWk
const int LED1 = 3; // i
const int LED2 = 5; // j
const int LED3 = 9; // k
const int LED4 = 10;// l
int i = 1, j=63, k=128, l=192;
int bi=i, bj=j, bk=k, bl=l;
int de =4 ;
void setup() {
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
pinMode(LED3, OUTPUT);
pinMode(LED4, OUTPUT);
}
void loop() {
if (bi > 255)
{
i = -1;
}
else if (bi < 0)
{
i = 1;
}
//==========================
if (bj > 255)
{
j = -1;
}
else if (bj < 0)
{
j = 1;
}
//==========================
if (bk > 255)
{
k = -1;
}
else if (bk < 0)
{
k =1;
}
//==========================
if (bl > 255)
{
l = -1;
}
else if (bl < 1)
{
l = 1;
}
bi= bi + i;
bj= bj +j ;
bk= bk +k ;
bl= bl +l ;
analogWrite (LED1, bi);
analogWrite (LED2, bj);
analogWrite (LED3, bk);
analogWrite (LED4, bl);
delay(de);
}
Próximos Eventos Programados:
Motores da minha Falcon Millenium
- Wanderson
- Super Membro
- Mensagens: 7135
- Registrado em: 24 Set 2014, 11:38
- Nome: Wanderson G. Wanzeller
- Localização: Laranjeiras do Sul - PR
- Agradeceu: 44 vezes
- Curtiram: 93 vezes
-
Contato:
- Troféus:
- GTs em Andamento:
Motores da minha Falcon Millenium
Mais informações das montagens estão no meu canal
https://www.youtube.com/channel/UC5xPfN ... subscriber
https://www.youtube.com/channel/UC5xPfN ... subscriber