Search found 8 matches

by Grumpy_Mike
Sat Mar 06, 2021 10:12 am
Forum: Raspberry Pi microcontroller boards
Topic: UART won't send all MIDI control messages [solved]
Replies: 4
Views: 2363

Re: UART won't send all MIDI control messages [solved]

Excellent, works like a charm.
Many thanks. :)
by Grumpy_Mike
Sat Mar 06, 2021 7:35 am
Forum: Raspberry Pi microcontroller boards
Topic: UART won't send all MIDI control messages [solved]
Replies: 4
Views: 2363

Re: UART won't send all MIDI control messages

Roberthh wrote:
Sat Mar 06, 2021 7:24 am
why not using ser.write(b'\xC0'))? That avoids problems with encoding.
So it does thanks. I am not too familiar with python sending bytes that has always worked on "grown up" python.

How would you cope with oring a variable into that?
like

Code: Select all

ser.write(chr(0xC0 | channel ))
Thanks again.
by Grumpy_Mike
Sat Mar 06, 2021 7:21 am
Forum: Raspberry Pi microcontroller boards
Topic: UART won't send all MIDI control messages [solved]
Replies: 4
Views: 2363

UART won't send all MIDI control messages [solved]

I am trying to send some MIDI messages through the UART. I am finding that every message above 0xB0 produces nothing on the output as seen by the MIDI monitor app on a Mac. This is the code I am using:- """ MicroPython code to write from UART1 on the Pico sends some MIDI messages """ from machine im...
by Grumpy_Mike
Sat Feb 27, 2021 2:17 pm
Forum: Raspberry Pi microcontroller boards
Topic: installing default libraries on pico
Replies: 7
Views: 11041

Re: installing default libraries on pico

But how do I use this Library on the Pico? You first have to load in into the Pico. To do this click on the Tools menu in Thonny and choose "Manage Packages ..." The search for dht in the box. It should come up with at least one option. Choose the one that looks right from the description and selec...
by Grumpy_Mike
Sat Feb 27, 2021 2:07 pm
Forum: Raspberry Pi microcontroller boards
Topic: Control Neopixel strip from keypad?
Replies: 1
Views: 1412

Re: Control Neopixel strip from keypad?

We get this question almost every day on the Arduino forum. What you need to do is to rewrite your code that does the patterns in a way known as a state machine. This is so the code can look at the change button every time the pattern makes just one small step. This means you have to :- 1) remove al...
by Grumpy_Mike
Mon Feb 15, 2021 12:46 pm
Forum: Raspberry Pi microcontroller boards
Topic: PIO UART how to join them in MicroPython [solved]
Replies: 3
Views: 3263

Re: PIO UART how to join them in MicroPython [solved]

Ok this has now been proved to work:- from machine import mem32 PIO_base = [ 0x50200000, 0x50300000 ] SM_SHIFTCTRL= [ 0x0d0, 0x0e8, 0x100, 0x118] PIO_FIFO_JOIN_TX = 1 PIO_SM0_SHIFTCTRL_FJOIN_TX_BITS = 0x40000000 PIO_SM0_SHIFTCTRL_FJOIN_RX_BITS = 0x80000000 PIO_SM0_SHIFTCTRL_FJOIN_TX_LSB = 30 # then ...
by Grumpy_Mike
Mon Feb 15, 2021 9:35 am
Forum: Raspberry Pi microcontroller boards
Topic: PIO UART how to join them in MicroPython [solved]
Replies: 3
Views: 3263

Re: PIO UART how to join them in MicroPython

Thanks for the reply. I'm not quite sure I follow... can you elaborate? It just seemed to me that the buck was being passed over to you. It's almost certainly possible to use machine.mem32 to set the PIO shiftctrl register directly from Python It appears that is the answer. I got an answer on the RP...
by Grumpy_Mike
Sun Feb 14, 2021 8:12 pm
Forum: Raspberry Pi microcontroller boards
Topic: PIO UART how to join them in MicroPython [solved]
Replies: 3
Views: 3263

PIO UART how to join them in MicroPython [solved]

I want to join the TX and RX FIFO buffers together, using a PIO UART According to the rp2040 data sheet this is done by:- sm_config_set_fifo_join(&c, PIO_FIFO_JOIN_TX) But this is in C, does anyone know the python for this? I asked this on the Raspberry Pi forum and the bottom line was:- I guess it ...