I am using Processing to write commands to Firmata on an Arduino board. The command bytes flow without regard to handshaking or control characters, simply 8 bits of binay data.
The string of bytes, 0x91 0x20 0x00 (or 0x912000) will turn on the onboard pin 13 LED.
When I send a string with these bytes, the output actually sent to the Arduino is 0x3F2000 (observed with a sniffer on the serial port).
String s = {str(0x91),str(0x20),str(0x00)};
myport.write(s);
Serial write string uses Java getBytes(). Does this routine translate the data? Does the string data get translated somewhere such that 0x91 is converted to 0x3F?
Under the changes for Processing 2.0, I saw the following:
delay() has been removed. Nobody understood what it did, and when they did, they didn't understand why it was there. Huge source of confusion, especially for beginning students.
I don't understand this change. Lots of programs use delay(). I believe it exists in tutorials, examples, and educational material. I use it in lots of code to slow down the drawing so I can see it materialize. Otherwise, it finishes very fast and the visualization effect is lost. You should really leave delay() in the new version and let it continue to be used. You have a big task ahead to remove it from all existing published work.
Is there an alternative to delay() that I don't know about?
Where is the documentation for the File class or File library (if one exists)?
In some examples I have seen the following
File dir = new File("some-directory-name");
I know that selectFolder() can be used, and a system variable called sketchPath.
What other file oriented system varables are availble as well? I am really loking for enough information so I can traverse disks and directories, fild files,create files, open files, read and write files, or delete files.
I read the other discussion about the Processing temporary files, but have some separate observations and questions.
I have been using Processing for 3 months now and have thousands of these files. Space is not the issue but the burden on the file system and the amount of time it adds to the work of compiling a program. The directory names found in
users\...\appdata\local\temp
are obtuse. For example:
graphics1a31191575365824121temp
while the contents of this folder is simply:
graphics1a.java
The Processing IDE should provide some options for managing this fileset, including the ability to specify where to place the files (current location is seemingly a poor choice), an age limit (days to keep before deletion), and grouping (high level directory structure by sketch name), separating the random number from the sketch name (graphisc1a_nnn), and using the standard suffix of 'tmp' so system provided functions can find them than handle deletion.
In appdata\local\temp, the files are not in a directory that is easily identifiable with Processing. I would suggest
appdata\local\temp\Processing
which makes them easier to identify and find so you don't have them intermingled with files/directories from other applications.
By the way, I have cleaned out several gigabytes of these so space can be an issue as well.
Just what purpose do these directories and files serve? Are there other such repositories on my disk drive for Processing? Why aren't they deleted when the run command has completed?
There are errors in Processing that cause output to be placed off location. Run this example:
boolean sw = true;
void setup() {
size(480,480);
}
void draw() {
fill(0);
textSize(24);
text("Draw this message repeatedly", 10, 30);
if (sw) text("Draw this message once", 10, 60);
sw = false;
noLoop(); // remove or comment out after first run
}
The on screen text in the repeated message degrades as the pixels start to mush out around the target area. It also happens when the background and fill values are changed.
Is this a bug? How does one put text on the screen that doesn't turn to mush with repeated calls to draw()?
Is there a simple way to set the color for GLabel items (border color, text color, background color). There are constants in the GConstants for these items but it appears no callbacks to set those components.
Any possible solutions or suggestions?
I tried to find the document referenced item for instructions on set_user_color (spelling?), but only found the definitions and no instructions (the original reference re-directed to the Google code repository).