Arduino/C4/Arduino-Programming-with-OpenModelica/English

From Script | Spoken-Tutorial
Jump to: navigation, search



VISUAL CUE NARRATION
Slide 1: Welcome to the Spoken tutorial on Arduino Programming with OpenModelica.
Slide 2:

Learning Objectives

In this tutorial, we will learn about
  • Arduino OpenModelica toolbox
  • Interfacing Arduino with OpenModelica
Slide 3:

System requirements

To record this tutorial, I’m using
  • Ubuntu Linux OS version 18.04
  • Arduino Shield and
  • Arduino Uno Board
Slide 4:

Prerequisites

To follow this tutorial, you should go through the below Arduino Spoken tutorial.
  • Getting ready for Arduino FLOSS.
Slide 5:

Getting ready for Arduino Floss

In the above tutorial, you will learn
  • How to download the e-book and code files required for the experiments.
  • How to upload and compile Arduino programs in Arduino IDE.
  • About FLOSS Firmware
Slide 6:

About OpenModelica

If you are not familiar with OpenModelica, go through the spoken tutorials on this website.

You will learn about

  • Introduction to OpenModelica
  • OpenModelica interface
  • Various perspectives and
  • Simulation
Point to the book in the Desktop

and open the book

I have downloaded the e-book on my Desktop.

Let us open the book Microcontroller Programming with Arduino and OpenModelica.

Show the relevant pages in the book.
  • Refer to chapter 3 in the book.
  • Follow the steps and do the installation of Arduino IDE and OpenModelica depending upon your OS.
  • Installation steps are given for Windows and Linux OS.
  • The experiments that are covered in the book are tested in Ubuntu Linux 18.04 and Windows 10 OS.

Arduino shield_USB.jpg

Connect the Arduino UNO board with Arduino shield to the USB port of the computer
Points to be noted:

Show 3.1.5 in the book, page 25

Note the below points:

1. Launch Arduino IDE

2. Check the port

3. Upload the Floss firmware

  • That is, in the Arduino IDE, upload the file available at Origin/tools/floss-firmware/floss-firmware.ino

As discussed in the earlier tutorial, the above steps have to be done before proceeding further.

Slide 9:

About Arduino-OpenModelica toolbox

  • By default, OpenModelica does not have the capability to connect to Arduino.
  • All such add-on functionalities are added to OpenModelica using the toolbox.
  • These functions are required to run various experiments on the Arduino UNO board.
  • It also establishes a serial communication with Arduino.
  • We have different toolboxes for Windows and Linux OS.

Show the directory Desktop /origin/tools

The Arduino-OpenModelica toolbox can be found inside the directory

  • Origin/tools/OpenModelica/windows/ or
  • Origin/tools/OpenModelica/linux/
First we have to load the toolbox depending upon your OS.

I’ll show how to load the toolbox in Linux.

Open the terminal by pressing Ctrl+Alt+T keys.

I have installed Arduino IDE and OpenModelica 1.1.7 in my Linux system as specified in the book.

cd Downloads

> OMEdit

Go to the folder where OpenModelica is installed as shown and launch the OpenModelica.

Next, we have to load the Arduino OpenModelica toolbox.

Click on File and then click on the OpenModel/Library File(s) option.

Navigate to Origin/tools/openmodelica/linux.

Select Arduino.mo and test_firmware.mo and click Open.

In OMEdit, under the Libraries panel, look for three new libraries.

They are Arduino, Modelica_Synchronous, Modelica_DeviceDrivers and test_firmware.mo.

This confirms that the Arduino OpenModelica toolbox has been loaded successfully.

Show chapter 8 Next let us run the OpenModelica program in chapter 8. That is, Interfacing a Thermistor.

This program will read and display the thermistor values.

Switch back to the OmEdit interface.

The codes are available inside the Arduino OpenModelica toolbox under the Libraries panel.

Select Arduino -> SerialCommunication -> Examples -> thermistor -> therm_read.

Double-click on the file to open.

Click on the Simulate button on the top right corner.

Click on the Ok button in the simulation setup window.

We can see the thermistor value displayed on the screen.

Rub the thermistor with the fingertips.

It will transfer heat from the person's finger, thereby raising the temperature of the thermistor.

Accordingly, we can observe the change in the thermistor values.

Points to remember: Points to remember:
  • Whenever you plug the Arduino Uno board into the computer, check for the port.
  • Then execute the commands required for read-write permission.
  • Don’t upload any Arduino program after uploading the FLOSS firmware to Arduino Uno board.
  • This would overwrite the FLOSS firmware.
  • Check if the Arduino-OpenModelica toolbox is properly running or not.
  • You have to load the Arduino OpenModelica toolbox each time when you launch the OMEdit.
With this we come to the end of this tutorial. Let us summarize.

Slide 8:

Summary

In this tutorial, we learnt about
  • Arduino-OpenModelica toolbox
  • Interfacing Arduino with OpenModelica
Slide 10:

(About Spoken Tutorial Project)

The video at the following link, summarizes the Spoken Tutorial project.

Please download and watch it.

Slide 11:

(About Spoken Tutorial Project)

The Spoken Tutorial Project Team conducts workshops and gives certificates.

For more details, please write to us.

Slide

Forum questions:

Please post your timed queries on this forum.
Slide: Acknowledgement Spoken Tutorial project is funded by the Ministry of Education (MoE), Govt. of India.
This is Nirmala Venkat from Spoken Tutorial Project, IIT Bombay signing off.

Thanks for joining.

Contributors and Content Editors

Nancyvarkey, Nirmala Venkat