Want to create interactive content? It’s easy in Genially!
LAB 6
Christian Parma
Created on May 27, 2024
Start designing with a free template
Discover more than 1500 professional designs like these:
View
Women's Presentation
View
Vintage Photo Album
View
Geniaflix Presentation
View
Shadow Presentation
View
Newspaper Presentation
View
Memories Presentation
View
Zen Presentation
Transcript
LAB 6 COMBINANDO PYTHON CON ARDUINO COMBINING PYTHON WITH ARDUINO
DI MAZZA LORENZO, MARINI NICCOLò, PARMA CHRISTIAN E SALVIATI FILIPPO
Riassunto
IN QUESTA PRESENTAZIONE SPIEGHEREMO COME CONVERTIRE I CODICI ARDUINO IN PYTHON.
Summary
IN THIS PRESENTATION WE ARE GOING TO EXPLAIN HOW TO CONVERT ARDUINO CODES INTO PYTHON.
SPIEGAZIONE / EXPLANATION
Il primo step per convertire i codici Arduino IDE in Python, è installare Python sul proprio sistema operativo, oppure installare un ambiente di programmazione per Python. Per il primo metodo, basta andare sul sito ufficiale di Python (https://www.python.org/downloads/) e scegliere la versione preferita. Se invece vogliamo installare un ambiente di programmazione, il nostro consiglio è di installare Anaconda sul sito ufficiale (https://www.anaconda.com/download) e premere 'Free Download'. Dopo aver configurato Anaconda sul nostro computer, dovrete aprire 'Jupyter Notebook', per poter visualizzare i nostri codici.
The first step to convert Arduino IDE codes into Python is to install Python on your operating system, or to install a Python programming environment. For the first method, simply go to the official Python website (https://www.python.org/downloads/) and select your preferred version. If, however, you want to install a programming environment, our advice is to install Anaconda from the official website (https://www.anaconda.com/download) and click ‘Free Download’. After setting up Anaconda on your computer, you will need to open ‘Jupyter Notebook’, in order to see our codes.
SPIEGAZIONE 1 / EXPLANATION 1
Dopo aver scaricato il nostro file su GitHub (scannerizzate il QR code qui a destra), aprite 'Jupyter Notebook', non chiudete le finestre che si aprono in automatico, perché altrimenti non funzionerà. Successivamente, sfogliate le varie cartelle e trovate il file che avete appena scaricato e lo aprite facendo doppio click. Successivamente, aprite Arduino IDE e scaricate, dal menù a sinistra, la libreria 'Firmata'. Dopo andate su File\Examples\Firmata\StandardFirmata, la aprite e la caricate sul vostro Arduino (noi abbiamo provato solo con Arduino UNO R3, quindi con altre versioni potrebbe non funzionare) e poi chiudete Arduino IDE. Mi raccomando, mantenete il vostro Arduino collegato sempre alla stessa porta USB. Ritornate ora su 'Jupyter Notebook' e caricate uno dei codici già scritti da noi (con la combinazione dei tasti SHIFT+ENTER) montando il circuito secondo le varie immagini che trovate e poi provatelo e divertitevi a capire come funziona!
After downloading our file from GitHub (scan the QR code on the right), open ‘Jupyter Notebook’, do not close the windows that automatically open, because otherwise it will not work. Then, browse through the various folders and find the file you just downloaded and open it by double-clicking. Next, open Arduino IDE and download the ‘Firmata’ library from the left menu. Then go to File\Examples\Firmata\StandardFirmata, open it and upload it to your Arduino (we have only tried with Arduino UNO R3, so it may not work with other versions) and then close Arduino IDE. Remember to always keep your Arduino connected to the same USB port. Now return to ‘Jupyter Notebook’ and load one of the codes already written by us (with the combination of keys SHIFT+ENTER), assemble the circuit according to the various images you find and then test it and have fun understanding how it works!
SPIEGAZIONE 2 / EXPLANATION 2
Se volete creare dei vostri codici Python a partire da zero, vi consiglio vivamente la pagina GitHub di @MatteoMgr2008 (nel QR code a destra) che spiega le basi di Python, invece se volete partire da un codice Arduino IDE, vi basta usare ChatGPT (oppure qualunque altra intelligienza artificiale) e chiedergli di trasformarvi il codice. Successivamente, su Arduino IDE scaricate, dal menù a sinistra, la libreria 'Firmata'. Dopo andate su File\Examples\Firmata\StandardFirmata, la aprite e la caricate sul vostro Arduino (noi abbiamo provato solo con Arduino UNO R3, quindi con altre versioni potrebbe non funzionare) e poi chiudene Arduino IDE. Successivamente, aprite 'Jupyter Notebook' e incollate il codice che ChatGPT vi ha formulato. Infine lo caricate sul vostro Arduino (con la combinazione dei tasti SHIFT+ENTER) e vi divertire a migliorarlo o a sistemare gli errori!
If you want to create your own Python codes from scratch, I highly recommend the GitHub page of @MatteoMgr2008 (in the QR code on the right) which explains the basics of Python. Alternatively, if you want to start from an Arduino IDE code, you can simply use ChatGPT (or any other artificial intelligence) and ask it to transform the code for you. Afterward, on Arduino IDE, download the ‘Firmata’ library from the left menu. Then go to File\Examples\Firmata\StandardFirmata, open it and upload it to your Arduino (we have only tried with Arduino UNO R3, so it may not work with other versions) and then close Arduino IDE. Next, open ‘Jupyter Notebook’ and paste the code that ChatGPT has formulated for you. Finally, upload it to your Arduino (using the SHIFT+ENTER key combination) and have fun improving it or fixing any errors!