Created
December 13, 2019 09:01
-
-
Save Electronza/98e4cb62b019120fa02f206f0f4b9615 to your computer and use it in GitHub Desktop.
Gardena water valve with Arduino Uno
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************************************************************* | |
____ __ ____ ___ ____ ____ __ __ _ ____ __ | |
( __)( ) ( __)/ __)(_ _)( _ \ / \ ( ( \(__ ) / _\ | |
) _) / (_/\ ) _)( (__ )( ) /( O )/ / / _/ / \ | |
(____)\____/(____)\___) (__) (__\_) \__/ \_)__)(____)\_/\_/ | |
Project name: Gardena water timer controller using Arduino Uno | |
Project page: https://electronza.com/gardena-water-timer-controller-arduino-uno/ | |
Description: Gardena T14E, Arduino Uno, Ardumoto and some passive components | |
********************************************************************/ | |
int pwm_a = 3; //PWM control for motor outputs 1 and 2 is on digital pin 3 | |
int dir_a = 12; //direction control for motor outputs 1 and 2 is on digital pin 12 | |
void setup() | |
{ | |
pinMode(pwm_a, OUTPUT); //Set control pins to be outputs | |
pinMode(dir_a, OUTPUT); //Note that the PWM pin is used as a regular output pin | |
} | |
void loop() | |
{ | |
// turn on sequence | |
digitalWrite(dir_a, LOW); // set to turn on | |
digitalWrite(pwm_a, HIGH); // apply pulse | |
delay(500); | |
digitalWrite(pwm_a, LOW); // turn off pulse | |
//wait for about 10 seconds | |
delay(1000); | |
delay(1000); | |
delay(1000); | |
delay(1000); | |
delay(1000); | |
delay(1000); | |
delay(1000); | |
delay(1000); | |
delay(1000); | |
delay(1000); | |
// now turn it off | |
// turn on sequence | |
digitalWrite(dir_a, HIGH); // set to turn off | |
digitalWrite(pwm_a, HIGH); // apply pulse | |
delay(150); | |
digitalWrite(pwm_a, LOW); // turn off pulse | |
// again some delay | |
//wait for about 10 seconds | |
delay(1000); | |
delay(1000); | |
delay(1000); | |
delay(1000); | |
delay(1000); | |
delay(1000); | |
delay(1000); | |
delay(1000); | |
delay(1000); | |
delay(1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment