Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Course on Internet of Things Exercises Session 1:Introductory remarks:The scripts we are going to develop during these exercises do not depend on any system issues: We do not use command line arguments not available in MicroPython nor do we use any hardware specific features which are not available on a PC. The exercises can therefore be developed and run on the ESP32 but also on any standard PC with Python3 installed. | ||||||||
Changed: | ||||||||
< < | Exercise 1: | |||||||
> > | Exercise 1: Use of REPL | |||||||
Connect to your ESP32 with minicom or thonny. | ||||||||
Line: 14 to 14 | ||||||||
| ||||||||
Changed: | ||||||||
< < | Exercise 2: | |||||||
> > |
Exercise 2: A simple calculator | |||||||
Write a script that assigns the values 5 and 3 to the variables a and b respectively | ||||||||
Line: 46 to 47 | ||||||||
| ||||||||
Changed: | ||||||||
< < |
Exercise 3: | |||||||
> > | Try also several spaces in between operands and operator.
Exercise 3: Conditions | |||||||
Like in exercise2, start with 2 numbers a,b with values 5 and 3. In your program check which of the 2 numbers is bigger and print the result. Then improve the program asking the user for 2 integer numbers. Make sure he enters 2 correct numbers and capture possible errors. This is a typical output: | ||||||||
Added: | ||||||||
> > | Exercise 4: The Fibonacci seriesThe Fibonacci number series is defined as: F(0) = 0; F(1) = 1 F(n) = F(n-1) + F(n-2)
| |||||||
-- Uli Raich - 2020-05-03 |