3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Computerized Etch a Sketch

Step 15Delicious!

delicious!
Well, I wish I had some half-decent code to share with you, but unfortunately all the programs I wrote for my etch-a-sketch were lost in the epic molasses flood of ought-7, where computer memory-erasing molasses poured through the streets of boston. Also, I am in LA now, and I left my etch-a-sketch in Boston.

here are a few examples, though, to get you started:

draw_square(int side)
{
pwm(255,0,1,0,side);
pwm(0,255,0,1,side);
pwm(255,0,0,0,side);
pwm(0,255,0,0,side);
}

//I use trig functions in this example, and you'll need to find some avr library that supports them
//or just whip up a table
draw_circle(int radius)
{
double x,y,xp, yp, int mag;
unsigned char xval, yval;
xp=radius;
yp=0;
unsigned char xdir,ydir;
for(double theta=0;theta<360;theta++)
{
x=radius*cos(theta);
y=radius*sin(theta);
if(x>xp)
xdir=1;
else
xdir=0;
if(y>yp)
ydir=1;
else
ydir=0;
angle=atan((y-yp)/(x-xp));
xval=255*abs(cos(angle));
yval=255*abs(sin(angle));
mag=sqrt(pow((y-yp),2)+pow((x-xp),2));
pwm(xval,yval,xdir,ydir,mag);
}
}

Foster the dog wishes you good luck in your programming endeavors!
Valerie the dog suggests you listen to DJ Z-trip. Wait, that's not Valerie. That's me.
« Previous StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
65
Followers
17
Author:prank
here: http://www.artiswrong.com But really, I'm just this guy. For up-to-the-minute, action-packed updates on my life (and occasional drawings of tapeworms getting it on), check out my blog here: ht...
more »