Running REPL with code running

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
gradoj
Posts: 27
Joined: Mon Aug 11, 2014 5:47 pm

Running REPL with code running

Post by gradoj » Thu Dec 08, 2016 5:13 pm

Looking for a little guidance. I would like to run code as well as have access to the REPL.

As a simplified example I would like to read from an accelerometer periodically and put the data in ram. While this is running and collecting the data I would like to have access to the REPL so I could do a accel.get_data().

@pythoncoder has put together a wonderfully simple scheduler I'm using.
https://github.com/peterhinch/Micropython-scheduler
Ideally, I would like to call pyexec_friendly_repl() as a task in the scheduler and everything would be good. I am sure it is not this easy but seems like it might be possible. Any help appreciated. Thanks.

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: Running REPL with code running

Post by deshipu » Sat Dec 10, 2016 8:09 pm

I suppose you could run your accelerometer-checking code from a timer interrupt.

Post Reply