3 Connecting to an arduino

To control an arduino device, a connection must be made to it by creating an arduino object.

3.1 Connecting to a single arduino

Assuming a single arduino device is connected to the computer, creating an arduino object with no arguments will find the connected arduino and connect to it:

ar = arduino()

3.2 Connecting to a specific arduino

Where multiple arduinos may be connected to the computer, a specific board can be connected by specifying the name of the port it is connected to:

ar = arduino("/dev/ttyACM0")

The port name will be operating system dependent.

3.3 Querying available arduinos

To list the ports of all programmed available arduinos, the scanForArduinos function can be used:

scanForArduinos

It will provide a list of all available boards it can find with the port they are connected to.

NOTE

The scanForArduinos function will only detect boards that have been programmed using the arduinosetup command