Deprecated: Creation of dynamic property Timber\Site::$pingback is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Site.php on line 180

Deprecated: Creation of dynamic property Timber\User::$name is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/User.php on line 118

Deprecated: Creation of dynamic property Timber\Post::$_edit_lock is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_edit_last is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_meta_box_present is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_send_notification is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_modify_title_and_content is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_notification_custom_heading is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$onesignal_notification_custom_content is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_focuskw is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_metadesc is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_linkdex is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_content_score is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_estimated-reading-time-minutes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_wordproof_timestamp is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$tipologia is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_tipologia is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$attributi is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_attributi is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$in_evidenza_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_in_evidenza_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$inviato_in_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_inviato_in_newsletter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$fonte is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_fonte is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$fonte_url is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_fonte_url is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_category is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_content_type is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_attributes is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_yoast_wpseo_primary_speciali is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$_thumbnail_id is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$response_body is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_date_gmt is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$comment_status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$ping_status is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_password is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_name is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$to_ping is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$pinged is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_modified is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_modified_gmt is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_content_filtered is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$guid is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$menu_order is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$post_mime_type is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$comment_count is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71

Deprecated: Creation of dynamic property Timber\Post::$filter is deprecated in /var/www/html/web/app/themes/ilsoftware/vendor/timber/timber/lib/Core.php on line 71
Raspberry Pi Pico programmabile con il semplice linguaggio Basic

Raspberry Pi Pico programmabile con il semplice linguaggio Basic

Programmare il microcontroller Raspberry Pi Pico con il linguaggio Basic grazie al semplice interprete piccoloBASIC: cos'è e come funziona.
Raspberry Pi Pico programmabile con il semplice linguaggio Basic

Raspberry Pi Pico è un microcontroller a basso costo e ad alte prestazioni presentato a gennaio 2021 come la prima scheda Raspberry Pi a utilizzare il chip RP2040 sviluppato internamente dalla stessa fondazione. La scheda è progettata per applicazioni di prototipazione e sviluppo rapido, offrendo una piattaforma accessibile e potente per progetti embedded.

Il chip RP2040 su cui Raspberry Pi Pico basa il suo funzionamento, integra un processore dual-core ARM Cortex-M0+ a 133 MHz, 264 KB di RAM. La scheda integra numerose caratteristiche e connettori che la rendono molto versatile. Si pensi ai 26 pin GPIO che possono essere utilizzati per collegare una varietà di sensori, attuatori e altri dispositivi.

La scheda supporta la comunicazione seriale, I2C, SPI e PWM per connettersi ad altri dispositivi e componenti. Consta inoltre di 2 MB di memoria flash on-board per il salvataggio del firmware e dei dati. Raspberry Pi Pico può essere alimentata attraverso un connettore micro-USB o tramite i pin GPIO.

A luglio 2022, è stata presentata anche Raspberry Pi Pico W, una variante dotata anche del supporto WiFi. Recentemente (giugno 2023) è stata arricchita anche della connettività Bluetooth.

Un interprete Basic per Raspberry Pi Pico

Un interprete Basic è un programma che legge, analizza ed esegue istruzioni scritte nel linguaggio Basic. Il Basic (Beginner’s All-purpose Symbolic Instruction Code) è un linguaggio di programmazione ad alto livello sviluppato negli anni ’60 per rendere la programmazione più accessibile ai principianti. Gli interpreti Basic consentono agli utenti di scrivere istruzioni in linguaggio Basic e di vederle eseguite immediatamente.

A differenza dei compilatori, che traducono l’intero programma in linguaggio macchina prima dell’esecuzione, gli interpreti lavorano linea per linea. L’interprete legge una linea di codice, la analizza e la esegue immediatamente, mostrando i risultati o eventuali errori. In un altro articolo abbiamo visto le differenze tra linguaggio compilato e interpretato.

Anche se il Basic ha perso parte della sua popolarità nel corso degli anni, gli interpreti Basic sono ancora utilizzati oggi come strumenti di apprendimento e per lo sviluppo di applicazioni semplici.

Il progetto piccoloBASIC, da poco condiviso su GitHub, mira a semplificare la programmazione di Raspberry Pi Pico grazie all’uso di un interprete Basic. Gli utenti possono utilizzare tutti i costrutti fondamentali come let, if, print, for, goto e gosub. Inoltre, è possibile interagire con i pin GPIO in modo diretto, senza troppi equilibrismi.

Il Raspberry Pi Pico di norma è programmabile utilizzando il linguaggio di programmazione C/C++ o MicroPython. È possibile utilizzare un ambiente di sviluppo integrato (IDE) di propria scelta, come ad esempio il software di sviluppo Arduino o l’IDE di MicroPython, per scrivere e caricare il codice sul Pico.

Punto di partenza per realizzare piccoloBASIC è stato uBASIC di Adam Dunkels, “un interprete BASIC davvero semplice” così come viene descritto. “Scritto in un paio d’ore, per il gusto di farlo, è oggi utilizzato in un sacco di posti“.

Come usare piccoloBASIC con Raspberry Pi Pico

Per iniziare a lavorare con piccoloBASIC, è innanzi tutto necessario installare l’SDK Pico C/C++. La documentazione di supporto Getting started è il miglior punto di partenza. La variabile d’ambiente PICO_SDK_PATH dovrebbe essere definita come segue:

PICO_SDK_PATH=/home/pi/pico/pico-sdk/

A questo punto, basta clonare il codice dal repository GitHub, creare una directory chiamata build. Portandosi in tale cartella, si deve quindi impartire il comando che segue:

make -j4

Il file risultante, chiamato piccoloBASIC.uf2, può essere inviato sulla scheda Raspberry Pi Pico effettuando il riavvio, premendo bootsel quindi copiando il file .uf2.

Ti consigliamo anche

Link copiato negli appunti