Final Code - Still Need Help, Thanks.

Imagine you received “4444”.
What do you think if (Serial.available() < 4) is going to do for you?

Please see reply #17

This is your project.

Try to get things to work.

Change the sketch, if it doesn't work explain what is not working, show us the new sketch, we will try to help out.

.

its not going to accept it. it will ignore it. Thats what i want. The chars I want to write to the servo is in the range of 1-180 or in this case I think I have it set to 70-110. I didn't need that much travel.

{
int input = Serial.parseInt();
if (input < 4);
{
MyServo.write(input);
delay(30);
}

Did not work. Cmon guys help plz.

Can I suggest that you stop, think and rewrite?

It strikes me you're doing an awkward form of in-band signalling that depends on all digits, that is going to trip you badly.
If you pause and start using simple single non-numeric delimiters (like 'a', 'b' etc) and numerics, everything will get a bucket-load simpler.

Serial.parseInt() will retrieve an integer from data received.

Once you receive a certain amount of data, parseint can return an integer from that data.

.

Right LarryD,

{
int input = Serial.parseInt();
if (input < 4);
{
MyServo.write(input);
delay(30);
}

input should be that int. right?

 if (input < 4);

FFS go to bed NOW

You check the number of received characters with 'available'.
When you receive the number defined in your protocol, let's say 3, you can then retrieve the equivalent integer value with 'parseint'.
Then you can send that integer to the servo.

Sleep on it.
.

I need a dam answer that I can understand or a place to read up and learn the background to what i lack. you guys suck! point me to the answer. explain the answer or you go to bed! im not stupid!~

We suck? You’re not stupid?if (input < 4);Right.

Go back to basics, build some solid foundations. Come back to us with some sensible questions

"I need a dam answer that I can understand or a place to read up and learn the background to what i lack. you guys suck! point me to the answer. explain the answer or you go to bed! im not stupid!~"

Have a good life, goodbye.

.

Well hopefully Ill find someone who has the patience to give a better answer. If you cannot teach someone with my IQ maybe your bright just not real good at helping? Thanks anyway.

Hopefully, you'll pause, go back to basics, learn some simple C syntax, and rewrite your code, instead of digging a deeper and smellier hole.

That's me being helpful

This isn't basic C programming? Dang Dang I am always in the wrong class. My bad.

code works thanks to some help i got elsewhere. Not amused guys.