Search found 3176 matches

by dhylands
Wed Jun 19, 2019 4:12 am
Forum: Other Boards
Topic: [NUCLEO-F446RE] rshell --> timed out or error in transfer to remote
Replies: 5
Views: 114

Re: [NUCLEO-F446RE] rshell --> timed out or error in transfer to remote

It looks like the problem was interference between writing to flash and the UART. If I commented out the file writes then the file would be transferred successfully (but not writeen to flash. So I added a call to os.sync and that seems to allow things to work properly. I was able to copy a 17K file ...
by dhylands
Wed Jun 19, 2019 1:26 am
Forum: Development of MicroPython
Topic: Executing frozen module code at REPL startup.
Replies: 4
Views: 82

Re: Executing frozen module code at REPL startup.

On my pyboard I put the following boot.py file into the modules directory: print('Executing frozen boot.py') def myfunc(): print('Executing myfunc') When I boot the board, I see this: Executing frozen boot.py MicroPython v1.11-47-g1a51fc9dd on 2019-06-18; PYBv1.1 with STM32F405RG Type "help()" for m...
by dhylands
Sat Jun 15, 2019 4:07 pm
Forum: ESP8266 boards
Topic: LCD 1602 - Library
Replies: 42
Views: 18018

Re: LCD 1602 - Library

In particular, this code: msg = 'This is a scrolling test. ' if (len(msg) < lcd.num_columns): msg += ' ' * (lcd.num_columns - len(msg)) for i in range(len(msg)): len2 = min(lcd.num_columns, len(msg) - i) len1 = lcd.num_columns - len2 msg2 = '' if len2 > 0: msg2 += msg[i:i+len2] if len1 > 0: msg2 += ...
by dhylands
Sat Jun 15, 2019 4:04 pm
Forum: ESP8266 boards
Topic: LCD 1602 - Library
Replies: 42
Views: 18018

Re: LCD 1602 - Library

You need to use the i2c version and just extract the code that does the scrolling. The GPIO version doesn't work with LCDs that have i2c backpacks.
by dhylands
Fri Jun 14, 2019 4:50 pm
Forum: Other Boards
Topic: [NUCLEO-F446RE] rshell --> timed out or error in transfer to remote
Replies: 5
Views: 114

Re: [NUCLEO-F446RE] rshell --> timed out or error in transfer to remote

I ran into this on the F401 as well (when transferring over UART), and I haven't spent the time to figure out what the underlying problem is. I suspect that characters are being dropped on the UART connection. I'll see if I can look into this next week. This used to work, but it might have something...
by dhylands
Tue Jun 11, 2019 5:31 pm
Forum: General Discussion and Questions
Topic: Need help freeing memory from unused modules
Replies: 9
Views: 208

Re: Need help freeing memory from unused modules

By setting up your sys.path appropriately you can freeze everything and override just the portions that need to be overridden. sys.path contains a list of places to look for a module. The empty string is the place that it will look for frozen modules. So you can put a directory containing your overr...
by dhylands
Tue Jun 11, 2019 5:23 pm
Forum: ESP8266 boards
Topic: LCD 1602 - Library
Replies: 42
Views: 18018

Re: LCD 1602 - Library

Here's an example which scrolls text (using the GPIO version). def test_main(): """Test function for verifying basic functionality.""" print("Running test_main") lcd = GpioLcd(rs_pin=Pin.cpu.C6, enable_pin=Pin.cpu.C8, d4_pin=Pin.cpu.C2, d5_pin=Pin.cpu.C3, d6_pin=Pin.cpu.C4, d7_pin=Pin.cpu.C5, num_li...
by dhylands
Mon Jun 10, 2019 10:24 pm
Forum: MicroPython pyboard
Topic: How can I let my pyboard be registered as a USB Flash Drive while connecting through UART
Replies: 3
Views: 116

Re: How can I let my pyboard be registered as a USB Flash Drive while connecting through UART

Those tools won't let you transfer directly from one pybaord to another. I know with rshell that you can connect to 2 pyboards at the same time and use rshell to copy from pyboard to another. Both pyboards need to be connected to the same host computer. You could write your own code to transfer dire...
by dhylands
Mon Jun 10, 2019 10:23 pm
Forum: MicroPython pyboard
Topic: Import Pyserial Module
Replies: 10
Views: 278

Re: Import Pyserial Module

You need to instantiate an object. Your code should look like:

Code: Select all

usb = pyb.USB_VCP()
usb.write(b'helllo\r\n')
. Note that b'hello\r\n' 'hello\r\n'.encode() or ('hello\r\n').encode() all produce the same thing (namely b'hello\r\n')
by dhylands
Mon Jun 10, 2019 5:58 pm
Forum: ESP8266 boards
Topic: LCD 1602 - Library
Replies: 42
Views: 18018

Re: LCD 1602 - Library

The LCD displays are quite primitive. Here's a couple of references to the commands that can be sent to the LCD: http://web.alfredstate.edu/faculty/weimandn/index.html https://dawes.wordpress.com/2010/01/05/hd44780-instruction-set/ The typical way to achieve scrolling is to write new text which is s...