Editing UBISS2024
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | + | = Link Page = | |
− | + | https://www.sketching-with-hardware.org/wiki/UBISS2024-Links | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
= Tasks = | = Tasks = | ||
− | == | + | == Project 0: connect a Arduino Nano ESP32 board == |
− | + | * Install the basic software https://labs.arduino.cc/en/labs/micropython | |
− | + | * connect the board via USB | |
− | * Install the | + | * Make the orange LED (pin 6) blink using micro python https://docs.arduino.cc/micropython/basics/digital-analog-pins/ |
− | * | + | * Connect an external RGB LED (pin 2, 3, 4), https://www.sketching-with-hardware.org/wiki/RGB_LED |
− | * | + | * Control the external RGB LED (on, off, mix color, brightness) |
− | * | ||
− | |||
− | === | + | === solution Project 0: LED Blinking === |
<syntaxhighlight lang="python" line='line'> | <syntaxhighlight lang="python" line='line'> | ||
# Blinky example | # Blinky example | ||
Line 123: | Line 29: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | === | + | === solution Project 0: Control external RGB === |
<syntaxhighlight lang="python" line='line'> | <syntaxhighlight lang="python" line='line'> | ||
# RGB example | # RGB example | ||
Line 130: | Line 36: | ||
from machine import Pin | from machine import Pin | ||
− | # RGB LED connected to | + | # RGB LED connected to Nano WiFi module. |
− | ledG = Pin( | + | ledG = Pin(2, Pin.OUT) |
− | ledR = Pin( | + | ledR = Pin(3, Pin.OUT) |
− | ledB = Pin( | + | ledB = Pin(4, Pin.OUT) |
print("start") | print("start") | ||
Line 152: | Line 58: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | == | + | == Project 1: read Acceleration from Arduino Nano ESP32 board == |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
* read data from the accelerometer and the gyro and print them (Arduino IDE) https://docs.arduino.cc/micropython/basics/board-examples/ | * read data from the accelerometer and the gyro and print them (Arduino IDE) https://docs.arduino.cc/micropython/basics/board-examples/ | ||
− | * extend | + | * extend you program to write the data from the accelerometers to a file, https://www.sketching-with-hardware.org/wiki/FileIO |
* transfer the file to your computer | * transfer the file to your computer | ||
− | * optional: add the photo resistors to your board, read their values, and write them to the file | + | * optional: add the photo resistors to your board, read their values, and write them to the file, too, https://www.sketching-with-hardware.org/wiki/LDR |
− | === | + | === solution Project 1: Read Accelerometer and Gyro === |
<syntaxhighlight lang="python" line='line'> | <syntaxhighlight lang="python" line='line'> | ||
import time | import time | ||
Line 210: | Line 81: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | === | + | |
− | A0 is the analog input with 16 | + | |
+ | === solution Project 2: Read analog values - Code Example Arduino Nano Connect RP2040 === | ||
+ | A0 is the analog input with 16 bit resolution. It reads the analog value every second and print it to the console- | ||
<syntaxhighlight lang="python" line='line'> | <syntaxhighlight lang="python" line='line'> | ||
+ | #Example usage for Arduino Nano | ||
from machine import Pin, ADC | from machine import Pin, ADC | ||
from time import sleep | from time import sleep | ||
Line 225: | Line 99: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | == | + | == Project 2: Jupyter Notebook == |
− | * | + | * connect the board |
− | * | + | * install the Juypter Notebook, https://www.sketching-with-hardware.org/wiki/Jupyter |
− | * | + | * read the accelerometer and the gyro and show it in the notebook |
− | === Task | + | |
+ | === Task 2.1: is it moved? === | ||
* read acceleration and gyro | * read acceleration and gyro | ||
* calculate the differences between values | * calculate the differences between values | ||
Line 236: | Line 111: | ||
* create a file on the device that logs, when it is moved | * create a file on the device that logs, when it is moved | ||
− | === Task | + | === Task 2.2: it was turned upside down? === |
* read acceleration and gyro | * read acceleration and gyro | ||
* make a rule based "AI" that records | * make a rule based "AI" that records | ||
Line 243: | Line 118: | ||
** it was moved "quickly" | ** it was moved "quickly" | ||
− | == Task | + | == Task 3: ML on Arduino Nano Connect RP2040 == |
− | We will use https://github.com/eloquentarduino/everywhereml to detect the same gestures as in | + | We will use https://github.com/eloquentarduino/everywhereml to detect the same gestures as in 2.2. For this, install everywhereml: |
− | |||
− | |||
− | |||
<syntaxhighlight lang="Bash"> | <syntaxhighlight lang="Bash"> | ||
− | pip3 install -U | + | pip3 install -U everywhere |
</syntaxhighlight> | </syntaxhighlight> | ||
Line 266: | Line 138: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | == Task | + | == Task 4: connect both boards to WIFI == |
− | + | * connect both boards to WIFI using [[Tutorial_Network]] | |
− | * | + | * use the Arduino Nano ESP32 as output (showing a color) |
− | * | + | * use the Arduino Nano Connect RP2040 as input (recognize with rules 3 gestures) |
− | * | ||
= Links = | = Links = | ||
Line 321: | Line 192: | ||
C:\Users\ru42qak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\jupyterlab>python -m notebook | C:\Users\ru42qak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\jupyterlab>python -m notebook | ||
− | [[Category: | + | [[Category:Course]] |
[[Category:UBISS2024]] | [[Category:UBISS2024]] | ||
− | |||
− |