Go Down

Topic: Communication both read and write at the same time (Read 738 times) previous topic - next topic

d82k

Dear All,

I have connected to my arduino both a rf 433mhz transmitter and receiver (rc switch library).

I would like to make the the arduino to communicate with my raspberry pi (using serial communication i guess).

On one hand, the arduino listens to 433mhz signals incoming and send information to raspberry pi, on the other whenever needed the raspberry communicates the code to sent to the arduino.

So basically I'm thinking of something like this on arduino side:
- the loop starts
- is there anything to send?
-- Yes: send the code (rc library) and start again
-- No: listen
--- do I listen to something?
---- Yes: receive and show received value
---- No: start again the loop

How do I trigger the fact that there is something to read? maybe modifying the state of a digital input?
Otherwise the arduino waits to read from serial but if there is nothing to sends it waits and does not read.

Do you have any suggestions, please?
Thank you
dk

billroy


gnusci

What about using a task scheduler

http://arduino.cc/en/Reference/Scheduler

You can find more in the WWW:

https://www.google.com/search?btnG=1&pws=0&q=arduino+task+scheduler
--

gnusci

d82k

Thank you for your replies!

Wow virtual wire seems really interesting... I want to read it carefully!

Regarding the scheduler, good hint.. I have tried something I found on my research on google.. but did not fully understand it in fact it does not work! I still have to study...

Thank you,
dk

Go Up