Search found 20 matches

by Philosophix
Thu Jan 10, 2019 7:10 am
Forum: The MicroPython pyboard
Topic: Save data on power down
Replies: 14
Views: 274

Re: Save data on power down

Saving a number to stm.mem32[stm.RTC+stm.RTC_BKP9R] on power down is working fine, but I need to save another number too which can fit in 16 bits. Is there room for another number and if so, what is the address? The Wiki: http://wiki.micropython.org/platforms/b ... ard/modstm won't let me access htt...
by Philosophix
Sat Jan 05, 2019 6:34 am
Forum: The MicroPython pyboard
Topic: PYBv1.1 V+ range
Replies: 7
Views: 156

Re: PYBv1.1 V+ range

Thank you for your suggestions! I'll do that.
by Philosophix
Fri Jan 04, 2019 8:59 pm
Forum: The MicroPython pyboard
Topic: Speed calculation
Replies: 3
Views: 114

Re: Speed calculation

So I schedule a callback-function in the timer callback-function?
What do I do with the arg-argument of the schedule-function if I'm scheduling a function with no args?
Thanx!
by Philosophix
Fri Jan 04, 2019 8:22 pm
Forum: The MicroPython pyboard
Topic: PYBv1.1 V+ range
Replies: 7
Views: 156

Re: PYBv1.1 V+ range

Do you have any suggestions for the RC as my knowledge of electronics is very rudimentary?
by Philosophix
Fri Jan 04, 2019 8:00 pm
Forum: The MicroPython pyboard
Topic: Speed calculation
Replies: 3
Views: 114

Speed calculation

I was thinking of calculating vehicle speed in a timer callback-function set to be called at 1 hz, but am unsure what I'm allowed to do inside the callback. Can I declare and use local variables, call other functions, ...? Or is there a better way to implement speed calculation when I know how many ...
by Philosophix
Fri Jan 04, 2019 7:49 pm
Forum: The MicroPython pyboard
Topic: PYBv1.1 V+ range
Replies: 7
Views: 156

Re: PYBv1.1 V+ range

Is a 7809 regulator sufficient then?
by Philosophix
Fri Jan 04, 2019 3:31 pm
Forum: The MicroPython pyboard
Topic: PYBv1.1 V+ range
Replies: 7
Views: 156

PYBv1.1 V+ range

Looking at http://micropython.org/resources/pybv11-pinout.jpg i see that I should be able to power the pyb directly from a tractor electrical system which is ~14 V when the tractor is running as the image says V+ can be 3.6-16 V. Is this correct? I've been using a 9 V regulator on my protoboard to f...
by Philosophix
Fri Jan 04, 2019 3:25 pm
Forum: The MicroPython pyboard
Topic: Save data on power down
Replies: 14
Views: 274

Re: Save data on power down

I was accidentally looking at the PYB1.0 picture in the quick reference where there is no VBACK. I have PYB1.1 so after getting the correct picture I added a CR2032 to VBACK and which is working fine with the code you provided. I still can't find any documentation on the stm-module.
by Philosophix
Fri Jan 04, 2019 7:14 am
Forum: The MicroPython pyboard
Topic: Is there a code level reason why my interrupt is not getting called?
Replies: 9
Views: 167

Re: Is there a code level reason why my interrupt is not getting called?

For future reference: ext.enable() and while True: pass were not needed to make the interrupt work. Also the interrupt callback function axle_pulse_detected(line) will only be: def axle_pulse_detected(line): global axle_pulse_counter axle_pulse_counter += 1 The lcd printouts were just for debugging ...
by Philosophix
Fri Jan 04, 2019 6:55 am
Forum: The MicroPython pyboard
Topic: Is there a code level reason why my interrupt is not getting called?
Replies: 9
Views: 167

Re: Is there a code level reason why my interrupt is not getting called?

Adding

Code: Select all

global axle_pulse_counter
fixed the problem as all variables are assumed to be local in a python function. You can access a global variable without the explicit global declaration, but you can't modify it without it. You live, you learn. Thanx a million Roberthh!!