Search found 1044 matches

by Roberthh
Thu Oct 18, 2018 1:52 pm
Forum: General Discussion and Questions
Topic: Function with variable parameters in viper emitter
Replies: 2
Views: 35

Re: Function with variable parameters in viper emitter

I do not know the answer, unless you have a special "out of band" value for data. If data is a byte value, e.g. 256. Otherwise I would make two functions for reading and writing.
by Roberthh
Tue Oct 16, 2018 12:29 pm
Forum: General Discussion and Questions
Topic: Allocation when slicing memoryview instance
Replies: 5
Views: 85

Re: machine.I2C: allocation reading into pre-allocated buffer

I am also confused by the follwing, which I stumbled over a few days (or weeks) ago, and which did not meet my expectation: >>> s="1234567890" >>> m=memoryview(s) >>> m[0:2] <memoryview> >>> m[0] 49 >>> x=m[0:2] >>> x <memoryview> >>> s[0:2] '12' >>> for _ in m[0:2]: ... _ ... 49 50 I expeceted m[0:...
by Roberthh
Mon Oct 15, 2018 7:48 pm
Forum: Drivers for External Components
Topic: Bidirectional communication using I2C
Replies: 5
Views: 101

Re: Bidirectional communication using I2C

@pythoncoder That looks very impressive. And I learned two new sayings.
by Roberthh
Fri Oct 12, 2018 1:29 pm
Forum: ESP32 boards
Topic: How to not run boot.py?
Replies: 8
Views: 160

Re: How to not run boot.py?

Depending on the board it might be control line setting of PuTTY. Set PuTTY to Flow control = None.
It is under Confguration->Connection->Serial->Flow Control
by Roberthh
Fri Oct 12, 2018 1:24 pm
Forum: ESP32 boards
Topic: How to not run boot.py?
Replies: 8
Views: 160

Re: How to not run boot.py?

The ESP32 has an internal pull-up for GPIO0. That ensures proper operation if it is left floating. So I guess you have something connected to GPIO0 which pulls it low. Please check your wiring.
by Roberthh
Fri Oct 12, 2018 11:50 am
Forum: ESP32 boards
Topic: How to not run boot.py?
Replies: 8
Views: 160

Re: How to not run boot.py?

What you see is the built-in bootloader of the ESP32 chip, which starts when at Power-up or reset GPIO0 is connected to GND or at low level. So please check the GPIO0 connection. This is nothing which can be changed by the MicroPython firmware.
by Roberthh
Fri Oct 12, 2018 5:28 am
Forum: General Discussion and Questions
Topic: Python and MicroPython compatibility
Replies: 3
Views: 108

Re: Python and MicroPython compatibility

You can bundle functions with differ in separate modules and import either of them, depending on the python version.
by Roberthh
Thu Oct 11, 2018 6:58 pm
Forum: General Discussion and Questions
Topic: Python and MicroPython compatibility
Replies: 3
Views: 108

Re: Python and MicroPython compatibility

you could use:
const = lambda x:x
to avoid re-doing const statements. and you can query like:
if sys.implementation.name == "micropython":
......
to implement variants.
by Roberthh
Thu Oct 11, 2018 6:27 pm
Forum: ESP8266 boards
Topic: sending hex via UART
Replies: 7
Views: 114

Re: sending hex via UART

Yes. The data is converted into a hex representation. I understood that this is what you need. So what is the data format the receiveing device expects? If you want to send the 4 bytes, you do not have to convert and you can send them directly. If you need just ASCII hex, you can use ubinascii.hexli...
by Roberthh
Thu Oct 11, 2018 4:19 pm
Forum: ESP8266 boards
Topic: sending hex via UART
Replies: 7
Views: 114

Re: sending hex via UART

That's right