#14 Serial port now choosable

This commit is contained in:
Sandy Noble 2017-04-20 23:30:31 +01:00
parent 7da0e7e378
commit d74881f2de
1 changed files with 3 additions and 4 deletions

View File

@ -38,8 +38,7 @@ ControlFrameSimple addSerialPortControlFrame(String theName, int theWidth, int t
sl.addItem("No serial connection", -1); sl.addItem("No serial connection", -1);
String[] ports = {"a", "b", "c", "d", "e", "f", "g", "h"}; String[] ports = Serial.list();
//Serial.list();
for (int i = 0; i < ports.length; i++) { for (int i = 0; i < ports.length; i++) {
println("Adding " + ports[i]); println("Adding " + ports[i]);
@ -61,8 +60,8 @@ ControlFrameSimple addSerialPortControlFrame(String theName, int theWidth, int t
void dropdown_serialPort(int newSerialPort) void dropdown_serialPort(int newSerialPort)
{ {
println("In dropdown_serialPort"); println("In dropdown_serialPort, newSerialPort: " + newSerialPort);
newSerialPort -= 1;
if (newSerialPort == -2) if (newSerialPort == -2)