<< ANALOG_WRITE_SB Arduino toolbox SEVEN_SEG_DISPLAY_SB >>

Arduino toolbox >> Arduino toolbox > ARDUINO_SETUP

ARDUINO_SETUP

Assigns a serial communication port to an Arduino card

The icon

Contents

Palette

Arduino

Description

It is mandatory to place this block onto the diagram when any of the other Arduino blocks is used.

It allows to define the serial communication port between the Arduino and Xcos. The name of the port will be /dev/ttyUSBx where x is the port number

Il permet de définir le port de communication entre la carte Arduino et Xcos.

The port to be used can be determined when starting the Arduino application verifying the port number shown in the tools/port series. It can also be changed in the peripherals / port manager (Advanced options).

At the moment only a single Arduino card can be used.

The toolbox can currently only be used under Linux

Attention: Before usinmg the toolbox the program toolbox_arduino.ino must be loaded into the Arduino flash. This is the server program interpreting the commands sent by Xcos and executing them on the Arduino

Parameters

Le port de communication doit être spécifié (entre 2 et 9 sinon un message d'erreur apparaît).

The serial communication port number must be between 0 and 3 (/dev/ttyUSB0 .. /dev/ttyUSB3) otherwise an error message will appear.

The Arduino card number must currently be set to 1. Otherwise and error message will be emitted

Example 1

The example below shows the block usage in case of the blink program which will blink the builtin LED on GPIO pin 13 on an Arduino Uno or Nano. The block uses port /dev/ttyUSB0 for communication with the Arduino. It uses default parameters with the exception of the PULSE block where the phase has been set to 0.

See also


Report an issue
<< ANALOG_WRITE_SB Arduino toolbox SEVEN_SEG_DISPLAY_SB >>