Search found 553 matches

by jimmo
Mon Jun 03, 2019 1:13 am
Forum: Programs, Libraries and Tools
Topic: how run IRQ() IN IRQ()
Replies: 12
Views: 498

Re: IRQ() IN IRQ()

OK, makes sense. FYI, this is actually quite a difficult problem. The way to think about problems like this is with a thing called a "state machine". The idea is that your program can be in some state, and inputs cause it to move to the next state. An input is something like "a knock", or "some time...
by jimmo
Mon Jun 03, 2019 12:05 am
Forum: Programs, Libraries and Tools
Topic: how run IRQ() IN IRQ()
Replies: 12
Views: 498

Re: IRQ() IN IRQ()

No problem, your English is fine :) What sequence of knocks does your program need to detect? Is it just 5 quick knocks, or does there need to be a pattern? Another way to think about the problem -- if you had somehow a list that recorded the times when the last N knocks were detected, could you wri...
by jimmo
Sun Jun 02, 2019 11:57 pm
Forum: micro:bit boards
Topic: TM1637 - Grove 4 digit display
Replies: 8
Views: 927

Re: TM1637 - Grove 4 digit display

- I drag the tm1637.py into my card with Microsoft explorer Sorry I should have added an extra point -- the built-in filesystem in the micro:bit has nothing to do with the virtual USB drive you see in Windows Explorer. The foloder you see in Windows Explorer only supports one thing: dragging a .hex...
by jimmo
Sun Jun 02, 2019 11:53 pm
Forum: micro:bit boards
Topic: UART MP3 VOICE MODULE
Replies: 2
Views: 200

Re: UART MP3 VOICE MODULE

Unlike C, In Python (and MicroPython), if you write x = { 1, 9, 3 } that creates a set containing the numbers 1, 9, 3. One important thing about sets is that the order doesn't matter. In this case, you need an array of bytes to send to the device, in a specific order. MicroPython happily converts yo...
by jimmo
Sun Jun 02, 2019 11:43 pm
Forum: General Discussion and Questions
Topic: double precision float on ESP8266
Replies: 29
Views: 1172

Re: double precision float on ESP8266

hi,, if i follow the described way i get this error: TypeError: multiple bases have instance lay-out conflict hi! Sorry there have been lots of things described in this post - which part were you following? It's possible though you might have run into to what @pidou46 said "To avoid an error I remo...
by jimmo
Sun Jun 02, 2019 11:40 pm
Forum: ESP32 boards
Topic: ESP WROOM 32 urequests POST to Google Forms
Replies: 11
Views: 493

Re: ESP WROOM 32 urequests POST to Google Forms

I just tested this out on my own Google form: >>> import urequests >>> h = {'Content-Type': 'application/x-www-form-urlencoded' } >>> form_url = 'https://docs.google.com/forms/d/e/<doc id>/formResponse' >>> form_data = 'entry.714340709=micropython' >>> r = urequests.post(form_url, data=form_data, he...
by jimmo
Sun Jun 02, 2019 11:28 pm
Forum: ESP32 boards
Topic: ESP WROOM 32 urequests POST to Google Forms
Replies: 11
Views: 493

Re: ESP WROOM 32 urequests POST to Google Forms

It doesn't look like urequests.py handles chunked data or redirects well No, but this shouldn't prevent you posting the data. (i.e. the chunked result is only on the server back to you). Stretching my memory a bit, but are you still setting connection:keep-alive which you mentioned earlier. If you ...
by jimmo
Sun Jun 02, 2019 11:17 pm
Forum: Programs, Libraries and Tools
Topic: how run IRQ() IN IRQ()
Replies: 12
Views: 498

Re: IRQ() IN IRQ()

Also, once you set an IRQ on a pin, it stays on - you code will be continually adding the same callback to the pin.

Can you explain what your code needs to do (i.e. what is the sequence of knocks it needs to detect) and I can help you modify it.
by jimmo
Sun Jun 02, 2019 11:12 pm
Forum: Programs, Libraries and Tools
Topic: how run IRQ() IN IRQ()
Replies: 12
Views: 498

Re: IRQ() IN IRQ()

irq handlers need to be very short - you want them to do the minimal processing possible. Can you try instead making the irq handler only record the time that the event happened, and then have your main program detect when these flags have been set and do the actual user input etc. The other option ...
by jimmo
Sun Jun 02, 2019 1:22 pm
Forum: micro:bit boards
Topic: TM1637 - Grove 4 digit display
Replies: 8
Views: 927

Re: TM1637 - Grove 4 digit display

Just some extra background in case it's helpful: The microbit has two ways of putting python code onto it -- via the .hex file that you drag onto the virtual flash drive, and the built-in filesystem. (My experience has been that many people, even who have spent a lot of time doing cool stuff with th...