Instructables

Conducting foam controlled servo's

video Conducting foam controlled servo's
This video shows the use of conducting foam as an input for the Arduino Duemilanove. The output consists of 2 servo's which, eventually, will control a robotic hand.
The conducting foam was taken from a pcb-case (originally to prevent static build up).
The Arduino scetch is found in extended->servo->knob and doubled (or tripled etc.) for control of more than 1 servo.

http://www.youtube.com/watch?v=Yfiv_CDozds
Thanks very much for the code, I'll try it later, no time this week. Anyway I'll let you know how it works !
etopsirhc3 years ago
nice idea , but u might wanna smooth out the shakiness in the servos
witch can easily be done with an if statement and some math .
lemme know if u want to know the code , even though idk if it is arduino compatable ( c++ code like)
I'm an electronics man myself so any code to improve the electronics is welcome !
heres an example for a single servo and input

i did a little research on how arduino works  so it may actualy work right away , but its compleatly untested


#include <Servo.h>

Servo myservo;

void setup() 
{ 
  myservo.attach(9);
  myservo.write(90);  // set servo to mid-point
} 
void loop() {

int calibrate = [ a number to mess around with ]
int an0 = map(analogRead(0) , 0,1025 ,0,180)

If (an0 => (an0 + calibrate )  )
{
   myservo.write(an0 )
}
else if ( an0 =< (an0 - calibrate ) )
{
   myservo.write(an0 )
}

}


what this does is checks to see if the the analog pin ( after being mapped to work with a servo ) is within [calibrate] range . if its not in that area , it will change the servo's position ... i hope

lemme know if it works =D
>< just noticed

add a semi colon to the end of every statement except the if , and else if

example :

void loop() { <--- not here

int calibrate = 5 ; <---- here

If (an0 => (an0 + calibrate ) ) <--- not here
{
myservo.write(an0 ) ; <--- here too
}
Bongmaster3 years ago
what vid?
Renaissance-man (author)  Bongmaster3 years ago
Sorry, I'm a newbie here, must be ok now !
yup its there
Renaissance-man (author)  Bongmaster3 years ago
!!!! Coincidence : I see you're in Norway, so am I at the moment (well out on the North Sea that is...).
kools, im in the north XD