Pages: 1 [2]   Go Down
Author Topic: Please Need Help to combine two codes  (Read 839 times)
0 Members and 1 Guest are viewing this topic.
East Anglia (UK)
Offline Offline
Faraday Member
**
Karma: 90
Posts: 3512
May all of your blinks be without delay()
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You MUST have a setup() function, that is what the error message is telling you.  Copy the statements from both setup() functions into setup() in the new combined code.  Look out for conflicts such as the same pin being used for different purposes in each original program. 

If you are still stuck after combining the 2 setup() functions post your whole code here again.  There is no point looking at your code as it is now because there is no setup() function.
Logged

Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 551
Posts: 46209
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Copy the statements from both setup() functions into setup() in the new combined code.
Or, better yet, call the two setupxxxx() functions that you do have from the new setup() function.
Logged

East Anglia (UK)
Offline Offline
Faraday Member
**
Karma: 90
Posts: 3512
May all of your blinks be without delay()
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Good idea. although I think it would be easier to spot conflicts, especially in the use of pins, if the setup was in one function rather than two.
Logged

Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 551
Posts: 46209
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Good idea. although I think it would be easier to spot conflicts, especially in the use of pins, if the setup was in one function rather than two.
Agreed. Though, the code should probably be moved, then, not copied.
Logged

Pages: 1 [2]   Go Up
Jump to: