So i want the IR sensor to have two outputs.. one to control a motor which will control a valve to restrict flow of liquid and the other outputs for LED indicators. Could you suggest how do i go about it?
@bart-haezeleer I have found there are problems with Rpi3 serial port.
Use a small pro-mini with a cheap serial-to-usb adapter and try with that. I think that will solve your problems. This will also allow you to add hardware signing of messages in the future which cannot be done with a nrf24l01+ directly attached to the pi.
This particular one is running on an Arduino Duemilanove, but the sensor and gateway are both using the same library version (1.5.1) so that should be all good, no?
Thanks for this great testing code.
The default pong back role wasn't working for me (and therefore no data was received from the remote unit) so I changed the following section of your code from:
radio.begin();
// Openning for listening
radio.openReadingPipe(1,pipes[1]);
radio.startListening();
To:
radio.begin();
// Openning for listening
radio.openReadingPipe(1,pipes[0]);
radio.openWritingPipe(pipes[1]);
radio.startListening();
Am not sure if the "radio.openWritingPipe(pipes[1])" (copied from the change role code further down in your source) line is required, but it works.
Thanks again.
B
take care to have the good number of pin, some sketch use digital others analogic... I've ordered light sensors and sound sensors without analogic, I couldn't use them for my target use...
Welcome to the forum @StefanH
I took the liberty to edit your post to mark your sketch as code. This makes the code mich easier to read. You can use the </> button on top of the edit area next time.
Have you looked at https://github.com/mysensors/MySensorsArduinoExamples/blob/master/examples/DallasTemperatureSensor/DallasTemperatureSensor.ino ? It has support for multiple sensors.
In any case, please post the debug output of your sketch. It will make it 10-100x easier to troubleshoot. If you haven't already, see https://forum.mysensors.org/topic/666/read-this-first-it-could-save-you-a-lot-of-time/ for how to enable debug output.