-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
4,595 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
/** | ||
* EggBot Simple Write. | ||
* | ||
* Example code for talking to the EggBot from Processing. | ||
*/ | ||
|
||
|
||
import processing.serial.*; | ||
|
||
Serial myPort; // Create object from Serial class | ||
int val; // Data received from the serial port | ||
boolean PenDown; | ||
|
||
|
||
void liftPen() | ||
{ | ||
myPort.write("SP,0\r"); | ||
PenDown = false; | ||
} | ||
|
||
void lowerPen() | ||
{ | ||
myPort.write("SP,1\r"); | ||
PenDown = true; | ||
} | ||
|
||
|
||
|
||
|
||
void Up() | ||
{ | ||
myPort.write("SM,100,10,0\r"); | ||
//"SM,<duration>,<penmotor steps>,<eggmotor steps><CR>" | ||
} | ||
|
||
void Down() | ||
{ | ||
myPort.write("SM,100,-10,0\r"); | ||
//"SM,<duration>,<penmotor steps>,<eggmotor steps><CR>" | ||
} | ||
|
||
|
||
void Left() | ||
{ | ||
myPort.write("SM,100,0,10\r"); | ||
//"SM,<duration>,<penmotor steps>,<eggmotor steps><CR>" | ||
} | ||
|
||
void Right() | ||
{ | ||
myPort.write("SM,100,0,-10\r"); | ||
//"SM,<duration>,<penmotor steps>,<eggmotor steps><CR>" | ||
} | ||
|
||
|
||
void setup() | ||
{ | ||
size(800, 250); | ||
// I know that the first port in the serial list on my mac | ||
// is always my FTDI adaptor, so I open Serial.list()[0]. | ||
// On Windows machines, this generally opens COM1. | ||
// Open whatever port is the one you're using. | ||
String portName = Serial.list()[1]; | ||
myPort = new Serial(this, portName, 38400); | ||
|
||
liftPen(); | ||
background(255); | ||
} | ||
|
||
//String str1 = "SP,1\r"; | ||
|
||
|
||
void draw() { | ||
|
||
// myPort.write("SM,25,0,50\r"); | ||
//"SM,<duration>,<penmotor steps>,<eggmotor steps><CR>" | ||
|
||
// delay(500); | ||
// myPort.write("SM,25,0,0\r"); | ||
|
||
|
||
} | ||
|
||
|
||
|
||
void keyPressed() | ||
{ | ||
// if the key is between 'A'(65) and 'z'(122) | ||
if( key == ' ') | ||
{ | ||
|
||
if (PenDown) | ||
liftPen(); | ||
else | ||
lowerPen(); | ||
} | ||
|
||
if( key == 'u') | ||
{ | ||
Up(); | ||
} | ||
|
||
if( key == 'd') | ||
{ | ||
Down(); | ||
} | ||
|
||
|
||
if( key == 'l') | ||
{ | ||
Left(); | ||
} | ||
|
||
if( key == 'r') | ||
{ | ||
Right(); | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
|
||
StippleGen_2 | ||
|
||
SVG Stipple Generator, v. 2.02 | ||
Copyright (C) 2012 by Windell H. Oskay, www.evilmadscientist.com | ||
|
||
Full Documentation: http://wiki.evilmadscience.com/StippleGen | ||
Blog post about the release: http://www.evilmadscientist.com/go/stipple2 | ||
|
||
|
||
An implementation of Weighted Voronoi Stippling: | ||
http://mrl.nyu.edu/~ajsecord/stipples.html | ||
|
||
|
||
******************************************************************************* | ||
|
||
Change Log: | ||
|
||
v 2.02 | ||
* Force files to end in .svg | ||
* Fix bug that gave wrong size to stipple files saved white stipples on black background | ||
|
||
v 2.01: | ||
* Improved handling of Save process, to prevent accidental "not saving" by users. | ||
|
||
v 2.0: | ||
* Add tone reversal option (white on black / black on white) | ||
* Reduce vertical extent of GUI, to reduce likelihood of cropping on small screens | ||
* Speling corections | ||
* Fixed a bug that caused unintended cropping of long, wide images | ||
* Reorganized GUI controls | ||
* Fail less disgracefully when a bad image type is selected. | ||
|
||
******************************************************************************* | ||
|
||
Program is based on the Toxic Libs Library ( http://toxiclibs.org/ ) | ||
& example code: | ||
http://forum.processing.org/topic/toxiclib-voronoi-example-sketch | ||
|
||
|
||
Additional inspiration: | ||
Stipple Cam from Jim Bumgardner | ||
http://joyofprocessing.com/blog/2011/11/stipple-cam/ | ||
|
||
and | ||
|
||
MeshLibDemo.pde - Demo of Lee Byron's Mesh library, by | ||
Marius Watz - http://workshop.evolutionzone.com/ | ||
|
||
|
||
Requires ControlP5 library and Toxic Libs library: | ||
http://www.sojamo.de/libraries/controlP5/ | ||
http://hg.postspectacular.com/toxiclibs/downloads | ||
|
||
|
||
|
||
* This is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU Lesser General Public | ||
* License as published by the Free Software Foundation; either | ||
* version 2.1 of the License, or (at your option) any later version. | ||
* | ||
* http://creativecommons.org/licenses/LGPL/2.1/ | ||
* | ||
* This library is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this library; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
Oops, something went wrong.