Difference: BasicPythonProgramming (3 vs. 4)

Revision 42023-11-27 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="Slides"

Start Presentation

Changed:
<
<

Lecture 1: Basic Python Programming

CSC 321: Embedded Sysytem

First Semeter 2020/2021

>
>

Lecture 1: Basic Python Programming

CSC 321: Embedded Sysytem

First Semester 2020/2021

 

Introduction of Lecturers

  1. Uli Raich -- Formally CERN, Geneva, Switzerland
  2. Isaac Armah-Mensah -- University of Cape Coast Ghana
Line: 72 to 72
 Design decisions:

  • Which processors?
  • Which communication protocol
Changed:
<
<
  • Which GUI to be able to see what is going on?
>
>
  • Which GUI to be able to see what is going on?
 
  • Which programming language?

The Raspberry Pi

Changed:
<
<
The Raspberry Pi is a small computer powerful enough to run a full blown Linux operating system:

A quad core 1.2 GHz Broadcom 64 bit ARM CPU

  • 1 Gbytes of Ram
  • Ethernet and wireless networks
  • 4 USB2 ports
  • Micro SD connector
  • 40 pin extended GPIO connector with
  • GPIO pins
  • SPI and I2C bus interface
  • Cost ~ 80-100 US $
  • No ADC
raspberry_pi.png
>
>
The Raspberry Pi is a small computer powerful enough to run a full blown Linux operating system:

A quad core 1.2 GHz Broadcom 64 bit ARM CPU

  • 1 Gbytes of Ram
  • Ethernet and wireless networks
  • 4 USB2 ports
  • Micro SD connector
  • 40 pin extended GPIO connector with
  • GPIO pins
  • SPI and I2C bus interface
  • Cost ~ 80-100 US $
  • No ADC
raspberry-pi-3-b.jpg
 

Arduino + WiFi shield

Changed:
<
<
arduino.png
>
>
uno.png
 
Total cost: ~12-15 US $

The ideal IoT solution?

Changed:
<
<
ESP8266 or ESP32 processor board

ESP8266 specs:

  • WiFi on chip
  • 10 bit ADC on chip
  • 80 kByte RAM
  • 4 Mbyte flash
  • Can run a Micropython interpreter
  • Can be programmed through the Arduino IDE
  • SPI, I2C interfaces
  • 11 GPIO pins
  • Many sensor and actuator boards
  • Can be plugged together without bread board or soldering
  • Cost of processor board: ~ 2.5 US$

ESP32 is even more powerful
Cost: ~ 4.5 US$
sheild.png
>
>
ESP8266 or ESP32 processor board

ESP8266 specs:

  • WiFi on chip
  • 10 bit ADC on chip
  • 80 kByte RAM
  • 4 Mbyte flash
  • Can run a Micropython interpreter
  • Can be programmed through the Arduino IDE
  • SPI, I2C interfaces
  • 11 GPIO pins
  • Many sensor and actuator boards
  • Can be plugged together without bread board or soldering
  • Cost of processor board: ~ 2.5 US$

ESP32 is even more powerful
Cost: ~ 4.5 US$
wemosShields.png
 

Communication

