Go Down

Topic: Motor Timer (Read 2049 times) previous topic - next topic


Hello, I am a rookie, still do not quite understand everything that is programming.
I want to light a 9v motor, to ignite every 6 hours and must last for one minute . Can you help me?
I'm not very good at speaking English



Code: [Select]

const int MotorPin = 8;  // Arduino pin going to transistor

void setup() {
    pinMode(MotorPin, OUTPUT};

void loop() {
    digitalWrite(MotorPin, HIGH);  // Turn the motor on
    delay(60000);  //  Wait 60 seconds
    digitalWrite(MotorPin, LOW);  // Turn motor off
    delay(21600000UL - 60000UL);  // Wait 5 hours and 59 minutes
Send Bitcoin tips to: 1G2qoGwMRXx8az71DVP1E81jShxtbSh5Hp

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131