Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 8 months ago.
Send Signal back and forth between two mbeds.
We are currently looking for an way to communicate (just sending signal value (1 and 0)) between two mbed. If one subroutine's condition is satisfied in mbed A, then mbed A sends signal value 1 to mbed B so mbed B does another subroutine. Both two subroutines cannot be performed in one mbed. Is there any way to do this? We just tried to use DigitalOut and DigitalIn but it seemed like they are having clocking issue. If you have any idea, please share with us.
3 Answers
9 years, 8 months ago.
Digital in and digital out should work fine. You just need to connect the signal wires and ground between the two.
Rather than have the software constantly check the DigitalIn you could use InterruptIn to detect the pin changing.
Beyond that I'm not sure what help people can give unless you post code (with <<code>> <</code>>
tags around it so that it's readable please) and/or more details of how you've connected things.
9 years, 8 months ago.
If you want to perform both subroutines on the same mbed then I would suggest that you look at using mbeb RTOS Threads. Threads allow more that one subroutine to run virtually at the same time. Since you only have two subroutines to run I would suggest that the A subroutine runs in a thread and the B subroutine runs in the main thread (ie. in the while loop in main).
Without knowing more details of what you are trying to accomplish its hard to provide more detailed help.
9 years, 8 months ago.
there are so many different ways of doing it...
Will the 2 boards spaced from few meters, just besides ? So you could use, Digital In/out, RS485, RS232, Ethernet and ...
So you have to give us more detais about your project.