Hello there! I am trying to merge these two codes together. Please don't bring me to any other forms related to this, as I have already read them. These are the codes, (in pastebin)
and
If you could modify these, or put them together and fix it, that would be great! P.S. please send me the modification in a pastebin link. Thnx!!!!
Note that both sketches want to use pin 8 for different purposes, so a simple merge will not work, some rework required. Also both sketches rely a lot on the use of the delay() function that will make combining them nearly impossible. A complete rewrite of a single sketch to move the servos and blink the leds are what is required. Hope it's not due tomorrow.
William06171:
Please don't bring me to any other forms related to this, as I have already read them.
If you've read and understood them then you should be able to do the work yourself. It's not hard to do and has been described numerous times. (A quick search on Google turned up around half a million matches.)
In common with many people on this forum my goal here is to help you figure out how to solve your own problems, not to provide you with a free development consultancy. If you want somebody to do the work for you, you should post a request in the Gigs & Collaborations section of the forum. Note that most people would expect to be paid for working for you.
For future reference, demanding quick responses makes me less likely to respond, not more. You've no right to expect a response let alone to dictate the timing of the response.
William06171:
So is there any way to combine these two?
No.
There is magic code that combines two independent sketches and magically figures out what you want the result to be. And by now, your Google searches have probably already confirmed that.
You can start with one and build from the other, but it's a manual process that you have to do.
When posting state exactly what you are trying to do and post your efforts(prototype code) to date; stating which part is not working.
Are you trying to blink the led once; move the servo 90 degrees then blink the led again? Blink the led every 10 degrees while the servo moves from 10 to 40 degrees? State exactly what you are trying to achieve.
A good start would be to take the servo sketch and add a couple of lines to simply turn on the led then do the servo stuff. This way you can verify that both the led and servo can work together in the one sketch. (i.e. sort out which pins connect to what).
Get back to us with your results and a description of what you want to achieve.
Read, understand, and EMBRACE the blink without delay philosophy. You can move the servo a little bit, each time it is time to move it again. You can turn an LED on each time it is time to do that. You can turn an LED off each time it is time to do that. The key is keeping track of the last time you did something interesting, and knowing how long it is until it is time to do something else interesting.
I gave two different sample scenarios when I said, "Are you trying to blink the led once; move the servo 90 degrees then blink the led again? Blink the led every 10 degrees while the servo moves from 10 to 40 degrees?"
Which one are you saying yes to? (I was just trying to elicit some detail).
Again, what is it you are trying to do?
If you won't tell us what your objective is, then we cannot help.