Go Down

Topic: How to easily send data from one arduino to another? (Read 787 times) previous topic - next topic

Nick Gammon

On the face of it, what you are doing looks fine. Why are you doing analog reads on B?

Whenever a wire is connected to the #3 output pin, the buzzer (pin 13) stops working, even when the sensor is tripped. 

On which board?


Ok, the analog reads are to detect the photocells' information. They seem to be working fine.  Neither buzzer is going off when the sensor on A is triggered, but what should happen is that A's buzzer should go off and B should report the total count.  If the count starts off at 2, and A's sensor is triggered, then you should get:
*beep* (from B)
*beep-beep-beep* (from A)

instead, like I said, starting off at zero, A never makes a sound and B just starts counting up at every available cycle. Did I mention the really weird thing is that this happens even when only a wire is connected to pin 7 of B and that wire is connected to nothing at all?  Seriously.  B goes off when its sensor is triggered AND it'll continue counting up as long as something is inside pin 7.  :(

Nick Gammon

That is normal if you don't pull the pin up or down with a resistor, or activate the internal pull-up. It is picking up stray signals.

Also you may want to make B count a transition. That is it was LOW and it is now HIGH. Not just add one if it happens to be HIGH.


Scratching my head here.  For avoidance of doubt, could you please confirm that you have the grounds of the two Arduinos connected?



Nov 25, 2012, 09:32 pm Last Edit: Nov 25, 2012, 09:43 pm by cat6 Reason: 1
What do you mean the grounds of the two arduinos connected?  You mean the digital grounds?  How would that help?  Am I indeed missing something really important here?  :smiley-eek-blue:

EDIT: Nick:  you mean I should code in an edge-triggered event instead?  How would I do that in Arduino C?  I've done it in Verilog, but there was specialized syntax for creating such circuits in that case.

Go Up