First time here? Check out the FAQ!
1

Using Wing with circuitpython

I have what I think is an interesting use case. I am playing with some micro computers that run Circuit Python. The device appears as a mounted volume on your desktop and when you save your code to there it runs automatically on the device.

The syntax is Python 3 basically but the standard libraries are slightly limited versions of standard python and also include specialized hardware specific libraries.

Editing the code is “normal” but there are two things I would like to do to integrate Wing into the circuit python environment more closely.

First, is integrating the libraries into Wing’s code completion system. Because these libraries are not part of the systems sys.path I don’t think it’s going to be able to scrape them for class definitions, etc. I haven’t tried but maybe there is a way to include them into the path? I suspect so. But haven’t looked yet.

But the more challenging case is access to the REPL on the device. When the device is connected a serial port is defined that is a direct connection to the console. When your program is running it provides normal console output (print statements, traces, other messages) and when requested it becomes the REPL. Normally on my Mac I use screen to connect to the serial port. It would be great if I could have Wing connect so it would be integrated into the Wing environment.

So, is anyone else using Wing in this sort of situation? If so, what are you doing to make it more integrated? Does this sound like an interesting use case or am I all by myself here ... ?

Bill Waggoner's avatar
145
Bill Waggoner
asked 2020-03-14 08:27:26 -0600
Wingware Support's avatar
4.2k
Wingware Support
updated 2020-03-20 09:27:32 -0600
edit flag offensive 0 remove flag close merge delete

Comments

I have just picked up some CircuitPython compatible boards from Adafruit. (RP2040, Neo Trinkey and others) and am looking at the same kind of things. I'm about to make a custom build step that copies the file into a renamed "code.py" file on the boards drive (to keep a real source file properly named on my host computer.) I'll be interested in the solution to this and the handling of the different libraries in CircuitPython.

RufusVS's avatar RufusVS (2021-04-30 16:28:08 -0600) edit
add a comment see more comments

1 Answer

0

A couple things to try --

  • Copy .py files from the Circuit Python's sys.path to a directory on your machine and add this directory to the Python Path in the Project Properties dialog box. Wing should pick up the modules from this directory.
  • Create an OS command in the OS Commands tool to connect to the serial port. I'm assuming that there's a command line program that connects to it as a shell.
Wingware Support's avatar
4.2k
Wingware Support
answered 2020-03-16 11:12:36 -0600
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer