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.

PUPPET CONTROLLER

Step 3Mouth on computer screen

Mouth on computer screen
Now lets make a 'virtual' version.  This will show an animated 'mouth' on the computer screen.  For now I just want to get something working, so this code uses the X value from the mouse to determine the angle of the mouth opening.  Latter we'll jam the value form the flex sensor in here.

This uses Processing (from www.processing.org)  

//PROCESSING CODE
//pacman moouth opens/close with X input from mouse

float x = 0;
float val = 0;

void setup(){
size(200,200);
background(100);
smooth();
}

void draw(){
background(100); //clear last image
val = mouseX;
x = map(val,0,200,0.01,0.3); //translate values input to useful values
println(x);
arc(100,100,50,50,(x)*PI,PI+(1-x)*PI); //draw packman, using radians... p21

« 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!
42
Followers
18
Author:marc.cryan
Looking for access to land or water in Boston Metrowest area.