We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I've been using processing 2.2.1 to try to get some serial communication going. The serial javadoc no longer exists so it's a bit hard stumbling in the dark but I managed until now.
I need to control the DTR pin to keep it HIGH but the setDTR command is doing nothing at all.
import processing.serial.*;
Serial myPort; // The serial port
void setup() {
size(400,200);
println(Serial.list());
myPort = new Serial(this, "COM9", 115200);
myPort.setDTR(true);
}
void draw ()
{
}
This is just supposed to open the port and set the DTR pin to HIGH... but it doesn't do that. I put my oscope on the board and the DTR pin is LOW.
Am I doing something wrong in assuming setDTR will do this?
Answers
https://github.com/processing/processing/blob/master/java/libraries/serial/src/processing/serial/Serial.java line 418, there is comment that might be relevant.
I am fine with the DTR causing a reset at open but I'd like to switch it to HIGH afterwards. It does not seem to be doing that because I checked the pin using my oscilloscope and it's always low.
BTW I am using windows. Is there a way to force DTR to high on windows?
Soooo
For some reason setDTR does not work if I put it in the setup()
If I put it in a separate procedure
IT WORKS! This is a very strange bug. Probably system dependent?