# JawDuino Talking Skull



## mikkojay

Hello All, I made a little prototype today for an Arduino-based talking skull, and it worked well enough that I thought I would share.






There is a bunch of info on my website *HERE*

I am about fried from typing up documentation this afternoon, so if you want more in-depth detail, please check out the links on the website.

Thanks, Mike


----------



## Montclair

Massively awesome, Mike. I commented on the video already at YT so I won't repeat. Just another thank you, though. Cool stuff!


----------



## RoxyBlue

The live action aspect of this set up opens up a lot of opportunities for an interactive scene in a haunt.


----------



## IMU

This will be another project I'll try down the road. I knew you'd figure it out.


----------



## JeffHaas

I just ordered a couple of these little boards! Will try it out.


----------



## DarkOne

Ordered mine too. can't wait to try this out!


----------



## The Pod

Great little find there Mike!!! Ordered a few of those KA2284 boards to mess around with myself. Thanks for posting!


----------



## djgra79

Wow this is great!
As a n00b to animatronics, what motors are used to move the jaw? Is there another thread that has a bit of a how-to for this including all parts required, not just the music board?


----------



## PirateDex

Super slick, gonna have to order up some of those boards. Right now I am using a filter circuiton the input and some creative arduino map functions to get mine working even somewhat realistically.


----------



## DarkOne

djgra79, check out his website link in the first post...


----------



## Rick

I have not worked with arduinos before, but this looks like a great project. You mentioned that this is the development board. I assume that it is the UNO R3 ATmega 328P CH340G. Is that correct?


----------



## DVLSToy

I also, have not worked with this. I was gonna try the banger project but I think I could have alot more fun with this one! I just ordered everything to build 2 of these. 

Do you think this would be usable in a walgreens skeleton?


----------



## JeffHaas

Mikkojay,

I ordered a couple of the KA2284 LED boards and have been playing with the JawDuino project.

I'm trying to code it so that one Arduino can both trigger a variety of MP3 on the Catalex and also interpret the input from the KA2284 and operate the servo.

Right now I've got it in a state machine and it's not quite working right. Do you have this done yet? If not, I'm willing to email my code and collaborate on it.

Jeff


----------



## mikkojay

Jeff, what I have done is what I posted in the zip file online. Did you at least get that to work when piping in audio from a PC?
I am not 100% clear on what it is you are trying to accomplish with your project- is it just play an audio track when triggered? When triggered next, issue a "next" command?
-Mike


----------



## Montclair

Montclair is salivating, waiting for you guys to publish code that does all of the above.


----------



## JeffHaas

Mike,

Yes, I got your proof of concept code running. But I want to do more...

I want to have the entire project run by one Arduino. Parts would be:

- Arduino Pro Mini
- Catalex MP3 Board
- KA2284 sound meter
- Connection to servo

The Arduino would have a playlist of MP3s. It would tell the Catalex to play an MP3; you only need to send the Catalex a single serial command and then it takes over and plays the file. After sending that command, the Arduino would run your audio_update function to detect the levels from the sound meter and control the servo. Then there would be a pause, and then the Arduino would trigger another MP3, etc.

I have a similar setup running on one of Halstaff's earlier Picaxe boards, but that requires me to create the animation track on one of the stereo channels. And since we generate new audio tracks every year, animating them has gotten to be a chore. I used to do this with a Scary Terry board but I didn't like the way that animated the servo, so I've been looking for a better way for a few years. 

The fallback if I can't get this to work is to just use two Arduino Pro Minis, and have one manage the playlist and play the MP3s, while the other animates the servo.

Jeff


----------



## mikkojay

I think the part I was unclear on was whether this would be triggered, or just play files sequentially in a loop. You also mentioned a pause- it might me nice if that could be made configurable.

The thing with the Catalex is that you would likely want to use the serial uart's Rx and Tx in order to query the "playing/busy" status of the player. Either that, or you would have to tell the Arduino how long each track is- and that could be cumbersome.

You could also use a mdfly or DF-player. Those both have a TTL status pin that would simplify the logic of knowing whether or not a track is currently playing.

You could also use an approach to just measure how long the audio has been "silent". This is actually built into the JawDuino app code I zipped up on the web.

if((millis() - lastMsg) > sleepWindow)
detach_servos();

The code above was put in there to put the servos to sleep if no signal was detected within 2 minutes. You could possibly just substitute detach_servos() with a play_next() function, and change the sleepWindow variable to your desired timeout.

Do you think that might fly?
Lastly, are you going to use speaker-level or line-level signals to drive the peak meter?
-Mike


----------



## JeffHaas

I've got part of this working - I now have it so that the Arduino triggers the Catalex, and then animates the servo. I just had to move your audio_update function out of the the state machine section and into the main loop.

For this year, I think I'll play the files sequentially in a loop. I want to set up a playlist of six different blurbs, and then have each one play in order, pause for a while, then play another one. When it gets to the end of the playlist, it goes back to the top. 

For the Picaxe version, I coded it so that it picks randomly off the playlist without repeating before starting over, but that was wasted effort - no one noticed! So sequential playback it is.

I have a few of the Tenda players as well, but they're bigger and I'd prefer to use the Catalex.

I'm driving the audio meter directly from the Catalex right now, so I guess that's line level. I've been playing with the volume it puts out and the sensitivity on the audio board to see how things work.


----------



## JeffHaas

I have made progress, burning the midnight oil (how appropriate!)..I now have a playlist of mp3s, can play them in order, and animating the servo while they play. 

I still have a few things to check, and I want to add support for LED eyes that come on when the skull talks. That's the last thing I think.

Oh, and I'm going to see if I can have a pot that will allow you to adjust the pause on the Arduino with the prop in place.


----------



## mikkojay

Jeff, that sounds great! The LED's should be a piece of cake. 
I'm curious to see what you think of the audio-to-movement performance, and how it compares to other methods you have used before. Please make a vid of your project when you get it all tweaked out 
Thanks, Mike


----------



## JeffHaas

I got some more time this weekend...added the Led eyes, tested with a long silence after the track stops. The code is mostly done, now I have to drag out my talking skull and try it out. I may do a bake-off of the three different approaches to see how they compare.


----------



## Montclair

Hope you'll post some videos and share the code! Can't wait to see it!


----------



## JeffHaas

I have to go out of town for a business trip for the rest of this week. However, if you're interested in my version of the JawDuino, you'll need a Catalex MP3 board in addition to the Arduino and the KA2284 audio module. Just search Google for "Catalex serial MP3 player" to find one, they are under $6.00 delivered. 

My code is written for a "line greeter" I'll be using this year at the California Academy of Sciences party at Golden Gate Park. So it will support six mp3s of about ten seconds each, with a pause of twenty seconds before the next one plays.


----------



## JeffHaas

I've been experimenting with this setup. Overall, compared to the previous ones I've used, where you have to animate the skull with a tone track, this works well. However, as I tried out some of my old tone track animation tests, it's obvious that for some voice recordings, a tone track is superior - without the tone track, there will always be a few syllables that aren't as loud and don't trigger the audio board, but you'd expect the jaw to be open.

So the solution is pretty simple - test the mp3s you want to use and watch how the skull's jaw animates. For the sections where it doesn't open as much as you'd like, load the mp3 into Audacity, and make one of the stereo channels the "trigger" channel, and take the section that isn't loud enough and use the "Amplify" function (Effect menu > Amplify) to make it louder.


----------



## David_AVD

That's a great idea.


----------



## JeffHaas

OK, so I think I'm done. I've attached a zip file of the Arduino code and some instructions here. Please take a look and let me know if you have any questions.

Eventually I'll take more time to explain this but since we're already in the middle of September, I figured I'd get it out now.

NOTE: This is an intermediate electronics project! I don't explain a lot of things on a beginner's level.


----------



## JeffHaas

Here's a video that compares the JawDuino using just a voice track, to an mp3 where one track is test tones.






In it you can see that I still have everything in prototype form, I'll make a real Arduino shield later.


----------



## JeffHaas

A couple of notes on the code:

- I fixed it so that the mp3s could be much longer than 10 seconds each. The demo code is set up for mp3 #1 to be 48 seconds long. You can also make the pause after each mp3 longer too.
- Support for LED eyes is in the code, but the YouTube video above didn't have the eyes hooked up.


----------



## mikkojay

Jeff, That looks great! Thanks for sharing your ideas and code! I can see this greeter routine coming in handy in a bunch of scenarios.
-Mike


----------



## Montclair

You can also use one of the compressor effects in Audacity to make the volume of all speaking parts the same. Theoretically, it would remove the necessity of any manual editing of the file, bring the high parts down, and the low parts up. You could run an amplify pass after that if your compressor settings were slightly off, the bring the whole track up. Google Audiacity compressor, for more info.


----------



## Montclair

I'm wondering if it would be possible to modify this to work with the gemmy skulls that run off the DC motor, instead of a servo motor. I've just seen Jeff's videos on this and read his instructible. I've got several of those skulls lying around that I picked up for $4 a few years ago.


----------



## JeffHaas

I wondered that myself. The Instructable works and is cheap, you just need an Arduino clone and a Catalex board to play back the MP3s, along with the DC motor board. 

The greeter code I provide can have its servo support taken out so it only plays back the MP3s, feed that into the DC motor board to make a Gemmy skull do the same thing as a servo skull.

There may be a way to adapt the JawDuino code to do this, but there's too much stuff coming up, so I'll wait until after Halloween to experiment. If you really want, I can take out the JawDuino servo stuff in the greeter code.


----------



## Montclair

Nah, I can modify the code myself, but thank you. However, you're right, and time is drawing short now. Perhaps the simplest way to animate one of those for now would be to just use a fourbanger and let the relay do the job. I'm sure we've all got enough on our plates right now. Nice work, though, Mike and Jeff.


----------



## JeffHaas

I found an extra stereo-to-RCA cable and realized I could hack it to add the connection to the KA2284 LED sound meter. One of these, which seem to come with various electronic gadgets:
http://www.jameco.com/z/255-045-Ste...-To-2-RCA-Male-Plugs-6-Foot-Cable_228401.html

Strip one of the wires several inches from the stereo plug, and splice in the connection to the sound meter. Done!


----------



## abner135

mikkay

can you post the full the full Arduino sketch for dose of us who don't known anything about
arduino thank you

abner135


----------



## Batbuddy

Jeff and Mike, Awesome stuff. I will be ordering the meter boards and joining you in the fun. Might not make it this year, but after Halloween I will keep working with it. Thanks guys for your work on this.


----------



## mikkojay

Hey Kenny, glad you found this . I actually used a spin off of this while hacking another store-bought prop this weekend. I had this "magic mirror" that is just a one way piece of glass in front of a light up skull. Anyway, it was cool except that the audio clip was Really stupid! I used one of these meters along with a DF MP3 player & a pnp transistor to make the skull glow in sync with my own audio. I even used a dremel to make an SD card slot so I can swap audio files in the future.

I am sure that as time goes on, we will find all kinds of ways to use these little things.

-Mike


----------



## JeffHaas

Hi Mike,

A friend suggested I write up some of my projects for Nuts & Volts magazine. I thought that my use of your Jawduino code and the how it got turned into a display would be a good idea, to show readers how I adapted someone's work and combined it with my own. 

Before I contact the magazine, I'd like to ask your permission - I would credit you with the original code and link to your website, and also explain what I added and how it was implemented.

Jeff


----------



## mikkojay

Hey Jeff, that sounds great- I'd be honored  I think the way you adapted pieces of a few different projects into a cool creation of your own really embraces the spirit of the magazine (from what I have read). A nut here, a volt there, mix with ambition and creativity, then viola- something awesome 

Thanks, Mike


----------



## JeffHaas

Mike, I heard back from Nuts & Volts and the editor is interested in the article. Now to clear some time to write it...


----------



## BJS

Hey guys great write up and awesome ideas. I'm used to using VSA and after last year I want to use something new. Do you think it would be difficult to add random servo movement to other servos with out messing up what is already going on. I'm new to Arduino and have been comparing the JawDuino to the State Machine code and not sure where i could sneak that in. Any help or suggestions would be great. 
Great job and thanks again for sharing.


----------



## ged281

Thanks for the easier and cheaper alternative to a talking skull. I am wondering how to code in a PIR into the mix of it?


----------



## joeyfinnz

*Motor Angle Limits*

This is my first every Arduino project and it's been great so far. Thanks for sharing! However with very limited programming experience, I am stuck. It appears that the motor max/min angles are not updating using the min/max parameters at the end of the code so I could use a nudge of help here.

I'd also like to add an LED to blink when triggered by audio. Where's a good place to start for that?


----------



## Jnagy197163

mikkojay said:


> Hello All, I made a little prototype today for an Arduino-based talking skull, and it worked well enough that I thought I would share.
> 
> 
> 
> 
> 
> 
> There is a bunch of info on my website *HERE*
> 
> I am about fried from typing up documentation this afternoon, so if you want more in-depth detail, please check out the links on the website.
> 
> Thanks, Mike


