Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: StepperMotors mbed CNCAirbrush Servo
Revision 1:f3fda065e614, committed 2012-05-04
- Comitter:
- stretch
- Date:
- Fri May 04 06:25:59 2012 +0000
- Parent:
- 0:ba40c5f30cf0
- Commit message:
Changed in this revision
diff -r ba40c5f30cf0 -r f3fda065e614 CNCAirbrush.lib --- a/CNCAirbrush.lib Sat Apr 28 21:11:15 2012 +0000 +++ b/CNCAirbrush.lib Fri May 04 06:25:59 2012 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/stretch/code/CNCAirbrush/#27e403b8981e +http://mbed.org/users/stretch/code/CNCAirbrush/#e16f55e9dcd3
diff -r ba40c5f30cf0 -r f3fda065e614 StepperMotors.lib --- a/StepperMotors.lib Sat Apr 28 21:11:15 2012 +0000 +++ b/StepperMotors.lib Fri May 04 06:25:59 2012 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/stretch/code/StepperMotors/#3058939fa37c +http://mbed.org/users/stretch/code/StepperMotors/#cf60b60a1b5b
diff -r ba40c5f30cf0 -r f3fda065e614 main.cpp
--- a/main.cpp Sat Apr 28 21:11:15 2012 +0000
+++ b/main.cpp Fri May 04 06:25:59 2012 +0000
@@ -8,6 +8,10 @@
#define PAN_RANGE 0.0009
#define PAN_DEGREE 90
#define PAN_CENTER 0.0002
+#define STEPS_PER_PIXEL_DEFAULT 600
+#define INITIAL_DELAY_DEFAULT 1200
+#define STEP_BUFFER_DEFAULT 4
+#define DEFAULT_FEEDRATE 200
LocalFileSystem local("local");
Serial pc(USBTX, USBRX);
@@ -79,10 +83,12 @@
pc.baud(460800);
printf("Test Airbrush!\r\n");
linearMotion.setStepMotors(&x, &y, &z, &solenoid, &paused, &stopped);
+ linearMotion.updateSettings(STEPS_PER_PIXEL_DEFAULT, INITIAL_DELAY_DEFAULT, STEP_BUFFER_DEFAULT);
wifi.createAdhocNetwork();
wifi.attach_interrupt(0x09, pause, 0);
wifi.attach_interrupt(0x0a, stop, 1);
led = 1;
+ long paintingFeedrate = DEFAULT_FEEDRATE;
while (1) {
while (pc.readable()) {
wifi.putc(pc.getc());
@@ -130,7 +136,7 @@
cmd->l[4],
cmd->l[5]};
pc.printf("Paint the image with corners at (x:%d, y:%d, z:%d), (x:%d, y:%d, z:%d) and (x:%d, y:%d, z:%d)\n\r", x.getPosition(), y.getPosition(), z.getPosition(),baseVector.x,baseVector.y,baseVector.z,heightVector.x,heightVector.y,heightVector.z);
- linearMotion.interpolateSquare(baseVector,heightVector,200,true);
+ linearMotion.interpolateSquare(baseVector,heightVector,paintingFeedrate,true);
break;
}
case 0x04: { //change the pan
@@ -145,7 +151,12 @@
pc.printf("Change the tilt to %f\n\r",tilt);
break;
}
-
+ case 0x06: {
+ linearMotion.updateSettings(cmd->l[0], cmd->l[1], cmd->l[2]);
+ paintingFeedrate = cmd->l[3];
+ break;
+
+ }
case 0x07: { //turn on the solenoid
long t = cmd->l[0];
if (t)