Recipe

In case someone was wondering how the electromechanical writing aperatus below works, here are the main ingredients:

-Arduino board

-Breadboard

-2 Potentiometers

-Wire

-A dash of skill

CODE:

#include <Servo.h>

Servo myservox;
Servo myservoy;
int potpinx = 0;
int potpiny = 1;
int valx;
int valy;

void setup()
{
myservox.attach(9);
myservoy.attach(10);
}

void loop()
{
valx = analogRead(potpinx);
valy = analogRead(potpiny);
valx = map(valx, 0, 1023, 0, 179);
valy = map(valy, 0, 1023, 0, 179);
myservox.write(valx);
myservoy.write(valy);
delay(15);

}

Advertisements

Leave a comment

Filed under Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s