Home Examples UDP Communication with the Robot Computer and Arduino
AdvancedCoding TipsPeripherals

UDP Communication with the Robot Computer and Arduino

Receive From Arduino

Summary

The purpose of this task is to demonstrate how the Kinarm Lab can receive data from a device connected to the Dexterit-E LAN using UDP. This task uses an Arduino as an example, receiving an integer value which controls the state of a single target in the task.

Description

The purpose of this task is to demonstrate how the Kinarm Lab can receive data from a device connected to the Dexterit-E LAN using UDP. This task uses an Arduino as an example, receiving an integer value which controls the state of a single target in the task.

The Arduino only serves as an example device to show what is required for UDP communication in your task’s Simulink code. It can be changed to another device, but the Simulink code will need to be updated to parse the UDP packet sent by the device.

In order to run this task, the following are required:

How to use this task:

  1. Connect the Arduino to Dexterit-E LAN using the Ethernet cable
  2. Start the included task and task protocol on your Kinarm Lab
  3. Compile and upload the .ino file included in the download package to your Arduino
  4. When the upload is complete, a target should start blinking every 500 ms.

Send to Arduino

Summary

The purpose of this task is to demonstrate how the Kinarm Lab can send data to a device connected to the Dexterit-E LAN using UDP. This task uses an Arduino as an example, where the robot computer sends a delay to the Arduino to control the frequency of toggling an LED.

Description

The purpose of this task is to demonstrate how the Kinarm Lab can send data to a device connected to the Dexterit-E LAN using UDP. This task uses an Arduino as an example, where the robot computer sends a delay to the Arduino to control the frequency of toggling an LED.

The Arduino only serves as an example device to show what is required for UDP communication in your task’s Simulink code. The external device can be changed, but the Simulink code will need to be updated to package UDP packets in the structure the receiving device expects.

In order to run this task, the following are required:

How to use this task:

  1. Connect the Arduino to Dexterit-E LAN using the Ethernet cable
  2. Compile and upload the .ino file included in the download package to your Arduino
  3. Configure the Arduino Serial Monitor to 9600 bps.
  4. When the upload is complete, “LED ON” and “LED OFF” will now be printed every second.
  5. Start the included task and task protocol on your Kinarm Lab
  6. After the task runs, the “LED ON” and “LED OFF” will now be printed every 500 ms.
    1. The print interval can be changed by modifying the “Blink Interval” column included in the task protocol.
Share this Task

Related Tasks

Psychology Tasks
Stroop
This task quantifies cognitive inhibition and information processing speed.
Psychology Tasks
Simon
This task quantifies the influence of congruence between the spatial position of a stimulus and the required response.