Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse Servo (Pen UP/Down) #26

Open
druckgott opened this issue Apr 6, 2018 · 1 comment
Open

Reverse Servo (Pen UP/Down) #26

druckgott opened this issue Apr 6, 2018 · 1 comment

Comments

@druckgott
Copy link

druckgott commented Apr 6, 2018

I had the Problem hat I want to reverse the servo.

So I change the code in setPen --> Change Case0 to Case 1 und Case 1 to Case 0

void setPen(){
int cmd;
int value;
char *arg;

moveToDestination();

arg = SCmd.next();
if (arg != NULL) {
	cmd = atoi(arg);
	switch (cmd) {
		case 1:
			penServo.write(penUpPos);
			penState=penUpPos;
			break;

		case 0:
			penServo.write(penDownPos);
			penState=penDownPos;
			break;

		default:
			sendError();
	}
}
char *val;
val = SCmd.next();
if (val != NULL) {
	value = atoi(val);
	sendAck();
	delay(value);
}
if (val==NULL && arg !=NULL)  {
	sendAck();
	delay(500);
}
//	Serial.println("delay");
if (val==NULL && arg ==NULL)
	sendError();

}

@Tschaske
Copy link

This is the right setting.
0 = down
1 = up
see http://evil-mad.github.io/EggBot/ebb.html#QP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants