Next: Basic Input and Output Overview, Previous: Hardware setup, Up: Introduction [Contents][Index]
To control an arduino device, a connection must be made to it by creating an arduino object.
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()
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.
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 |