Passo a passo para configurar o código de comunicação com Arduino e Vixen Lights para controlar 4 Fitas de LED RGB.
Código abaixo:
//==========================> Definição dos pinos e nomes das variáveis
// LED RGB 01
int LedVermelho1 = 2;
int LedVerde1 = 3;
int LedAzul1 = 4;
// LED RGB 02
int LedVermelho2 = 5;
int LedVerde2 = 6;
int LedAzul2 = 7;
// LED RGB 03
int LedVermelho3 = 8;
int LedVerde3 = 9;
int LedAzul3 = 10;
// LED RGB 04
int LedVermelho4 = 11;
int LedVerde4 = 12;
int LedAzul4 = 13;
int i = 0;
int incomingByte[12]; // Array para armazenar os 12 valores RGB
void setup() {
//==========================> Velocidade da comunicação Serial
Serial.begin(9600);
//==========================> Definir os pinos como saída
// LED RGB 01
pinMode(LedVermelho1, OUTPUT);
pinMode(LedVerde1, OUTPUT);
pinMode(LedAzul1, OUTPUT);
// LED RGB 02
pinMode(LedVermelho2, OUTPUT);
pinMode(LedVerde2, OUTPUT);
pinMode(LedAzul2, OUTPUT);
// LED RGB 03
pinMode(LedVermelho3, OUTPUT);
pinMode(LedVerde3, OUTPUT);
pinMode(LedAzul3, OUTPUT);
// LED RGB 04
pinMode(LedVermelho4, OUTPUT);
pinMode(LedVerde4, OUTPUT);
pinMode(LedAzu…