Search found 1311 matches

by pythoncoder
Sat Feb 25, 2017 12:11 pm
Forum: Hardware Projects
Topic: Graphing barometer - storm Doris
Replies: 1
Views: 34

Graphing barometer - storm Doris

I built this about a year ago. Note the display showing Storm Doris passing over. Horizontal scale one week, divisions each day. The circle adjacent to the Y axis shows rate of change of pressure, a forward indicator of weather. http://hinch.me.uk/barometer/IMG_2517.JPG http://hinch.me.uk/barometer/...
by pythoncoder
Sat Feb 25, 2017 11:09 am
Forum: The MicroPython pyboard
Topic: Read ADC without reinitializing channel
Replies: 7
Views: 170

Re: Read ADC without reinitializing channel

That's a fast motor, so I see your problem. The MicroPython ADC read functions are rather limited, notably the fact that read_time blocks. Also it can't read more than one ADC concurrently which makes phase measurements of fast signals difficult. One possible solution might be to investigate the stm...
by pythoncoder
Thu Feb 23, 2017 6:31 am
Forum: General Discussion and Questions
Topic: ticks_diff not behaving
Replies: 5
Views: 141

Re: ticks_diff not behaving

In the light of @devnull's comments I wondered if there was a MicroPython bug related to an interrupt handler storing data in a dict. As far as I can see there is not. The following script is running fine on a Pyboard. import pyb from utime import ticks_diff, ticks_us, sleep data = {'time' : ticks_u...
by pythoncoder
Wed Feb 22, 2017 9:28 am
Forum: The MicroPython pyboard
Topic: Read ADC without reinitializing channel
Replies: 7
Views: 170

Re: Read ADC without reinitializing channel

An ADC read takes 94us here. When you apply a voltage to a motor winding, current increases relatively slowly (usually and to a first order proportional to the time integral of V/L). It's current which provides the motive force. Are you really sure that in this context 94us is slow? I'd measure the ...
by pythoncoder
Tue Feb 21, 2017 5:45 pm
Forum: Development of MicroPython
Topic: Cross compiling native code
Replies: 0
Views: 43

Cross compiling native code

If I cross compile a module with code having the @micropython.native decorator I get an "invalid micropython decorator" message. I assume it's necessary to tell mpy-cross the target architecture (Arm Thumb) but it's not obvious how to do this.
by pythoncoder
Tue Feb 21, 2017 4:23 pm
Forum: General Discussion and Questions
Topic: ticks_diff not behaving
Replies: 5
Views: 141

MicroPython bug?

This could be a MicroPython bug. What does the team think?
by pythoncoder
Tue Feb 21, 2017 8:14 am
Forum: Drivers for External Components
Topic: Touch GUI for the official Pyboard display
Replies: 5
Views: 164

Re: Touch GUI for the official Pyboard display

@fpp Thanks for the report - broken link now fixed. I'll be posting an update soon to enable the use of the device's internal fonts in addition to ones converted from ttf and otf files. External fonts are great at larger sizes but I'd expect the internal ones to work best if you want to create small...
by pythoncoder
Sun Feb 19, 2017 6:40 pm
Forum: Drivers for External Components
Topic: Touch GUI for the official Pyboard display
Replies: 5
Views: 164

Touch GUI for the official Pyboard display

This is targeted at applications in machine control and for the display of realtime data. Controls are rendered using graphics primitives rather than icons: this ensures that the controls are readily scalable. It uses uasyncio for scheduling and provides an event based API based on callbacks. It's b...
by pythoncoder
Sat Feb 18, 2017 5:20 pm
Forum: General Discussion and Questions
Topic: Timeout a Generic Function
Replies: 6
Views: 165

Re: Timeout a Generic Function

... would it actually be possible to build a control flow with coroutines that can run this function and force it to timeout even if it never `yields` but would otherwise run for an arbitrary amount of time? ... You're right, asyncio can't cope with blocking code. I think @dhylands' solution is the...
by pythoncoder
Sat Feb 18, 2017 5:50 am
Forum: General Discussion and Questions
Topic: Timeout a Generic Function
Replies: 6
Views: 165

Re: Timeout a Generic Function

I'd suggest using uasyncio. Have two coroutines, one acting as a watchdog timer. The main coroutine periodically feeds the dog. If the dog times out, it can take any action you require. I've written a guide to the MicroPython asyncio subset here https://github.com/peterhinch/micropython-async.git wh...

Go to advanced search