In way over my head with something I am sure is fairlly straightforward for someone familiar with this product. Happy to pay for your time to walk me through accomplishing this project.
We are making the Beetlejuice sign for our Halloween display and following this tutorial: https://www.tominseattle.com/post/animated-beetlejuice-graveyard-sign
We purchased ALL products he listed including:
Arduino Mega 2560
Sainsmart 16-Channel Relay
20-pin ribbon cable
Power Distribution Block
12V power supply (for relays
9V power supply (for LED light strips
I downloaded the Adruino program to my macbook pro and I do get green light when I connect to my computer.
When I copy and past the code into sketch I get error messages and I am not skilled enough to know what to do next. HELP! I am sure someone with experience would have this done in the blink of an eye. I would love to have you wallk me through it via a video chat so we can check this project of the list!
Here is the text of the code I am trying to use: //BeetleJuice_Sign.ino
//
//Here are the pin mappings
//
//B1 -> Relay 1 -> Arduino Pin 44
//B2 -> Relay 2 -> Arduino Pin 43
//B3 -> Relay 3 -> Arduino Pin 42
//A1 -> Relay 4 -> Arduino Pin 41
//A2 -> Relay 5 -> Arduino Pin 40
//A3 -> Relay 6 -> Arduino Pin 39
//A4 -> Relay 7 -> Arduino Pin 38
//A5 -> Relay 8 -> Arduino Pin 37
//A6 -> Relay 9 -> Arduino Pin 36
//A7 -> Relay 10 -> Arduino Pin 35
//A8 -> Relay 11 -> Arduino Pin 34
//A9 -> Relay 12 -> Arduino Pin 33
//A10 -> Relay 13 -> Arduino Pin 32
//A11 -> Relay 14 -> Arduino Pin 31
//LED -> Relay 15 -> Arduino Pin 30
int ON = LOW;
int OFF = HIGH;
int frameArray[] = {44, 43, 42};
int frameCount = 3;
int frameIndex = 0;
unsigned long frameMillis = 0;
int frameInterval = 500; //msecs
int arrowArray[] = {41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31};
int arrowCount = 11;
int arrowIndex = 0;
unsigned long arrowMillis = 0;
int arrowInterval = 250; //msecs
int arrowPhase = 0;
int ledSwitch = 30; //main sign count
int ledState = OFF;
unsigned long ledMillis = 0;
int ledOnTime = 1000; //msecs
int ledOffTime = 500; //msecs
void doArrow(unsigned long currentMillis)
{
if (currentMillis - arrowMillis >= arrowInterval)
{
arrowMillis += arrowInterval;
digitalWrite(arrowArray[arrowIndex], (arrowPhase == 0) ? ON : OFF);
arrowIndex = (arrowIndex + 1) % arrowCount;
arrowPhase = (arrowIndex == 0) ? !arrowPhase : arrowPhase;
}
}
void doFrame(unsigned long currentMillis)
{
if (currentMillis - frameMillis > frameInterval)
{
frameMillis = currentMillis;
digitalWrite(frameArray[frameIndex], OFF);
frameIndex = (frameIndex + 1) % frameCount;
digitalWrite(frameArray[frameIndex], ON);
}
}
void doLedSwitch(unsigned long currentMillis)
{
if (ledState == ON && currentMillis - ledMillis > ledOffTime)
{
ledMillis = currentMillis;
ledState = OFF;
digitalWrite(ledSwitch, ledState);
}
else
if (ledState == OFF && currentMillis - ledMillis > ledOnTime)
{
ledMillis = currentMillis;
ledState = ON;
digitalWrite(ledSwitch, ledState);;
}
}
void setup()
{
for (int count = 0; count < arrowCount; count++)
{
pinMode(arrowArray[count], OUTPUT);
digitalWrite(arrowArray[count], OFF);
}
for (int count = 0; count < frameCount; count++)
{
pinMode(frameArray[count], OUTPUT);
digitalWrite(frameArray[count], OFF);
}
pinMode(ledSwitch, OUTPUT);
digitalWrite(ledSwitch, OFF);
}
void loop()
{
unsigned long currentMillis = millis();
doArrow(currentMillis);
doFrame(currentMillis);
doLedSwitch(currentMillis);
}