Need some help combining 2 sketches :)

I want to combine the heartgif sketch (main one) with the LED one, or I would like to insert the led sketch into the heart sketch but cant figure out how. The led sketch was generated by

https://adrianotiger.github.io/Neopixel-Effect-Generator/

would be great if is anyone is able to help !

thank you

heartgif.ino (89.8 KB)

ledsketch.ino (3.88 KB)

What do you want the combined sketch to do ?
Which Arduino board do yo have ?

What have you tried ?

Just wan to combine the both so I can use my .96 inch OLEd sketch which is the main one and the 2 addressable rgb led's which have their own patten generated by the website.

Using a pro micro without bootloader.

I tried to combine them, but am not really good at understanding sketches for something complicated like this ;/

the setup() and loop() in your led code contain one line each.

put both programs in one file. add the lines from setup() and loop() from the LED program to the setup() and loop() of the oled program and delete the setup() and loop() from the LED program.

I was abl

gcjr:
the setup() and loop() in your led code contain one line each.

put both programs in one file. add the lines from setup() and loop() from the LED program to the setup() and loop() of the oled program and delete the setup() and loop() from the LED program.

I was able to combine them, however the LED animation no longer works :frowning: its just static.

I have attached my sketch.]

this is the website I used to generate the LED sketch for 8 LED and Pin 18

sketch_jul18a.ino (91.7 KB)

I took a look into the codes.

the heartgif-code has a lot of delays and you added the strips_loop(); function only one time at the end.

the “quick and dirty without learning to code-way”

is to insert the call of strips_loop(); after each block of “display”-commands

Though it might be still not the same look and feel as the display-commands have a delay-command after each block
So the LED-code gets distracted.

To make it smooth again there are two basic ways:

1.) replacing work through money: buying a second arduino and kep the codes seprated

2.) working your way through learning how to code with millis() for non-blocking timing and learning how to code a statemachine

best regards Stefan

Hi,

Please read the post at the start of any forum , entitled "How to use this Forum".
OR
http://forum.arduino.cc/index.php/topic,148850.0.html.
Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Thanks.. Tom.... :slight_smile:

I think I need to change my Delay() to Millis() but I have no idea on how to

kot0005:
I think I need to change my Delay() to Millis() but I have no idea on how to

See Using millis() for timing. A beginners guide, Several things at the same time and the BlinkWithoutDelay example in the IDE

UKHeliBob:
See Using millis() for timing. A beginners guide, Several things at the same time and the BlinkWithoutDelay example in the IDE

Yeaah , will have to redo a lot of my code/sketch to use Milis ? because most of the code for the animation was auto generated using a program.
cant use another Arduino, am using a Mega 2560 pro and have room for a lot of code ! need the project to be compact,

thanks for the help.

TomGeorge:
Hi,

Please read the post at the start of any forum , entitled "How to use this Forum".
OR
http://forum.arduino.cc/index.php/topic,148850.0.html.
Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Thanks.. Tom.... :slight_smile:

ohh ty I was looking for this but couldn't find it.