Hey hello i am a 25 year old mechanic that liks to tinker with Electronic's.
My project for last year was a fireworks firing system with 32 cue 2* a saintsmart 16 relay board.
Witch i can control with the pyroignition software,
It worked perfect.
The code i used:
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int module;
int kanaal;
int slaveid = 1;
int fire_delay = 100;
int input[3]; // Hier gaan we de inkomende serieele data opslaan. Omdat we met 12 kanalen werken maken we een array van 2 bytes.
int channels2[32] = {
A0, A1, A3, A2, A5, A4, A7, A6, A9, A8, A11, A10, A13, A12, A15, A14,
50,52,46,48,42,44,38,40,34,36,30,32,26,28,22,24};
// the setup routine runs once when you press reset:
void setup() {
Serial.begin(9600);
lcd.print("Schietsysteem.......");
for (int i=0; i < 32; i++)
{
pinMode(channels2*, OUTPUT); // turn the LED on (HIGH is the voltage level)*
digitalWrite(channels2*, LOW);*
delay(10);
} // wait for a second
}
void loop()
{
Serial.flush();
while( Serial.available() < 1)
{
//Serial.write(Serial.read());
}
for (int i=0; i < 3; i++)
{
input = Serial.read(); // Zet de karakters in de Array.
delay(10);
}
for (int i=0; i < 33; i++)
{
if(input[1] == slaveid && input[2] == i)
{
fire_cue(i);
}
}
}
void fire_cue(int cue)
{
cue = cue - 1;
digitalWrite(channels2[cue], HIGH);
delay(fire_delay);
digitalWrite(channels2[cue], LOW);
}
But for this year i wanted to build a bigger system 64 cue+.
I want to accomplish this by ussing 1 16channel relay board ussing 8 relays of the board as a possitive and 8 relays of the board as a negative.
But how i need to programm this al my efforts so far failed if some one have an idee please help me.
Ps sorry for my grammatic error english isnt my first language i am a dutch