Search found 5153 matches

by pythoncoder
Tue May 18, 2021 12:23 pm
Forum: Programs, Libraries and Tools
Topic: minipip -- tool for installing both upip and pip compatible packages
Replies: 3
Views: 80

Re: minipip -- tool for installing both upip and pip compatible packages

That sounds like a great enhancement, especially the ability to install directly to a device. The scope of micropip is limited to replicating the functionality of upip under CPython (on Linux, Windows and OSX).
by pythoncoder
Tue May 18, 2021 10:56 am
Forum: Programs, Libraries and Tools
Topic: SSD1306 OLED Display
Replies: 2
Views: 75

Re: SSD1306 OLED Display

... Otherwise I would recommend to just get a library for SSD1306 display and use that. @seaside_motors Specifically the official driver . MicroPython is different from Adafruit's CircuitPython; Adafruit drivers won't work with MicroPython. So, if you're running MicroPython you need the official dr...
by pythoncoder
Tue May 18, 2021 10:50 am
Forum: General Discussion and Questions
Topic: Why does split method behave differently in an inline if-else statement?
Replies: 4
Views: 69

Re: Why does split method behave differently in an inline if-else statement?

This is a common "gotcha" and it's down to the way Python parses the code. It is effectively executed as

Code: Select all

a,b = (u.split('^') if ('^' in u) else u),''
rather than

Code: Select all

a,b = u.split('^') if ('^' in u) else (u,'')
by pythoncoder
Mon May 17, 2021 7:10 am
Forum: Drivers for External Components
Topic: Driver for SH1122 oled display
Replies: 3
Views: 743

Re: Driver for SH1122 oled display

Nice. ;)

I'm puzzled as to why, in the photo, your test script doesn't display the text "This display has more than 128 pixels".
by pythoncoder
Sat May 15, 2021 4:26 pm
Forum: MicroPython pyboard
Topic: Slave board REPL on UART?
Replies: 4
Views: 505

Re: Slave board REPL on UART?

This is only likely if someone else saw the same need and has written and tested a solution. Otherwise it's time to roll up your sleeves and get coding I'm afraid ;)
by pythoncoder
Sat May 15, 2021 8:57 am
Forum: General Discussion and Questions
Topic: Read an bytearray from json
Replies: 3
Views: 249

Re: Read an bytearray from json

You can always "cheat" and copy the data to a list: b = bytearray(x for x in range(256)) # Test with all possible values s = ujson.dumps([x for x in b]) z = bytearray(x for x in ujson.loads(s)) Not specially efficient, but then JSON never is. But the recipient has to do this explicit conversion. The...
by pythoncoder
Fri May 14, 2021 10:33 am
Forum: ESP8266 boards
Topic: problem with mqtt
Replies: 1
Views: 192

Re: problem with mqtt

I'm puzzled by the line number as this line should not be capable of an OSError. Have you got the current version? As a general point the official MQTT code is not robust and doesn't cope well with brief WiFi outages. Further, in my experience some (but not all) Sonoff kit has poor WiFi connectivity...
by pythoncoder
Tue May 11, 2021 4:36 pm
Forum: Pyboard D-series
Topic: Weird SPI behavior in Pyboard D-SF6
Replies: 3
Views: 662

Re: Weird SPI behavior in Pyboard D-SF6

A picture of an oscilloscope or logic analyser trace on the signals, a description of the fault, and a code sample should suffice. Can the failure be demonstrated with MOSI connected to MISO? Some of the machine methods allow simultaneous read and write. That would be ideal as it would enable easy r...
by pythoncoder
Mon May 10, 2021 6:18 am
Forum: General Discussion and Questions
Topic: Can MP support huge flash storages?
Replies: 2
Views: 217

Re: Can MP support huge flash storages?

As far as I know no microcontroller running MicroPython supports USB drives. However MicroPython will run on hardware with an underlying OS such as Raspberry Pi boards: you can simply run the Unix build of MP and access any disk visible to the OS. As for SD cards on microcontrollers I'm not aware of...