MQTT (Message Queuing Telemetry Transport: a publish-subscribe based

Message protocol running of top of TCP.

A processor can subscribe to messages of a certain “topic” and/or it can push its

results on a certain topic

Changed:
<
<
mqtt.png
>
>
mosquittoDemo.png
 

Programming language

Line: 139 to 139
  Type print(“Hello world”). Hit enter and it prints Hello world on the screen.
Changed:
<
<
commandline.png
>
>
commandline.png
  To exit from the interactive mode, type quit().

Line: 153 to 153
  helloworld.png
Deleted:
<
<
script.png
 

Using Thonny

Instead of running a standard editor like nano or emacs you may want to run

Line: 218 to 217
  The operand to the left of the = operator is the name of the variable and
the operand to the right of the = operator is the value stored in the variable.
Changed:
<
<
variable.png
>
>
variable.png
 

Data Types in Python

Line: 237 to 236
  Python accepts either pair of single, double quotes and triples(single/double) quotes.
Changed:
<
<
string.png
>
>
string.png
 

List in Python

Line: 476 to 475
 
<--/commentPlugin-->
Changed:
<
<
META FILEATTACHMENT attachment="Home_page.png" attr="" comment="" date="1612709232" name="Home_page.png" path="Home page.png" size="2045509" user="IsaacArmahMensah" version="1"
META FILEATTACHMENT attachment="commandline.png" attr="" comment="" date="1612710005" name="commandline.png" path="commandline.png" size="349473" user="IsaacArmahMensah" version="1"
>
>
META FILEATTACHMENT attachment="Home_page.png" attr="" comment="" date="1701078185" name="Home_page.png" path="Home_page.png" size="547486" user="UliRaich" version="1"
META FILEATTACHMENT attachment="commandline.png" attr="" comment="" date="1701079377" name="commandline.png" path="commandline.png" size="24513" user="UliRaich" version="1"
 
META FILEATTACHMENT attachment="script.png" attr="" comment="" date="1612710405" name="script.png" path="script.png" size="143266" user="IsaacArmahMensah" version="1"
META FILEATTACHMENT attachment="raspberry-pi.webp" attr="" comment="" date="1612725902" name="raspberry-pi.webp" path="raspberry-pi.webp" size="597460" user="IsaacArmahMensah" version="1"
META FILEATTACHMENT attachment="raspberry_pi.png" attr="" comment="" date="1612726040" name="raspberry_pi.png" path="raspberry_pi.png" size="935969" user="IsaacArmahMensah" version="1"
Line: 485 to 484
 
META FILEATTACHMENT attachment="sheild.png" attr="" comment="" date="1612726453" name="sheild.png" path="sheild.png" size="760798" user="IsaacArmahMensah" version="1"
META FILEATTACHMENT attachment="mqtt.png" attr="" comment="" date="1612726563" name="mqtt.png" path="mqtt.png" size="54762" user="IsaacArmahMensah" version="1"
META FILEATTACHMENT attachment="while.png" attr="" comment="" date="1612729561" name="while.png" path="while.png" size="149841" user="IsaacArmahMensah" version="1"
Changed:
<
<
META FILEATTACHMENT attachment="variable.png" attr="" comment="" date="1612729570" name="variable.png" path="variable.png" size="244797" user="IsaacArmahMensah" version="1"
>
>
META FILEATTACHMENT attachment="variable.png" attr="" comment="" date="1701080372" name="variable.png" path="variable.png" size="34345" user="UliRaich" version="1"
 
META FILEATTACHMENT attachment="list.png" attr="" comment="" date="1612729579" name="list.png" path="list.png" size="211812" user="IsaacArmahMensah" version="1"
Changed:
<
<
META FILEATTACHMENT attachment="string.png" attr="" comment="" date="1612729692" name="string.png" path="string.png" size="284981" user="IsaacArmahMensah" version="1"
>
>
META FILEATTACHMENT attachment="string.png" attr="" comment="" date="1701080034" name="string.png" path="string.png" size="31906" user="UliRaich" version="1"
 
META FILEATTACHMENT attachment="dictionary.png" attr="" comment="" date="1612729836" name="dictionary.png" path="dictionary.png" size="222984" user="IsaacArmahMensah" version="1"
Added:
>
>
META FILEATTACHMENT attachment="raspberry-pi-3-b.jpg" attr="" comment="" date="1701078319" name="raspberry-pi-3-b.jpg" path="raspberry-pi-3-b.jpg" size="80255" user="UliRaich" version="1"
META FILEATTACHMENT attachment="wemosShields.png" attr="" comment="" date="1701078905" name="wemosShields.png" path="wemosShields.png" size="397621" user="UliRaich" version="1"
META FILEATTACHMENT attachment="uno.png" attr="" comment="" date="1701078909" name="uno.png" path="uno.png" size="260706" user="UliRaich" version="1"
META FILEATTACHMENT attachment="mosquittoDemo.png" attr="" comment="" date="1701080095" name="mosquittoDemo.png" path="mosquittoDemo.png" size="534522" user="UliRaich" version="1"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback