Search found 1315 matches

by pythoncoder
Sun Feb 26, 2017 8:43 am
Forum: The WiPy
Topic: GPIO irq callback problem
Replies: 1
Views: 30

Re: GPIO irq callback problem

Testing a function from the REPL doesn't prove it will work as an interrupt handler. I suggest you read http://docs.micropython.org/en/latest/esp8266/reference/isr_rules.html . The way to proceed is to have the interrupt handler set a flag which is tested in a main loop which runs forever. When the ...
by pythoncoder
Sun Feb 26, 2017 8:25 am
Forum: ESP8266 boards
Topic: esp.deepsleep() overflow
Replies: 2
Views: 71

Re: esp.deepsleep() overflow

To differentiate short integers from arbitrary precision integers MicroPython uses the MSB. This means that short integers must have b30 == b31. So I think the maximum is 1073s (0x3fffffff // 1000000).
by pythoncoder
Sun Feb 26, 2017 7:46 am
Forum: The MicroPython pyboard
Topic: Showing jpeg file on LCD160
Replies: 3
Views: 81

Re: Showing jpeg file on LCD160

I can't make this work either. As far as I can see the following should work but in practice it merely erases the screen. from lcd160cr import LCD160CR buf = bytearray(10000) with open('/sd/test.jpg', 'rb') as f: f.readinto(buf) lcd = LCD160CR('Y') lcd.set_pen(0, 0) lcd.erase() lcd.set_pos(0,0) lcd....
by pythoncoder
Sun Feb 26, 2017 7:11 am
Forum: Hardware Projects
Topic: Graphing barometer - storm Doris
Replies: 4
Views: 90

Re: Graphing barometer - storm Doris

I use a 2AH LiPoly. In principle this should provide about two months operation but I haven't tested this. You'll need to measure your current consumption which is dependent on hardware and software. With low power systems which spend most of their time in deep sleep you'll need to measure what happ...
by pythoncoder
Sat Feb 25, 2017 12:11 pm
Forum: Hardware Projects
Topic: Graphing barometer - storm Doris
Replies: 4
Views: 90

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: 180

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: 147

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: 180

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: 48

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: 147

MicroPython bug?

This could be a MicroPython bug. What does the team think?

Go to advanced search