I have a project that is connecting ultrasonic sensors into Arduino Uno and the Arduino code is taking the readings from the sensors and send them to a remote server throughout ethernet shield,
Now the problem I am facing is that I need to use 6 ultrasonic sensors but when the Arduino is taking the reading from more than 4 sensors the Arduino do not function properly, but if I made the reading of the two rest sensors from pins located for one of the previous sensors it works fine, or even if I assign a default value for those two sensors it works fine,
The problem I am facing is related to the following pins: 10, 11, 12, 13 That the ethernet shield is using them but how can I overcome this problem and run all the six sensors ?
You can find part of the code below:
#include <Ethernet.h>
#include <SPI.h>
#define ECHOPIN1A1 3 // Pin to receive echo pulse
#define TRIGPIN1A1 2 // Pin to send trigger pulse
#define ECHOPIN1A2 5 // Pin to receive echo pulse
#define TRIGPIN1A2 4 // Pin to send trigger pulse
#define ECHOPIN1A3 7 // Pin to receive echo pulse
#define TRIGPIN1A3 6 // Pin to send trigger pulse
#define ECHOPIN1B1 9 // Pin to receive echo pulse
#define TRIGPIN1B1 8 // Pin to send trigger pulse
#define ECHOPIN1B2 5 // Pin to receive echo pulse
#define TRIGPIN1B2 4 // Pin to send trigger pulse
#define ECHOPIN1B3 3 // Pin to receive echo pulse
#define TRIGPIN1B3 2 // Pin to send trigger pulse