Window Painting Robot (arduino, processing, accelerometer) by Mizchief100
Featured

Step 8: Processing

proc.PNG
processingProgram.PNG
processingProgram2.PNG
proc2.PNG
Like I talked about earlier, I have designed a processing interface that will easily turn drawings into code for the robot to follow. To start the program simply download the processing sketch below, and open it using Processing. (For those who have never used processing or arduino search for the basics about them in the instructable's search bar). Just click run (it looks like a play button on a remote) and the program will open. (In the video on the first page you can see me doing exactly this).

The program only requires 4 pieces of information (5 if using an accelerometer) before you can start drawing: the time it takes your robot to do a complete 360 degree turn, the speed of your robot (cm/s), the window height, and the window width. If using an accelerometer the 360 turn time is not needed, but rather the max and minimum values for your accelerometer are specified. These are all crucial to having an accurate drawing. In the program just click on the buttons (such as window height or robot speed) to change the values. A left click increases the values and a right click decreases a values. Once you have completed the setup click the "Done" Button. A small scale version of your window will appear.

Before drawing be sure to click on the "Homepoint" button and drag it onto the mock window. Wherever you release it a small red circle will appear, this is the place that your robot must be placed to start the drawing, and it will return to that spot at the end of the drawing. 

Now to start drawing simply click and drag in the scale version of the window. Where you first click the mouse will be the start point of the line and where you release will be the end point of the line. There is also an "Undo" button in case of mistakes! Wherever you see a white line is where the robot will lower the pen and draw, between those lines it lifts the pen and moves to the start of the next drawn line. 

Once you have completed the drawing simply click the "Generate Code" button. In the bottom of the original processing sketch (the one with the code in it), a bunch of arduino commands will appear (Should say things like angleLeft(); or drive();). Scroll up to where the commands start and use ctrl - c / v to copy them all. This will be used with the arduino in the next step. (If using the accelerometer program the first command will be calibrate(values here); as this gives the robot your max and min accelerometer readings.

All the Arduino and Processing sketchs can be downloaded HERE
 
Remove these adsRemove these ads by Signing Up
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!