Search found 25 matches
- Fri Jul 16, 2021 1:59 pm
- Forum: General Discussion and Questions
- Topic: Access HTTP response header
- Replies: 2
- Views: 1942
Re: Access HTTP response header
I think https://github.com/SpotlightKid/mrequests is what you are looking for, in the examples dir there is a parse_response_headers.py.
- Thu Apr 22, 2021 4:12 pm
- Forum: ESP32 boards
- Topic: micropython-nano-gui with m5stickc.
- Replies: 2
- Views: 1757
Re: micropython-nano-gui with m5stickc.
Given that you are using RGB565 with 16 bit color values I think you want something like this: Thank you very much, Peter. It almost worked, but I have to change the function to: def rgb(g, b, r): return ((r & 0xf8) << 8) | ((g & 0xfc) << 3) | (b >> 3) Note the different order of params, gbr, not r...
- Wed Apr 21, 2021 12:59 pm
- Forum: ESP32 boards
- Topic: micropython-nano-gui with m5stickc.
- Replies: 2
- Views: 1757
micropython-nano-gui with m5stickc.
I'v managed to run nano-gui in the m5stickc with pure micropython, no uiflow firmware. I've copypasted the rgb function def rgb(r, g, b): return (r & 0xe0) | ((g >> 3) & 0x1c) | (b >> 6) from drivers/st7735r.py to https://github.com/lukasmaximus89/M5Stick-C-Micropython-1.12/blob/master/m5stickc_lcd....
- Mon Jul 30, 2018 7:53 am
- Forum: Other Boards
- Topic: Anyone working on a port to Nordics PCA10059 Dongle?
- Replies: 11
- Views: 9899
- Tue Jun 12, 2018 6:05 am
- Forum: Other Boards
- Topic: MCUDev Black STM32F407VET6 + STM32F407ZET6 dev boards
- Replies: 167
- Views: 309026
Re: Black STM32F407VET6 + STM32F407ZET6 dev boards
http://wiki.stm32duino.com/index.php?title=STM32F407 In here I have found: http://wiki.stm32duino.com/images/2/26/STM32F407VET6_pinoutDiagram.pdf pinout diagram http://wiki.stm32duino.com/images/0/05/Black_STM32f4VET6_Pinouts_Right.pdf Pinouts right side http://wiki.stm32duino.com/images/3/3e/Black...
- Thu Mar 29, 2018 2:39 pm
- Forum: MicroPython pyboard
- Topic: how to execute "OTHER" python scripts
- Replies: 12
- Views: 59135
Re: how to execute "OTHER" python scripts
I usually do this: cat test01.py def my_test(): print("hello, test") def main(): my_test() if __name__ == "__main__": main() and then, can do: >>> import test01 >>> from test01 import my_test >>> >>> test01.my_test() hello, test >>> test01.main() hello, test >>> >>> my_test() hello, test
- Mon Feb 26, 2018 7:14 am
- Forum: Programs, Libraries and Tools
- Topic: Thingspeak use with Micropython
- Replies: 1
- Views: 4364
- Mon Oct 30, 2017 7:45 pm
- Forum: ESP8266 boards
- Topic: Load json
- Replies: 6
- Views: 9421
Re: Load json
I stand corrected. After test the code, I see that ujson.load is the correct way.SpotlightKid wrote: ↑Mon Oct 30, 2017 7:13 pmThis should be:
(... do not use readlines)Code: Select all
with open(filename) as fp: data = ujson.load(fp)
- Mon Oct 30, 2017 11:05 am
- Forum: ESP8266 boards
- Topic: Load json
- Replies: 6
- Views: 9421
Re: Load json
Hi guys, I would like to load some parameters from a json file. I wrote an example: # mqtt.py : import ujson with open('document.json') as data_file: data = ujson.loads(data_file) (...) What i was wrong? The docs says: ujson.loads(str), Parse the JSON str and return an object. Raises ValueError if ...
- Fri Oct 27, 2017 3:39 pm
- Forum: ESP8266 boards
- Topic: [SOLVED] Motor shield for NodeMCU
- Replies: 9
- Views: 18773
Re: Motor shield for NodeMCU
I am trying to run motor shield with NodeMCU (ESP8266 12N), motor shield doc: https://smartarduino.gitbooks.io/user-mannual-for-esp-12e-motor-shield/content/index.html. (...) I've got the same shield, and it works, with this code you can get the idea: from machine import Pin, PWM """ nodemcu pins f...