Skip to content

Latest commit

 

History

History

SelectDevice

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Céu-Maker: Select device

A GUI application that shows up the connected Arduino boards and allows the user to select one. It was developed to be used together with make-arduino.bat file (from Céu-Maker) as follows:

  1. the make-arduino.bat is executed;
  2. make-arduino.bat executes the SelectDevice.exe;
  3. in the oppened window, the user can:
    • select a board: in this case the SelectDevice.exe returns to the make-arduino.bat a string containing the board, port, and if necessary, the cpu, separated by empty spaces;
    • close the window: in this case the SelectDevice.exe returns to the make-arduino.bat an empty string.

the make-arduino.bat check if the received string is empty or not. If it is, the make-arduino.bat finalize. If the string is not empty, it strips the string and pass the information (board, port and cpu) to Arduino Makefile.

Inspiration

The Arduino IDE uses the file arduino-1.8.3\hardware\arduino\avr\boards.txt to identify ports and boards. With a VID/PID combination we can identify the USB device that is plugged and then search in this file for more information, such as the name of the board.

Dev notes

This app was developed using Visual Studio Community 2015 and only supports devices from package "arduino" and arch "avr".

Create a new release version

To create a new release version, make sure to move the exe generated by the Visual Studio from SelectDevices/bin/Release/ to ceu-maker/ceu-maker/run

#if DEBUG

In the SelectDevice/Form1.cs, we can find blocks of code using #if DEBUG:

#if DEBUG
    string text = System.IO.File.ReadAllText(@"absolute-path-to\arduino-1.8.3\hardware\arduino\avr\boards.txt");
#else
    string text = System.IO.File.ReadAllText(@"..\arduino-1.8.3\hardware\arduino\avr\boards.txt");
#endif

The above code was included to facilitate the location of boards.txt file in develop stage. If you're compiling a debug version o SelectDevice, you can use the absolute path of boards.txtchanging the string in the second line. For release, use a relative path.

References and links