Tag Archives: cat

Does Charlie Even CARE?!

For my stupid pet trick I decided to make a board that tested whether or not my cat was interested in sniffing the Arduino. To my surprise, the buzzing of the motor got her interested enough to try the setup out for herself!

Playing with Cardboard

Charlie gets in on the action

 

#include <Servo.h>    
Servo servoMotor;      
void setup(){
  Serial.begin(9600);
  pinMode(12,OUTPUT);

  servoMotor.attach(2);  
}

void loop()
{
  digitalWrite(12,HIGH);
  int analogValue = analogRead(A0); 
  Serial.println(analogValue);    

int servoAngle = map(analogValue, 15, 122, 0, 179);
Serial.println(servoAngle);

servoMotor.write(servoAngle);
}