Hello!I need your help so i have kind of an plant waterring robot and on one arduino i have connected a motor shield and a sevomotor and on the other arduino i have connected a humidity sensor and a water pump and other kind of sensors and this arduino i wann make it a master and the other one a slave so when the slave activates the servomotor and moves the humidity and pump wont activate and create a mess but i dont know how i will let here the code for the slave but i only wrote the motor part and what i want you to do is to help me create a basic program for other arduino and develop the program for this arduino.it dosent have to be sowething complicated just the basic stuff si i can develop it on the future.
Heres the code
Before anyone helps you, they will want to be sure that it is not a waste of time. It might be a waste of time if, after you get it working, you figure out you need something different.
So please explain your project in more detail. A diagram would be useful.
1.i dont have any more pins available on the master arduio
2.the arduinos are like 5 cm apart
3.the servo will move the humidity sensor out from the soil and the regular motors will drive the ansembly to the next plant
This is the most common reason that beginners give for using a second Arduino. It is a bad reason to use 2 Arduino. What happens next is that the beginner has problems getting the 2 Arduino to communicate and so they post a question on the forum asking for help to get the 2 Arduinos to communicate. Does this sound familiar?
The answer is to use only 1 Arduino. There is almost always a way to use fewer pins so that you do not run out. If that can't be done, there are ways to give the Arduino more pins.
Post a schematic showing everything that is connected to the master Arduino and the second arduino. Post links to the product pages or data sheets of each component that is connected. The forum can then help you figure out how to free up some pins or add some new pins so that a second arduino is not needed.
so what are you saying is that i need to do both codes and post them there but the problem is that i have a competition and i have until 11th december and i will try to make the program then and i will post it here
I don't understand. Really... sorry but you really have an English language problem. What you posted makes no sense in this language. I can only guess. Please use machine translation.
i cant make a schematic but i can type some of them here:
ON THE MAIN BOARD (plusivo arduino uno)
-lcd shield
-soil humidity sensor
-water pump
-relay for the water pump
-buzzer
-neopixel bar
-vibration sensor
-flame sensor
-temp and humidity sensor
ON THE SECONDARY BOARD(science meow "arduino uno"
-motor shield
-2 dc motors
-servomotor
i realy cant rely on translate since i am a romanian ad the translated text would make even less logic but you cant write here what did you understand and then i will tell you if its correct