Arduino/C4/Arduino-Programming-with-Python/English

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


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

Learning Objectives

In this tutorial, we will learn about
  • Arduino - Python toolbox
  • Interfacing Arduino with Python
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
About Python:

Spoken tutorial link.

If you are not familiar with Python, go through the Python spoken tutorials on this website.
Point to the book in the desktop

and open the book

I have downloaded Microcontroller Programming with Arduino and Python ebook on my Desktop.
Show the relevant pages in the book.

Chapter 3 : Page 18, 19

  • Refer to chapter 3 in the book.
  • Follow the steps and do the installation of Arduino IDE and Python 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
Slide:

Points to be noted:

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 Python-Arduino toolbox

  • By default, Python does not have the capability to communicate with Arduino.
  • We have created a package that makes use of the functions available in pyserial.
  • These functions are required to run various experiments on the Arduino UNO board.
  • It also establishes a serial communication with Arduino.
Show the book: 3.2.4 We have to run the Python script to check whether the firmware is properly installed or not.

It is available at Origin/tools/python/test_firmware.py.

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

I have already installed Arduino IDE and Python 3.5 in my Linux system as specified in the book.

>cd Desktop

>cd Origin/tools/python/test_firmware.py

>python3 test_firmware.py

Go to the python folder where test_firmware.py is saved as shown.

Let us test the working of the Python - Arduino toolbox in python.

Type python3 test_firmware.py to execute the Python code.

You will see three "ok" messages.

This shows that the floss-firmware and Python toolbox are working properly.

Show the book page 42

code 4.4.2

Next let us run the Python program in chapter 4. That is, Interfacing a Light Emitting Diode

This program will turn ON the blue LED.

>cd Origin/user-code/led/python/

>python3 led-blue.py

Switch back to the terminal.

Let us go to the folder where the led-blue.py program is saved.

To execute the program, type, python3 led-blue.py

Blue led.jpg Observe the blue LED is turned ON the shield.

It denotes the Python toolbox and FLOSS firmware are working.

Do the other Python experiments as specified in the book.
Slide:

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 Python test_firmware.py is properly running or not.
With this we come to the end of this tutorial. Let us summarize.

Slide 8:

Summary

In this tutorial, we learnt about
  • Arduino Python toolbox
  • Interfacing Arduino with Python
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