Hi Mike
This is really cool. How can one use an SD card with sound controlling the skull??
Thank you . I am a total nOOb to the arduino and coding. I've bought the recommended parts. Love you work.


----------



## Batbuddy

Jnagy197163 said:


> Hi Mike
> This is really cool. How can one use an SD card with sound controlling the skull??
> Thank you . I am a total nOOb to the arduino and coding. I've bought the recommended parts. Love you work.


Check out this thread as it is more geared to the Noobie
https://www.hauntforum.com/showthread.php?p=920614#post920614


----------



## cashley1

To resurrect this post, I have built this project and uploaded the code. For some reason my servo just pulses back and forth a few degrees. If I hit the servo test it stops and does nothing. Haven't ran into this before. The code is exactly how it was included.


----------



## TerrorTech

What board and pin number are you using?


----------



## cashley1

I've tried an uno and a nano. Servo is D2. I have the LED inputs coming into A0, A1, and A2. I'm not sure if I'm missing a library somewhere.


----------



## cashley1

I've got it to do a test sweep but once I put a signal to the LED's it stops working. I have to reset to get the test to sweep again. I can adjust the minimal settings and have it respond.


----------



## TerrorTech

If it outputs the sweep fine then it must be an issue with the audio in. I would add some serial commands in the code and see what values you're getting for the analog reads and the audio_value.


----------



## cashley1

Sorry for the few days before replying, I was out of town for a few days. I added an serial print for analog A0 and also for the audio_value. I am getting the analogRead below the 341 threshold and the audio_value is changing accordingly. So I can see that all of the inputs are acting accordingly but still no servo movement. The servo is powered from an external power source and connected to pin 2. I have tried an uno, 2 nanos, 2 servos, and 2 peak meters. Not really sure what else I am missing now.



Code:


/***********************************************************
08-14-2016 Mike North This is a little proof of concept 
to make a servo move in sync with audio.
*******************/
#include "SoftRcPulseOut.h"
#define TEST_PIN 11 //pin 11 set to ground will kick off the servo sweep test
int audio_value = 0;
long lastMsg = 0;
long sleepWindow = 300000; //if 5 minutes go by with no signal, then put the servos to bed
SoftRcPulseOut servo;
volatile boolean servosEnabled = false;
volatile boolean ledsOn = true;
volatile unsigned long currentTime = 0;
volatile unsigned long lastLEDtime = 0;
unsigned long resetWait = 120000; //servos sleep if not changed within this time frame (120 secs)

void setup()
{
	set_minmax();
	pinMode(TEST_PIN,INPUT);  //pin 11 will be 
	digitalWrite(TEST_PIN,HIGH); //assign pull-up resistor
  Serial.begin(9600);
} 

void loop()
{
  servo_test();
  audio_updates(); //read sample from audio input and apply average to buffer
  if(servosEnabled) 
  {
	action(); //servos are handled in the action loop
	SoftRcPulseOut::refresh();
	if((millis() - lastMsg) > sleepWindow)
	  detach_servos();
  }
} 
void attach_servos()
{   // attach the pin to the servo object
    servo.attach(2);
    servosEnabled = true;
}
void detach_servos()
{   // detach the servo objects
    servo.detach();
    servosEnabled = false;
}
void servo_test()
{
	if(digitalRead(TEST_PIN) == HIGH) return;
	attach_servos();
	SoftRcPulseOut::refresh();
	for(int i = 0; i < 360;i++)
	{
		if(i < 180)
			audio_value = i;
		else
			audio_value = 359 - i;
		action();
		for(int i = 0; i < 10; i++)
		{
		   delay(1); 
		   SoftRcPulseOut::refresh();
		}
	}
	detach_servos();
}
void audio_updates()
{
	audio_value = 0;
	if(analogRead(A0) < 341) audio_value += 60;
	if(analogRead(A1) < 341) audio_value += 60;
	if(analogRead(A2) < 341) audio_value += 60;

	if(audio_value > 0) 
	{
		lastMsg = millis(); //save the time stamp from when we last had some action
		if(!servosEnabled)attach_servos();
	}
}
void action() { 
  if (!servosEnabled) attach_servos();
  servo.write(audio_value);
  SoftRcPulseOut::refresh();
  Serial.println(audio_value);
  Serial.println(analogRead(A0));
  delay(500);
} 
void set_minmax()
{
	//set the first parameter in the following functions to a number between 0 and 180.
	//I used 92 and 72 in my tests to give about 20 degrees of motion.
	//You may swap the large and small numbers to reverse direction.
	//Just play with them, upload the code, then ground pin 11 to run the sweep test.
	// Be sure to only play with these numbers while the jaw linkage is disconnected,
	//  otherwise, you risk hitting mechanical limits and damaging your linkage or servo!
	servo.setMinimumPulse(map(10,0,180,512,2400));
	servo.setMaximumPulse(map(170,0,180,512,2400));
}


----------



## neverhart

Have you tried a different pin? Servos need PWM pins, so 3,5,6,9,10,11 on an UNO. (Usually indicated with a ~ next to the pin.)


----------



## cashley1

Yes I've tried pin 2, 3, and 4. In all pins I can get the servo test to sweep but nothing happens when a signal is added to the peak monitor. I have read the analog inputs as well as the audio_updates to verify that information is being received in. The only things I can see are either the servo is not getting enabled during the action() or the servo.write is not writing the audio_value. I can adjust the min/max and have the servo respond during the sweep test. I could run the servo test but when I added a signal to the peak meter, I would have to reset the Arduino to be able to run the servo test again. I edited the action() to remove the if(servosEnabled) show below in red. When I made that edit I can run the servo test even after adding a signal without having to reset the Arduino.


Code:


void audio_updates()
{
	audio_value = 0;
	if(analogRead(A0) < 341) audio_value += 60;
	if(analogRead(A1) < 341) audio_value += 60;
	if(analogRead(A2) < 341) audio_value += 60;

	if(audio_value > 0) 
	{
		lastMsg = millis(); //save the time stamp from when we last had some action
		[COLOR="Red"]if(!servosEnabled)attach_servos();[/COLOR]
	}
}


----------



## Greg G

Try commenting out the call to servo_test() and add a Serial.println of audio_value right before the servo.write(audio_value) is called (to confirm if audio_value is what you expect) and see what happens.


----------



## Greg G

Opps, I do see you print the audio value after that write so never mind about that println I suggested. Also, not sure about the specific servo you are using but shouldn't the refresh be called at least every 20 milliseconds (the delay(500) would seem to violate that).


----------



## Greg G

Another thing to try is to keep the servo_test commented out, and don't read the analog inputs but toggle the audio_value every 500 milliseconds (not using delay(500) but reading the millisec timer to do this) between two values to see if that works. Then try reading the analog inputs but don't use them (leave the predetermined toggling audio value in ) to see if that still works. That call to SoftRcPulseOut::refresh() will only update the servo if 20 milliseconds have passed since the last call to it, or you call SoftRcPulseOut::refresh(true)


----------



## cashley1

I added a Serial.println(!servosEnabled) to attempt to see if I can determine when the servos are enabled vs disabled.


Code:


void action() { 
  servo.write(audio_value);
  Serial.println(!servosEnabled);
  SoftRcPulseOut::refresh();
}

With this code I can see a steady state of 1. When I run the servo test it will enable the servo and change state to 0 during the test and return to 1 once the test is complete. When I trigger the peak meter the servosEnabled stays at 1 and never changes to 0. My thinking is that the servos are not being enabled. If I trigger the peak meter during the servo test the servo will not moving until I remove the signal.


----------



## Greg G

So you need the if(!servosEnabled)attach_servos(); put back in audio_updates() otherwise the main loop never enters the " if(servosEnabled) ..." then part. Also put a log in the detach_servos method to know when the servo is detached.

void loop()
{
servo_test();
audio_updates(); //read sample from audio input and apply average to buffer
if(servosEnabled) 
{
action(); //servos are handled in the action loop
SoftRcPulseOut::refresh();
if((millis() - lastMsg) > sleepWindow)
detach_servos();
}


----------



## cashley1

I added code to turn on the builtin led when the attach_servo() is triggered and turn of the led when the detach_servo() is triggered.


Code:


void attach_servos()
{   // attach the pin to the servo object
    servo.attach(2);
    servosEnabled = true;
    digitalWrite(LED_BUILTIN, HIGH);
}
void detach_servos()
{   // detach the servo objects
    servo.detach();
    servosEnabled = false;
    digitalWrite(LED_BUILTIN, LOW);
}

When I run the servo test the LED comes on and when the test stops it goes off. When I trigger the peak meter the LED stays off. I don't believe that the problem lies within the void action() section since this is also triggered during the servo test. I'm at a loss on this one. Is it possible to have too much chatter coming from the peak meter causing it to fluctuate so much that it can not move the servo? When I Serial.println within the audio_updates() reading at "full speed" I notice a lot of jumps. When I disconnect the jumpers coming from the peak meter at my Arduino the serial monitor goes steady.


----------



## Greg G

Can you show me the current code you have as of right now for the .ino file? I'm getting a little confused with all the changes. So based on your addition of the LED control to the attach_servos and detach_servos, if the LED stays off then either the servo is detached all the time or detached most of the time as the LED appears so dim it looks off. Calling servo.write will have no effect if the servo is detached as you probably surmised (plus if you still have the test if(servosEnabled) in the main loop it won't even call action() if the servo is not enabled) . I would comment out the code in the main loop that detaches the servo due to a timeout so you can be sure that is not doing it. Then if the LED stays off then audio_value is never getting > 0 to attach the servo.


----------



## Greg G

Try this and see what you observe.



Code:


/***********************************************************
08-14-2016 Mike North This is a little proof of concept 
to make a servo move in sync with audio.
*******************/
#include "SoftRcPulseOut.h"
#define TEST_PIN 11 //pin 11 set to ground will kick off the servo sweep test
int audio_value = 0;
long lastMsg = 0;
long sleepWindow = 300000; //if 5 minutes go by with no signal, then put the servos to bed
SoftRcPulseOut servo;
volatile boolean servosEnabled = false;
volatile boolean ledsOn = true;
volatile unsigned long currentTime = 0;
volatile unsigned long lastLEDtime = 0;
unsigned long resetWait = 120000; //servos sleep if not changed within this time frame (120 secs)

void setup()
{
	set_minmax();
	pinMode(TEST_PIN,INPUT);  //pin 11 will be 
	digitalWrite(TEST_PIN,HIGH); //assign pull-up resistor
  Serial.begin(9600);
} 

void loop()
{
  servo_test();
  audio_updates(); //read sample from audio input and apply average to buffer
  if(servosEnabled) 
  {
	action(); //servos are handled in the action loop
	SoftRcPulseOut::refresh();
//	if((millis() - lastMsg) > sleepWindow)
//	  detach_servos();
  }
} 
void attach_servos()
{   // attach the pin to the servo object
    servo.attach(2);
    servosEnabled = true;
    Serial.println("Servo Attached:");
}
void detach_servos()
{   // detach the servo objects
    servo.detach();
    servosEnabled = false;
    Serial.println("Servo Detached:");
}
void servo_test()
{
	if(digitalRead(TEST_PIN) == HIGH) return;
	attach_servos();
	SoftRcPulseOut::refresh();
	for(int i = 0; i < 360;i++)
	{
		if(i < 180)
			audio_value = i;
		else
			audio_value = 359 - i;
		action();
		for(int i = 0; i < 10; i++)
		{
		   delay(1); 
		   SoftRcPulseOut::refresh();
		}
	}
	detach_servos();
}
void audio_updates()
{
	audio_value = 0;
	if(analogRead(A0) < 341) audio_value += 60;
	if(analogRead(A1) < 341) audio_value += 60;
	if(analogRead(A2) < 341) audio_value += 60;

	if(audio_value > 0) 
	{
		lastMsg = millis(); //save the time stamp from when we last had some action
		if(!servosEnabled)attach_servos();
	}
}
void action() { 
//  if (!servosEnabled) attach_servos();
  servo.write(audio_value);
  SoftRcPulseOut::refresh();
 	Serial.print("AudioVal:");
	Serial.println(audio_value);
//  Serial.println(analogRead(A0));
  delay(500);
} 
void set_minmax()
{
	//set the first parameter in the following functions to a number between 0 and 180.
	//I used 92 and 72 in my tests to give about 20 degrees of motion.
	//You may swap the large and small numbers to reverse direction.
	//Just play with them, upload the code, then ground pin 11 to run the sweep test.
	// Be sure to only play with these numbers while the jaw linkage is disconnected,
	//  otherwise, you risk hitting mechanical limits and damaging your linkage or servo!
	servo.setMinimumPulse(map(10,0,180,512,2400));
	servo.setMaximumPulse(map(170,0,180,512,2400));
}


----------

