ArduinoGeneral

APC220 modules working as emitter/receiver alternately

userHead Account cancelled 2016-01-23 21:37:39 1596 Views1 Replies
Hello there! I was wondering if someone can help me with this. I have a project using two APC220 modules: one is connected to a Arduino MEGA and the other to my PC. On the Arduino side I have some sensors that gather some variables and send it to PC side. This part is working fine! Now I want to send orders from PC to shut down the sensors on the Arduino side. So I will have a situation where my APC220 modules will be receiving and transmitting at the same time. Is this possible and can be done by simply connecting Vin+GND+RX+TX on both sides? Or I have to get some kind of synchronism to make shure I enable the modules to work as emitter/receiver in each case? Any ideas?
Thanks a lot!
Best
2016-01-23 22:46:00 APC220 module can work as receiver and transmitter at the same time. In the mean time, you can write an Arduino code such as


Code: Select all
if(Serial.available())  // check if there is command from APC220
 
 int cmd=Serial.read(); // If yes, read the cmd,

Serial.print(sensorData);//Send sensor data to your PC.


This should meet your scenario. .
userHeadPic R2D2C3PO