I need help adjusting a code! STAT!

Status
Not open for further replies.
Hi All,

I asked for guidance for a larger project, but now I need to vastly simplify it. The short version: I had an animatronic art piece that played music and stories. It had motorized doors and 3 different light patterns. The code is long and complicated and originally ran off a teensy 3.2, Arduino UNO, and L298N motor driver. I burned out a board and decided I want to simplify the project to JUST THE LIGHTS and have it run off a UNO.

I have tried to edit the original code so that just the lighting code is present but I am not a coder... Can someone please take a look at the before and after codes here to tell me what I am doing wrong?

Also, besides telling the IDE that I am programming a UNO, do I need to do anything different to run the code off UNO instead of teensy 3.2?

View attachment Soarsa_Working_Code_Jan2020.ino this was run with a teensy 3.2, L298N motor driver, and Arduino UNO

View attachment sketch_nov28a.ino this is the code I am trying to create for the new UNO.

Please tell me how to fix this! I have been in tears all day because I am totally over my head and need to have this finished in the next 20 hours. I am very inexperienced in this, so please be blunt and explain it as you would to a kid. (Even though I am 40).

Thank you!
 
Yes, FastLED library appears installed.

fastledss.png
 
First issue: you lost the closing brace in the loop() function.

Code:
void loop() {
  // put your main code here, to run repeatedly:


[B]}[/B]


  // ---- ColorWavesCycle  ---------------------------------------------------------------------------------------------------------------
 
Next issue , lines 16-18, the led data pins cannot be 32, 31 and 30 on an UNO, changing to 2, 3 and 4 gives a sketch that compiles for UNO but of course doesnt do anything since the loop() is empty
 
Then try to add in some pixel stuff into the loop(), removed everything that looks like motors and doors and audio.
This needs the correct led data pin numbers as of previous post to do anything, and probably also led power.

Code:
void loop() {
  // put your main code here, to run repeatedly:

  CurrentMillis = millis();                                            // Here we are checking if its time to do Lightning
  if (CurrentMillis > (PreviousStrikeMillis + NextStrike)) {          // If so
        Lightning();                                                      // Then go run the Lightning code
  }
  TwinkleMapPixels();                                                   // Run the Twinkle

  FastLED.show();                                                         // Show the LEDs
  FastLED.delay(20);                                                      // Let them Shine for a moment before doing more


}
 
Status
Not open for further replies.
Back
Top