print (bytes(buf).find(b'OK')) #test if buf contains a substring 'OK'
Note: bytes(buf) creates a copy of buf.
Search found 2581 matches
- Thu Apr 22, 2021 9:20 am
- Forum: MicroPython pyboard
- Topic: Most efficient searching within large bytearrays
- Replies: 7
- Views: 1455
- Wed Apr 21, 2021 7:54 pm
- Forum: Programs, Libraries and Tools
- Topic: More convenient pin initialization for ESP8266
- Replies: 4
- Views: 109
Re: More convenient pin initialization for ESP8266
It can be done by modifying machine_pin.c. At line 312 the pin number is taken from the argument. That has to extended to compare against a string of known Pin names.I made a trial build by: a) extending the _pin_obj_t structure in modmachine.h to: typedef struct _pyb_pin_obj_t { mp_obj_base_t base;...
- Wed Apr 21, 2021 4:03 pm
- Forum: Raspberry Pi microcontroller boards
- Topic: [SOLVED] #include "tusb.h" not working
- Replies: 8
- Views: 165
Re: #include "tusb.h" not working
I simply call make in the ports/rp2 directory. By default there is a Makefile as wrapper to cmake.
Edit: I do not add any include "tusb.h". No need to fo so.
Edit: I do not add any include "tusb.h". No need to fo so.
- Wed Apr 21, 2021 3:17 pm
- Forum: Raspberry Pi microcontroller boards
- Topic: [SOLVED] #include "tusb.h" not working
- Replies: 8
- Views: 165
Re: #include "tusb.h" not working
I can build that without any changes to scripts. So maybe you start over with: make clean and make I had that problem too initially, but that went away after Feb 12 with the. I cannot find the discussion I had about that any more. maybe related: https://github.com/micropython/micropython/pull/6791 h...
- Wed Apr 21, 2021 2:14 pm
- Forum: Raspberry Pi microcontroller boards
- Topic: [SOLVED] #include "tusb.h" not working
- Replies: 8
- Views: 165
Re: #include "tusb.h" not working
AFAIK, I had to deinit these submodules first and then update them again.
- Wed Apr 21, 2021 1:54 pm
- Forum: Raspberry Pi microcontroller boards
- Topic: [SOLVED] #include "tusb.h" not working
- Replies: 8
- Views: 165
- Wed Apr 21, 2021 1:14 pm
- Forum: Development of MicroPython
- Topic: Attaching main.py into the build firmware.
- Replies: 3
- Views: 86
Re: Attaching main.py into the build firmware.
It should be possible, since one of the actions in _boot.py is creating the file system in flash with boot.py if required. The template for that boot.py is in the file inisetup.py, also located in modules.
- Wed Apr 21, 2021 11:31 am
- Forum: General Discussion and Questions
- Topic: Can't import from directory
- Replies: 3
- Views: 100
Re: Can't import from directory
Using the proper path separator is essential. Maybe you should put aside pycharm for a moment and use a simple terminal emulator like putty. Or use Thonny.
Without the proper file separator, Spielwiesen is not a directory, but just the part of a file name.
Without the proper file separator, Spielwiesen is not a directory, but just the part of a file name.
- Wed Apr 21, 2021 11:28 am
- Forum: ESP32 boards
- Topic: Some pins are in HIGH mode after reboot
- Replies: 2
- Views: 57
Re: Some pins are in HIGH mode after reboot
Just floating pins in input mode.but sometimes all pins of one side from D27 to VP (d27 d26 d25 d33 d32 d35 d34 VN VP) show about 1v or 0,8v.
What's that?
- Wed Apr 21, 2021 8:39 am
- Forum: General Discussion and Questions
- Topic: how to raise a keyboard exception
- Replies: 2
- Views: 53