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.
Search found 3821 matches
- Tue Sep 06, 2022 5:33 pm
- Forum: Raspberry Pi microcontroller boards
- Topic: Pico W server stops after a while loop
- Replies: 6
- Views: 37205
- Tue Sep 06, 2022 5:30 pm
- Forum: Raspberry Pi microcontroller boards
- Topic: led flash 10 times, not 5?
- Replies: 7
- Views: 46312
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...
- 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: 32134
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...
- Sun Jul 31, 2022 3:59 pm
- Forum: Raspberry Pi microcontroller boards
- Topic: Unable to blink unboard LED. (Pico and MicroPython)
- Replies: 6
- Views: 8760
Re: Unable to blink unboard LED. (Pico and MicroPython)
On the Pico W you need to use rather than
Code: Select all
led = Pin('LED', Pin.OUT)
Code: Select all
led = Pin(25, Pin.OUT)
- Sat Jul 30, 2022 2:39 pm
- Forum: General Discussion and Questions
- Topic: board.py Files
- Replies: 5
- Views: 11001
Re: board.py Files
I'm not aware of any convention per-say. When I create them they just look something like this: I'm also not familiar with whats in Adafruit's board.py file.
Code: Select all
name = 'custom'
- Sat Jul 30, 2022 3:47 am
- Forum: General Discussion and Questions
- Topic: Convert Byte-String to Ascii-String -SOLVED
- Replies: 8
- Views: 12872
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 ...
- Sat Jul 30, 2022 3:24 am
- Forum: General Discussion and Questions
- Topic: board.py Files
- Replies: 5
- Views: 11001
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
- Mon Jul 25, 2022 7:08 pm
- Forum: General Discussion and Questions
- Topic: UART reading data issue
- Replies: 8
- Views: 10655
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...
- Wed Jul 13, 2022 7:42 pm
- Forum: General Discussion and Questions
- Topic: Timer Callback Can't Be Stopped
- Replies: 7
- Views: 8743
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:
So try changing the pyb.serial.write to look like this instead:
Code: Select all
pyb.serial.write(b'stop_pyb()\r\x04')
- Fri Jul 08, 2022 12:54 am
- Forum: Raspberry Pi microcontroller boards
- Topic: LCD1602 error I2C
- Replies: 10
- Views: 16235