Re: Some examples ?

Liste des GroupesRevenir à ol advocacy 
Sujet : Re: Some examples ?
De : bowman (at) *nospam* montana.com (rbowman)
Groupes : comp.os.linux.advocacy
Date : 10. Mar 2024, 22:14:19
Autres entêtes
Message-ID : <l56ikrFh9tiU1@mid.individual.net>
References : 1 2 3 4 5 6 7
User-Agent : Pan/0.149 (Bellevue; 4c157ba)
On Sat, 09 Mar 2024 23:32:35 -0800 (Seattle), Relf wrote:

rBowman:
[ My 4 $ RPi Pico makes ] sure everything is working.
 
Could you give us some examples ?

Of the tool chain? The first step is to download the latest MicroPython
package:

https://micropython.org/download/RPI_PICO/

When you hold down the boot seelct button while plugging the device into
the USB bus it shows up in Dolphin as a mass storage device with what I
guess is meant to be a Raspberry Pi icon. You copy the u2e file to the
device and it resets.

Next, start Thonny and make sure it sees the device. I'd never used Thonny
and that was a little different. By default is shows the Python installed
on the host machine, but clicking on the lower left corner brings up a
selection where you can pick the MicroPython on the device.  There is a
REPL pane where you can run simple commands.

The device shows up as /dev/ttyACM0 and may require setting group
permissions to access. I haven't tried plugging in an Arduino or another
device but I assume that would show as ttyACM1 (ACM -- abstract control
model) and you'd have to sort out which was which.



I've got the Pico W with Wifi so that's a little different than the plain
Pico. The on board LED is associated with the Wifi chip and not a separate
pin. A lot of the online sites like

https://projects.raspberrypi.org/en/projects/getting-started-with-the-
pico/5

show

from machine import Pin
led = Pin(25, Pin.OUT)

led.toggle()


which does not work with the W. It needs to be 'led = Pin("LED", Pin.OUT).

Then you can do a simple script in the Thonny editor

from machine import Pin
from time import sleep

led = Pin("LED", Pin.OUT)
while True:
    led.value(1)
    sleep(0.5)
    led.value(0)
    sleep(0.5)

The Run button transfers the script to the device and it blinks. That's
the 'hello world' of the uP world. There's a lot of other things to check
out

https://docs.micropython.org/en/latest/rp2/quickref.html

The Pico doesn't have a lot of goodies on board so after the simple blink
you need to start wiring it up.

https://peppe8o.com/using-gyroscope-and-accelerometer-with-mpu6050-
raspberry-pi-pico-and-micropython/

The Arduino Nano 33 BLE Sense has a similar form factor and a lot more
included on the board.

https://gilberttanner.com/blog/arduino-nano-33-ble-sense-overview/

Prices are volatile since there are a lot of clones in the market but a
Nano is roughly $40 and a Pico under $10. The Core M4 is a little better
than the M0+ too. It all depends on what you want to do. For example a
remote controller with a thumb joystick and a nRF24L01 transceiver would
require external parts for both so you might as well go cheap. For a
project where you need an IMU the Nano may come out cheaper and will be
easier to package without the external boards. Same for a remote weather
station where the Nano has temperature, pressure, and humidity sensors on
board.

Programming is similar  and you can use C/C++ or MicroPython with both. I
know the Nano can use the Mbed RTOS but I'm not sure about the Pico.










Date Sujet#  Auteur
7 Mar 24 * OT programming challenge: fastest/best/shortest C program to jumble a sentence, then restore it26DFS
7 Mar 24 `* Re: OT programming challenge: fastest/best/shortest C program to jumble a sentence, then restore it25rbowman
8 Mar 24  +* Re: OT programming challenge: fastest/best/shortest C program to jumble a sentence, then restore it23DFS
8 Mar 24  i`* Re: OT programming challenge: fastest/best/shortest C program to jumble a sentence, then restore it22rbowman
8 Mar 24  i +* Re: OT programming challenge: fastest/best/shortest C program to jumble a sentence, then restore it8DFS
8 Mar 24  i i+* Re: OT programming challenge: fastest/best/shortest C program to jumble a sentence, then restore it4DFS
9 Mar 24  i ii`* Re: OT programming challenge: fastest/best/shortest C program to jumble a sentence, then restore it3rbowman
9 Mar 24  i ii `* Re: OT programming challenge: fastest/best/shortest C program to jumble a sentence, then restore it2vallor
9 Mar 24  i ii  `- Re: OT programming challenge: fastest/best/shortest C program to jumble a sentence, then restore it1rbowman
9 Mar 24  i i`* Re: OT programming challenge: fastest/best/shortest C program to jumble a sentence, then restore it3rbowman
9 Mar 24  i i `* Re: OT programming challenge: fastest/best/shortest C program to jumble a sentence, then restore it2vallor
9 Mar 24  i i  `- Re: OT programming challenge: fastest/best/shortest C program to jumble a sentence, then restore it1rbowman
9 Mar 24  i `* Re: OT programming challenge: fastest/best/shortest C program to jumble a sentence, then restore it13DFS
9 Mar 24  i  `* Re: OT programming challenge: fastest/best/shortest C program to jumble a sentence, then restore it12rbowman
9 Mar 24  i   +- Re: OT programming challenge: fastest/best/shortest C program to jumble a sentence, then restore it1DFS
9 Mar 24  i   `* Re: OT programming challenge:10rbowman
10 Mar 24  i    `* Re: OT programming challenge:9Chris Ahlstrom
10 Mar 24  i     `* Re: OT programming challenge:8rbowman
10 Mar 24  i      +* Re: 16-bit floating-point.5rbowman
10 Mar 24  i      i`* Re: Some examples ?4rbowman
11 Mar 24  i      i `* Re: How does your Pico "make sure everything is working" ?3rbowman
11 Mar 24  i      i  `* Re: I was burning EEPROMs for handheld devices back in 1984, Orem Utah.2rbowman
11 Mar 24  i      i   `- Re: Had any good Blutwurst lately ?1rbowman
10 Mar 24  i      +- Re: OT programming challenge:1Chris Ahlstrom
10 Mar 24  i      `- Re: 16-bit floating-point.1DFS
9 Mar 24  `- Re: OT programming challenge: fastest/best/shortest C program to jumble a sentence, then restore it1DFS

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal