ATtiny Robot Claw

Robot claw from Kepler (http://www.thingiverse.com/thing:18339) driven by an ATTiny85

The servo library is from Ilya Bruman – https://github.com/fri000/Servo8Bit

YouTube player

 

The attiny is prototyped using the TinyDuino from openhardware.co.za and comprise a distance sensor, servo motor and ATTiny 85

 

#include "Servo8Bit.h" 

Servo8Bit myservo;

void setup() {
  pinMode(0, OUTPUT);     // LED connected to pin0
  pinMode(2, INPUT);      // distance sensor connected to pin 2
  digitalWrite(0, LOW);   // Turn LED off
  myservo.attach(1);      // Servo connected to pin 1
}

void loop() {
  if(digitalRead(2) == LOW){ // if your finger is there
    digitalWrite(0, HIGH);   // turn on the led
    myservo.write(60);       // and grab it
  } else {
    digitalWrite(0, LOW);    // otherwise LED off
    myservo.write(150);      // let go
  }
}

This is the basic setup:

Robot claw from Kepler (http://www.thingiverse.com/thing:18339) driven by an ATTiny85 The servo library is from Ilya Bruman – https://github.com/fri000/Servo8Bit   The attiny is prototyped using the TinyDuino from openhardware.co.za and comprise a distance sensor, servo motor and ATTiny 85   #include “Servo8Bit.h” Servo8Bit myservo; void setup() { pinMode(0, OUTPUT); // LED connected to pin0 pinMode(2, INPUT); // distance…

Leave a Reply