Search found 5956 matches

by pythoncoder
Thu Mar 01, 2018 8:34 am
Forum: Programs, Libraries and Tools
Topic: TypeError: can't convert NoneType to int
Replies: 11
Views: 16357

Re: TypeError: can't convert NoneType to int

Re the LCD the driver doesn't maintain a cursor position. This is to keep it simple: these displays have only a few characters on each line. They refresh very fast. So a line update requires a string comprising all the text. Your options are either to adapt the driver to maintain a text cursor for e...
by pythoncoder
Thu Mar 01, 2018 8:17 am
Forum: ESP32 boards
Topic: RTC in uPy build for ESP32
Replies: 4
Views: 4369

Re: RTC in uPy build for ESP32

I hit the same issue. It doesn't appear to have been implemented. The Loboris port supports it.
by pythoncoder
Thu Mar 01, 2018 8:10 am
Forum: Programs, Libraries and Tools
Topic: LCD 160CR touch callback
Replies: 3
Views: 2565

Re: LCD 160CR touch callback

The solution I use in my LCD160CR touch GUI is to use uasyncio. An interrupt is really overkill in this type of application: latency of a few tens of ms is never going to be noticed in touch applications. This coroutine is how I handle checking for touch events.
by pythoncoder
Thu Mar 01, 2018 8:00 am
Forum: Drivers for External Components
Topic: DS3231 I2C real time clock.
Replies: 6
Views: 5765

Re: DS3231 I2C real time clock.

Looks kinda familiar ;) If you look at my source you'll see that I have a policy of referencing sources when I adapt the code of others. No beef - just saying. The above repo now includes a cross-platform version of this driver for those wishing to endow their ESP8266 with a decent RTC. The old Pybo...
by pythoncoder
Thu Mar 01, 2018 7:48 am
Forum: Drivers for External Components
Topic: RGB and Gesture Sensor - APDS-9960
Replies: 16
Views: 18221

Re: Licensing

...I'm not going to add MIT license header and just bloat the file... IANAL but I've noticed that many developers have a 2-line comment of the form # Copyright Guy Carver 2018 # Released under the MIT license with the full text in LICENSE.md. I'd be interested to hear from anyone who does have lega...
by pythoncoder
Thu Mar 01, 2018 6:48 am
Forum: General Discussion and Questions
Topic: timer isr function problem
Replies: 8
Views: 5023

Re: timer isr function problem

The problem here is that Viper likes to know the type of variables. Where variables are passed as function arguments you can use Python type hinting to solve this, but this isn't an option in a timer ISR. One solution is to use the Native decorator, but the code won't be as fast. You could do def ti...
by pythoncoder
Thu Mar 01, 2018 6:13 am
Forum: Other Boards
Topic: asynchronous buffered SPI Slave interface
Replies: 6
Views: 10255

Re: asynchronous buffered SPI Slave interface

Good luck! In my view this would be a great enhancement to the firmware so I hope you'll submit a PR when you've got it working.
by pythoncoder
Wed Feb 28, 2018 9:36 am
Forum: Programs, Libraries and Tools
Topic: TypeError: can't convert NoneType to int
Replies: 11
Views: 16357

Re: TypeError: can't convert NoneType to int

OK, we need to figure out what is being returned. Try this: def I2C_ReadRegister(Rd_Addr): global i2c, sensor result = i2c.mem_read(1, sensor[0], Rd_Addr, timeout=1000) if isinstance(result, bytes): if len(result) > 0: return result[0] # Return a single byte else: print('Zero length bytes object ret...
by pythoncoder
Tue Feb 27, 2018 2:40 pm
Forum: Programs, Libraries and Tools
Topic: uasyncio - asyncio-like cooperative multitasking framework for uPy
Replies: 114
Views: 135303

uasyncio V2.0

I have now tested this fairly thoroughly. It's an impressive upgrade in terms of task switching performance and there seems to be no downside. The only API change is to the initial call to get_event_loop() which needs adapting to set the queue sizes if an application runs more than 16 concurrent cor...
by pythoncoder
Tue Feb 27, 2018 2:31 pm
Forum: General Discussion and Questions
Topic: uasyncio
Replies: 17
Views: 21449

uasyncio 2.0

I have updated this repository to reflect the release of uasyncio V2.0 , which is on PyPi and supported by official firmware dated 22nd Feb 2018 or later. uasyncio V2.0 brings no API changes unless your application runs more than 16 concurrent coroutines; in this case you need to adapt the initial c...