Hello ChrisWard
So, i made a Aplication for my Phone, and now i can remote my Field trailed Sprayer, because the original Controller is very big, and it has many Problem. I made the app, and when i touchdown the "button"than a Relay on the relay Board is in the On and the Funcion on the Boom is funcion( Sprayer boom up-down, ....) , when i let go the "button" then the Relay is swiching in Off, and the funcion of Boom is stopping. Now this wokrs with Sprayer all Functions ( Boom up-down, Boom rotate left- right, Folding and unfolding the boom, Worklight On-OFF, Clucth of the Sprayer Pump On-Off).
I want to Two Limit Switch on the Sprayer, that i can monitoring on the Phone, that the Clucht of the Sprayer Boom is in ON, and the other, that Boom is in the Good place for the Folding, or Unfolding.
And this is my Problem, because, i made the Controlling, but i dont know, how i make the monitoring( In the arduino Code and in the MIT Blocks).
Here is the APP
Sprayer_Controller_v3.aia (827.8 KB)
I made a Shematich circuit.
Arduino code:
char Incoming_value = 0;
void setup()
{
Serial.begin(9600);
pinMode(22, OUTPUT);
pinMode(23, OUTPUT);
pinMode(24, OUTPUT);
pinMode(25, OUTPUT);
pinMode(26, OUTPUT);
pinMode(27, OUTPUT);
pinMode(28, OUTPUT);
pinMode(29, OUTPUT);
pinMode(30, OUTPUT);
pinMode(30, OUTPUT);
pinMode(31, OUTPUT);
pinMode(32, OUTPUT);
pinMode(33, OUTPUT);
pinMode(34, OUTPUT);
pinMode(35, OUTPUT); // hidraulika kimenetek
pinMode(36, OUTPUT); // munka lámpa
pinMode(37, OUTPUT); // bal táblaszél szóró
pinMode(38, OUTPUT); //jobb táblaszél szóró
pinMode(49, OUTPUT);
pinMode(51, OUTPUT);
pinMode(53, OUTPUT);
}
void loop()
{
digitalWrite(53, HIGH); //Ardino ĂĽzemel
if(Serial.available() > 0)
{
Incoming_value = Serial.read();
Serial.print(Incoming_value);
Serial.print("\n");
if(Incoming_value == '0')
digitalWrite(22, HIGH);
else if(Incoming_value == '1') // Felemel
digitalWrite(22, LOW);
if(Incoming_value == '2')
digitalWrite(23, HIGH);
else if(Incoming_value == '3') // Leenged
digitalWrite(23, LOW);
if(Incoming_value == '4')
digitalWrite(24, HIGH);
else if(Incoming_value == '5') // Balra dönt
digitalWrite(24, LOW);
if(Incoming_value == '6') //Jobbra dönt
digitalWrite(25, HIGH);
else if(Incoming_value == '7')
digitalWrite(25, LOW);
if(Incoming_value == '8') //Retesz be
digitalWrite(26, HIGH);
else if(Incoming_value == '9')
digitalWrite(26, LOW);
if(Incoming_value == 'a') //Retesz ki
digitalWrite(27, HIGH);
else if(Incoming_value == 'A')
digitalWrite(27, LOW);
if(Incoming_value == 'b') // SzivattyĂş be
digitalWrite(28, HIGH);
else if(Incoming_value == 'B')
digitalWrite(28, LOW);
if(Incoming_value == 'c') // SzivattyĂş ki
digitalWrite(29, HIGH);
else if(Incoming_value == 'C')
digitalWrite(29, LOW);
if(Incoming_value == 'd') // Bal keret nyit
digitalWrite(30, HIGH);
else if(Incoming_value == 'D')
digitalWrite(30, LOW);
if(Incoming_value == 'e') //Bal keret csuk
digitalWrite(31, HIGH);
else if(Incoming_value == 'E')
digitalWrite(31, LOW);
if(Incoming_value == 'g') // Jobb keret nyit
digitalWrite(32, HIGH);
else if(Incoming_value == 'G')
digitalWrite(32, LOW);
if(Incoming_value == 'h') // Jobb keret csuk
digitalWrite(33, HIGH);
else if(Incoming_value == 'H')
digitalWrite(33, LOW);
if(Incoming_value == 'i') // Nagy keret nyit
digitalWrite(34, HIGH);
else if(Incoming_value == 'I')
digitalWrite(34, LOW);
if(Incoming_value == 'j') // Nagy keret csuk
digitalWrite(35, HIGH);
else if(Incoming_value == 'J')
digitalWrite(35, LOW);
// elektromos részek
if(Incoming_value == 'k') // Munka lámpa
digitalWrite(36, HIGH);
else if(Incoming_value == 'K')
digitalWrite(36, LOW);
if(Incoming_value == 'l') // Bal táblaszél szóró
digitalWrite(34, HIGH);
else if(Incoming_value == 'L')
digitalWrite(34, LOW);
if(Incoming_value == 'm') // Jobb táblaszél szóró
digitalWrite(35, HIGH);
else if(Incoming_value == 'M')
digitalWrite(35, LOW);
// ellenörző szervek
if(Incoming_value == 'w') // Kapcsolat kész
digitalWrite(49, HIGH);
else if(Incoming_value == 'W')
digitalWrite(49, LOW);
if(Incoming_value == 'q') // Művelet visszajelző
digitalWrite(51, HIGH);
else if(Incoming_value == 'Q')
digitalWrite(51, LOW);
}
}