Skip to content

Commit 1baa383

Browse files
committed
Update expected Arduino device name for Mac and Linux
1 parent 62b7555 commit 1baa383

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

Plugins/ArduinoOutput/ArduinoOutput.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@ Array<String> ArduinoOutput::getDevices()
6363
for (int i = 0; i < devices.size(); i++)
6464
{
6565

66-
if (devices[i].getDeviceName().compare(0, 6, "ttyACM") == 0 ||
67-
devices[i].getDeviceName().compare(0, 7, "tty.usb") == 0 ||
68-
devices[i].getDeviceName().compare(0, 7, "Arduino") == 0)
66+
if (devices[i].getDeviceName().compare(0, 6, "ttyACM") == 0 || // Linux Communications Device Class
67+
devices[i].getDeviceName().compare(0, 6, "ttyUSB") == 0 || // Linux FTDI chip
68+
devices[i].getDeviceName().compare(0, 7, "tty.usb") == 0 || // macOS
69+
devices[i].getDeviceName().compare(0, 7, "Arduino") == 0) // Windows with driver installed
6970
{
7071
out.add (devices[i].getDevicePath());
7172
}

Plugins/ArduinoOutput/serial/ofArduino.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ bool ofArduino::connect (string device, int baud)
136136
{
137137
connectTime = ofGetElapsedTimef();
138138
_initialized = false;
139-
_port.enumerateDevices();
139+
//_port.enumerateDevices();
140140
connected = _port.setup (device.c_str(), baud);
141141
return connected;
142142
}
@@ -196,7 +196,7 @@ void ofArduino::update()
196196
int bytesToRead = _port.available();
197197
if (bytesToRead > 0)
198198
{
199-
std::cout << "Bytes found: " << bytesToRead << std::endl;
199+
//std::cout << "Bytes found: " << bytesToRead << std::endl;
200200
bytesToProcess.resize (bytesToRead);
201201
_port.readBytes (&bytesToProcess[0], bytesToRead);
202202
for (int i = 0; i < bytesToRead; i++)
@@ -469,7 +469,7 @@ bool ofArduino::isInitialized()
469469
void ofArduino::processData (unsigned char inputData)
470470
{
471471
char msg[100];
472-
snprintf (msg, sizeof (msg), "Received Byte: %i", inputData);
472+
//snprintf (msg, sizeof (msg), "Received Byte: %i", inputData);
473473
//Logger::get("Application").information(msg);
474474

475475
// we have command data
@@ -489,7 +489,7 @@ void ofArduino::processData (unsigned char inputData)
489489
processDigitalPort (_multiByteChannel, (_storedInputData[0] << 7) | _storedInputData[1]);
490490
break;
491491
case FIRMATA_REPORT_VERSION: // report version
492-
printf ("Received report version\n\n");
492+
// printf ("Received report version\n\n");
493493
_majorProtocolVersion = _storedInputData[1];
494494
_minorProtocolVersion = _storedInputData[0];
495495
//ofNotifyEvent(EProtocolVersionReceived, _majorProtocolVersion, this);

0 commit comments

Comments
 (0)