Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

How can I make 2 different codes work on 1 board
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

How can I make 2 different codes work on 1 board

by wakebaby1 on Sun Nov 07, 2010 8:13 pm

I
Last edited by wakebaby1 on Mon Nov 08, 2010 3:27 am, edited 1 time in total.
wakebaby1
 
Posts: 4
Joined: Sun Nov 07, 2010 6:02 pm

Re: How can I make 2 different codes work on 1 board

by adafruit_support_bill on Sun Nov 07, 2010 8:45 pm

Use the "Code" button when submitting code. It preserveds the format and make it easier to read.

Exactly what errors are you seeing when you combine the code?

adafruit_support_bill
 
Posts: 78748
Joined: Sat Feb 07, 2009 10:11 am

Re: How can I make 2 different codes work on 1 board

by stinkbutt on Mon Nov 08, 2010 3:03 am

I'm assuming that you're just appending one program to the end of the other. You're getting an error because there are a half-dozen methods/functions (like setup(), and loop()) which you're implementing twice. That won't work. If you want the arduino to do both, you'll need to actually re-implement new setup() and loop() functions that do what you want them to do.
Red M&M, Blue M&M: They all wind up the same color

stinkbutt
 
Posts: 593
Joined: Wed Feb 17, 2010 2:40 am

Please be positive and constructive with your questions and comments.