Search found 4914 matches

by pythoncoder
Mon Feb 22, 2021 6:11 pm
Forum: Hardware Projects
Topic: Wind Speed?
Replies: 5
Views: 185

Re: Wind Speed?

I had something like this in mind. This assumes you've installed the Switch primitive as per the docs: from machine import Pin import uasyncio as asyncio from primitives.switch import Switch from time import ticks_diff, ticks_ms tstart = None delta = None # Callback on debounced switch closure def t...
by pythoncoder
Mon Feb 22, 2021 5:50 pm
Forum: Raspberry Pi microcontroller boards
Topic: Connecting a ILI9341 2.8" Touch Display 320*240 to Raspberry Pico
Replies: 3
Views: 126

Re: Connecting a ILI9341 2.8' Display 320*240 to Pico

There is also nano-gui which has a driver for ILI9341.

Unfortunately some of the widgets don't work with the Pico because currently the Pico lacks the cmath library. Hopefully that, and other similar issues, will be fixed soon. Only the circular widgets and the graph plotting module are affected.
by pythoncoder
Mon Feb 22, 2021 1:01 pm
Forum: Raspberry Pi microcontroller boards
Topic: PIO: meaning of PIO.OUT_HIGH and PIO.OUT_LOW
Replies: 6
Views: 203

Re: PIO: meaning of PIO.OUT_HIGH and PIO.OUT_LOW

Just in case you guys haven't got there first...

It took me a long while to get it to jump on a pin. The trick is

Code: Select all

sm0 = rp2.StateMachine(0, period, in_base=pin16, jmp_pin=pin16)
The documentation for this is here which gives a clue about other args.
by pythoncoder
Mon Feb 22, 2021 8:36 am
Forum: Raspberry Pi microcontroller boards
Topic: PIO: meaning of PIO.OUT_HIGH and PIO.OUT_LOW
Replies: 6
Views: 203

Re: PIO: meaning of PIO.OUT_HIGH and PIO.OUT_LOW

Does this, from the SPI example in the Python doc, give a clue? self._sm = rp2.StateMachine(sm_id, spi_cpha0, freq=4*freq, sideset_base=Pin( pin_sck), out_base=Pin(pin_mosi), in_base=Pin(pin_sck)) The Python doc is seriously lacking :( [EDIT] My understanding of I/O is that input and output pins mus...
by pythoncoder
Mon Feb 22, 2021 7:00 am
Forum: ESP32 boards
Topic: multi-threading question
Replies: 15
Views: 847

Re: multi-threading question

Perhaps I didn't express myself well, but none of that contradicts my post. I didn't mention the multiprocessing module because MicroPython has no equivalent. Threading does solve the problem of blocking I/O, both in CPython and MicroPython. However, in MicroPython at least, it is much more efficien...
by pythoncoder
Mon Feb 22, 2021 6:39 am
Forum: General Discussion and Questions
Topic: New uasyncio feature: ThreadSafeFlag
Replies: 2
Views: 100

Re: New uasyncio feature: ThreadSafeFlag

Good point. I've added a note to that effect.
by pythoncoder
Sun Feb 21, 2021 6:11 pm
Forum: Raspberry Pi microcontroller boards
Topic: PIO: meaning of PIO.OUT_HIGH and PIO.OUT_LOW
Replies: 6
Views: 203

Half solved. I think.

I've found this on P24 of this doc : You need to specify an initial OUT pin state in your program in order to be able to pass OUT mapping to your SM instantiation So it defines the level on the pin before you set it; with hindsight I guess this is obvious. It still doesn't make a lot of sense for an...
by pythoncoder
Sun Feb 21, 2021 4:48 pm
Forum: Raspberry Pi microcontroller boards
Topic: PIO: meaning of PIO.OUT_HIGH and PIO.OUT_LOW
Replies: 6
Views: 203

PIO: meaning of PIO.OUT_HIGH and PIO.OUT_LOW

I have been playing with this script from the official demos: import time from machine import Pin import rp2 # Define an empty program that uses a single set pin. @rp2.asm_pio(set_init=rp2.PIO.OUT_HIGH) def prog(): pass # Construct the StateMachine, binding Pin(25) to the set pin. sm = rp2.StateMach...
by pythoncoder
Sun Feb 21, 2021 3:59 pm
Forum: ESP32 boards
Topic: Chinese enhanced firmware for framebuf components
Replies: 4
Views: 108

Re: Chinese enhanced firmware for framebuf components

Alas I can't read the Chinese README, so I may be wrong. But this appears to be closed source. If so, this is a pity as framebuf enhancements are of general interest.