Pages: [1]   Go Down
Author Topic: Communication both read and write at the same time  (Read 670 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
God Member
*****
Karma: 39
Posts: 988
Get Bitlash: http://bitlash.net
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Look into the VirtualWire library.

-br
Logged

Edmonton, Canada
Offline Offline
Newbie
*
Karma: 0
Posts: 28
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

--

gnusci

Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Pages: [1]   Go Up
Jump to: