Newbe in trouble!

Hi everyone..let me first explain I'm very...very new to the arduino!...im just want to make a one off project to control a servo. I found exactly what I want with the VarSpeedServo sketch which I downloaded..I think but every time I try to do a simple sketch it always comes back with an error!!!...I'm just looking to do a very simple sketch to control one servo from.. 0 to 90 degrees Delay 1 second 90 to 180 degrees Delay 1 second

Repeat

I've copied sketches off you tube ect but always come back with a error!

Can anyone of you professionals show me a complete program that will do this simple task as I'm getting very close to smashing the laptop up!!

It would be sooooooo much appreciated.....thanks

Post the program you have and perhaps someone can spot your error.

brett100:
0 to 90 degrees
Delay 1 second
90 to 180 degrees
Delay 1 second

Repeat

The repeat at the end would imply that the servo at some point went back to 0. Or does it need to reverse itself? Can you be more specific about the requirements here?

Hey thanks for the quick replies!..as I've said I've copied ones off of utube but all of them come back with a error!...could it be a problem with the library that I have down loaded ?...it shows up in my library as VerSpeedServo but are there different versions?....also I've just installed the new arduino upgrade so maybe they are not comparable?

Post your code so that we can see what you are doing.

it shows up in my library as VerSpeedServo

Is that exactly what the library folder is named ?

brett100: could it be a problem with the library that I have down loaded ?...

How the hell would anyone here know without knowing what library you are talking about or what code you copied? Until you give us some code to look at you're on your own trying to find the problem. Why is this hard to understand?

Ok sorry but I have explained that this is all very new to me…

So I go into sketch>include library…contributed library …VarSpeedServo

This is a sketch that I just copied off YouTube …

#include <VarSpeedServo

VarSpeedServo servo1;

const int servo1Pin = 7;

void setup() {
servo1.attach(servo1Pin);

servo1.write(0,255,true);

delay(3000);

}

void loop() {
servo1.write(180,10,true);
delay(10);

servo1.write(10,255,true);
delay(1000);

}

This is word for word as I’ve not worked out how to copy it on here.

When I enter “verify”. It comes up with a error code…

no matching function for call to ‘VarSpeedServo::write(int, int, bool)’

Hope this all makes sense

Thanks

Just to add..

Orange....VarSpeedServo attach write delay

blue....void const int

Pink line comes across servo1.write(10,255,true),

..when verified is entered

Cheers

#include <VarSpeedServo

That statement is incomplete.

Have you tried the servo examples that are included with the IDE?

Sorry PaulS that my my typo error...

And aarg there is not a VarSpeedServo examples in my IDE......???

Really grateful for the help though..cheers.....but this laptop is defo on the the way out the window soon!!...haha

brett100: .but this laptop is defo on the the way out the window soon!!

What an appropriate and grown-up thing to do.

Why don't you read some of the tutorials on this site about using servos? There are several. Even one example that does exactly what it appears as though you want to do. Instead of just blindly copying someone else's messed up code, learn how it works and write your own. This is basic level, should be easy for a beginner after a little reading.

Look up towards the top of this window. See where it says, Buy Download Products Learning Forum Support Blog. Click on Learning. You're on your way.

Thanks delta, and before 2 months ago I hadn't even heard of an arduino and believe me I have spent the last two months every night reading about these and trying to write my own programs but I'm just confused why one of mine will verify so that's why I chose to copy exciting YouTube examples...at some point you must have been in the same position..remember....and I'm only trying to understand and learn that's why I've asked...and as for being grown up..this is a school project and I am only 12!

Thanks

brett100: Thanks delta, and before 2 months ago I hadn't even heard of an arduino and believe me I have spent the last two months every night reading about these and trying to write my own programs but I'm just confused why one of mine will verify so that's why I chose to copy exciting YouTube examples...at some point you must have been in the same position..remember....and I'm only trying to understand and learn that's why I've asked...and as for being grown up..this is a school project and I am only 12!

Thanks

Hi Brett.

Welcome to the Arduino.

But, to help you, we have to see the EXACT code that you are trying to run. So, please copy it exactly, without any changes, from the Arduino IDE to this forum. And place the code inside code tags. Please read the "how to post to this forum" thread to learn how to post code correctly.

When done right, it should look like this:

... code here

The problem is, someone pointed out an error, and you said, "oh sorry, that's my typo". But, you are saying the compiler is saying you have errors. We cannot tell the difference between your copy and paste typos and the errors the compiler is complaining about. They all look like errors to us. So, you have to copy your code EXACTLY and put it here so that we can help you.

Delta_G: What an appropriate and grown-up thing to do.

like this response?

Brett,

It looks like your sketch might be trying to use this library:

https://github.com/netlabtoolkit/VarSpeedServo

That library is not included with the Arduino. It is made by a 3rd Party (that is, someone else). You need to download this library and put it in your libraries directory.