Search found 3821 matches

by dhylands
Tue Sep 06, 2022 5:33 pm
Forum: Raspberry Pi microcontroller boards
Topic: Pico W server stops after a while loop
Replies: 6
Views: 28499

Re: Pico W server stops after a while loop

If you use a try/except, make sure that your except prints out the reason (except perhaps for expected exceptions).

Otherwise if you have a simple typo or other error, it will get "eaten" by your exception handler and your code isn't actually running.
by dhylands
Tue Sep 06, 2022 5:30 pm
Forum: Raspberry Pi microcontroller boards
Topic: led flash 10 times, not 5?
Replies: 7
Views: 35087

Re: led flash 10 times, not 5?

boot.py will run every time that the micropython board is soft reset, which included entering the RAW REPL. Programs like Thonny, rshell, mpremote all use the raw repl for every command that they execute. rshell executes about 5 commands when it connects to a board, so your boot.py will get run 5 ti...
by dhylands
Tue Aug 23, 2022 6:09 pm
Forum: Programs, Libraries and Tools
Topic: Why do `rshell` and `ampy` run boot.py and main.py for every command?
Replies: 3
Views: 23568

Re: Why do `rshell` and `ampy` run boot.py and main.py for every command?

rshell does whatever pyboard.py does (since it uses pyboard.py to do all of the low level stuff). When micropython boots up it runs boot.py and then if it's running the raw REPL it will skip running main.py https://github.com/micropython/micropython/blob/13dceaa4ea4336eddb763985c2274cfa497c8e82/port...
by dhylands
Sun Jul 31, 2022 3:59 pm
Forum: Raspberry Pi microcontroller boards
Topic: Unable to blink unboard LED. (Pico and MicroPython)
Replies: 6
Views: 7190

Re: Unable to blink unboard LED. (Pico and MicroPython)

On the Pico W you need to use

Code: Select all

led = Pin('LED', Pin.OUT)
rather than

Code: Select all

led = Pin(25, Pin.OUT)
by dhylands
Sat Jul 30, 2022 2:39 pm
Forum: General Discussion and Questions
Topic: board.py Files
Replies: 5
Views: 8702

Re: board.py Files

I'm not aware of any convention per-say. When I create them they just look something like this:

Code: Select all

name = 'custom'
I'm also not familiar with whats in Adafruit's board.py file.
by dhylands
Sat Jul 30, 2022 3:47 am
Forum: General Discussion and Questions
Topic: Convert Byte-String to Ascii-String -SOLVED
Replies: 8
Views: 10244

Re: Convert Byte-String to Ascii-String -SOLVED

I also have a little utilty I wrote called dump_mem.py which you can find here: https://github.com/dhylands/bioloid3/blob/master/bioloid/dump_mem.py It prints out output that looks like this: 0000: 30 31 32 33 34 35 36 37 01234567 0008: 38 39 41 42 43 44 45 46 89ABCDEF 0010: 47 G It has options for ...
by dhylands
Sat Jul 30, 2022 3:24 am
Forum: General Discussion and Questions
Topic: board.py Files
Replies: 5
Views: 8702

Re: board.py Files

The documentation for rshell is here: https://github.com/dhylands/rshell and the specific stuff about board.py is here: https://github.com/dhylands/rshell#file-system
by dhylands
Mon Jul 25, 2022 7:08 pm
Forum: General Discussion and Questions
Topic: UART reading data issue
Replies: 8
Views: 8660

Re: UART reading data issue

It looks like there is one missing character: 0x03 which happens to correspond to Control-C (this may or may not be relevant). Which board are you using? Normally, I've only seen this issue when using the REPL as a UART. You might want to try disabling Control-C by calling micropython.kbd_intr(-1) B...
by dhylands
Wed Jul 13, 2022 7:42 pm
Forum: General Discussion and Questions
Topic: Timer Callback Can't Be Stopped
Replies: 7
Views: 6988

Re: Timer Callback Can't Be Stopped

Sorry, my fault. When you're in the raw repl the commands don't get executed until a Control-D is received.

So try changing the pyb.serial.write to look like this instead:

Code: Select all

pyb.serial.write(b'stop_pyb()\r\x04')
by dhylands
Fri Jul 08, 2022 12:54 am
Forum: Raspberry Pi microcontroller boards
Topic: LCD1602 error I2C
Replies: 10
Views: 14268

Re: LCD1602 error I2C

Do you have pullups on both sides of the level converter?