Search found 3482 matches

by dhylands
Thu Jul 02, 2020 5:19 am
Forum: General Discussion and Questions
Topic: RTC callback
Replies: 8
Views: 728

Re: RTC callback

With timers it makes sense to get the timer object since there may be multiple timers.
With the RTC there is only one, so padding that as an argument doesn’t really help.
It probably makes sense to use whatever is most consistent with the other ports, but currently the RTC is fairly inconsistent.
by dhylands
Wed Jul 01, 2020 11:20 pm
Forum: General Discussion and Questions
Topic: RTC callback
Replies: 8
Views: 728

Re: RTC callback

I think you're right.

It looks like adding this line:

Code: Select all

pyb_extint_callback_arg[i] = MP_OBJ_NEW_SMALL_INT(i);
into the for loop in the extint_init0 function would fix things.
https://github.com/micropython/micropyt ... int.c#L635
by dhylands
Wed Jul 01, 2020 10:44 pm
Forum: General Discussion and Questions
Topic: UART write human-readable ASCII text
Replies: 4
Views: 491

Re: UART write human-readable ASCII text

Sorry I missed the point of that post. It turns out that you can use a UART as a file device with print as well. >>> u = pyb.UART(6, 115200) >>> x = 42 >>> y = 'foo' >>> z = {'a':32} >>> print('x =', x, 'y =', y, 'z =', z, file=u) >>> u.read() b"x = 42 y = foo z = {'a': 32}\n" >>> The above was done...
by dhylands
Wed Jul 01, 2020 6:38 pm
Forum: Programs, Libraries and Tools
Topic: How to file/report a bug
Replies: 4
Views: 495

Re: How to file/report a bug

You can post it here and we can discuss it to see if it's really a bug, or perhaps just a misuse or misunderstanding.

If you're sure it really is a bug, then you create a github issue.
by dhylands
Wed Jul 01, 2020 6:33 pm
Forum: General Discussion and Questions
Topic: Where is PinAF?
Replies: 3
Views: 377

Re: Where is PinAF?

The Pin and PinAF (for the pyboard) are both found in the pin.c file: https://github.com/micropython/micropython/blob/c2317a3a8d5f184de2f816078d91be699274b94e/ports/stm32/pin.c#L592 https://github.com/micropython/micropython/blob/c2317a3a8d5f184de2f816078d91be699274b94e/ports/stm32/pin.c#L669 Curren...
by dhylands
Wed Jul 01, 2020 6:25 pm
Forum: General Discussion and Questions
Topic: UART write human-readable ASCII text
Replies: 4
Views: 491

Re: UART write human-readable ASCII text

Sure. uart.write('This is a test\r\n') is perfectly valid code in MicroPython. And if I jumper the Tx and Rx signals together, then I can read it back too: >>> u = pyb.UART(6,115200) >>> u.write('This is a test\r\n') 16 >>> r = u.read() >>> print(r) b'This is a test\r\n' >>> r.decode() 'This is a te...
by dhylands
Wed Jul 01, 2020 6:17 pm
Forum: General Discussion and Questions
Topic: Where is correct doc source?
Replies: 6
Views: 591

Re: Where is correct doc source?

I think its the second one, which is really just a frontend for: https://github.com/micropython/micropyt ... cs/library

The first one, should be a "rendering" of whatever is found in the github repository.
by dhylands
Wed Jul 01, 2020 5:27 pm
Forum: General Discussion and Questions
Topic: RTC callback
Replies: 8
Views: 728

Re: RTC callback

On the STM32, the callback is actually an ExtInt callback and the argument is the line that caused the interrupt. For the RTC on the STM32F405, there are 3 different reasons (i.e. values of line) the RTC interrupt can be called. 17 = RTC Alarm 21 = RTC Tamper/RTC Timestamp 22 = RTC Wakeup In theory,...
by dhylands
Tue Jun 30, 2020 6:16 pm
Forum: Other Boards
Topic: Pybricks: MicroPython for LEGO
Replies: 7
Views: 3155

Re: Pybricks: MicroPython for LEGO

One way would be to use a for loop, so your code would now look like this: #!/usr/bin/env pybricks-micropython from pybricks.hubs import EV3Brick from pybricks.ev3devices import Motor from pybricks.parameters import Port from pybricks.robotics import DriveBase ev3 = EV3Brick() left_motor = Motor(Por...