0% found this document useful (0 votes)
6 views2 pages

Program Arduino Cat Food Otomatic

The document describes an Arduino program for an automatic cat food dispenser. The program uses a servo motor controlled by an Arduino to dispense cat food when a button is pressed. It also uses LEDs and sensors to detect when the button is pressed and control the dispensing operation.

Uploaded by

Asu Asu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Program Arduino Cat Food Otomatic

The document describes an Arduino program for an automatic cat food dispenser. The program uses a servo motor controlled by an Arduino to dispense cat food when a button is pressed. It also uses LEDs and sensors to detect when the button is pressed and control the dispensing operation.

Uploaded by

Asu Asu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

PROGRAM ARDUINO CAT FOOD OTOMATIC

#include <Servo.h>

int CatButton; //

Servo servo1; // servo Servo

void setup() {

pinMode(3, OUTPUT); // 3

pinMode(11, OUTPUT); //

servo1.attach(9); //

//

analogWrite(11, 20); //

servo1.write(10); //

delay(250); //

analogWrite(11, 0); //

void loop() {

CatButton = analogRead(A0); //

if (CatButton > 700) { //

analogWrite(11, 20); // ()

digitalWrite(3, HIGH); //

servo1.write((map(analogRead(A1), 0, 1024, 0, 180))); //

delay(250); //

servo1.write(10); //
delay(250); //

digitalWrite(3, LOW); //

analogWrite(11, 0); //

delay(500); //

You might also like