Setup and develop Arduino on Ansys SCADE software — Lesson 1

Introduction

We are going to build a toy airplane controller in an Ansys SCADE Suite™ model-based development environment for critical embedded software, and then generate and execute the code on an Arduino. What we want to do is use several Arduino devices that will interact using a joystick and buttons to simulate aircraft control.

 

Presentation of the Ansys SCADE software Arduino package (cgarduino)

This section provides a quick introduction to the Arduino package for Ansys SCADE software called cgarduino.

The objective of this package is to allow the user to design an Arduino program in Ansys SCADE software and generate a corresponding .ino file (Arduino sketch) that can be uploaded on an Arduino board directly.

Installing this package will:

  • Add an Arduino SCADE library to your Ansys SCADE software installation, containing the Arduino devices that can be used in your Ansys SCADE application model
  • Install an Arduino python Wrapper allowing to generate .ino file from the KCG generated C code
  • Install an extension in the Ansys SCADE application settings, called “Arduino Wrapper”, allowing you to configure the .ino code generation

 

Setup the Arduino environment on the Ansys SCADE Suite application

Now you will install the cgarduino package.

- Help: `cgarduino --help`

- Manual: `cgarduino --manual` (also from the Ansys SCADE Suite application setting panel)

 

Ansys SCADE Suite application

Get the `cgarduino` wheel, then:

Use pip to install the wheel:

    <scade install>/contrib/Python<ver>/python -m pip install <cgarduino.wheel> -- user

 

A new command `cgarduino` is available in `%APPDATA%\Python\Python<ver>\Scripts`. Call the command:

    %APPDATA%\Python\Python<ver>\Scripts\cgarduino suite -- install

 

Once you have installed the extension for the Ansys SCADE Suite application you can check the installation by opening an Ansys SCADE Suite application project:

  • Open the Ansys SCADE Suite application.
  • Help > Examples > ABC

Image 1

  • Open the settings tab.
  • Go to the tab “Code Integration” and select “Adaptor: Arduino”.

Image 2

  • If you can select Arduino in Adaptor and then if you have the tab “Arduino Wrapper”, cgarduino is correctly installed on the Ansys SCADE Suite application.