MicroPython on P2 - Can't get sample program to work
wmosscrop
Posts: 409
https://parallax.com/propeller-2/get-started/micropython/
Using the terminal emulator works, I can turn on the led.
Trying to use the mu application, I can't get anything to run.
Mode is set to ESP MicroPython, as per the sample image.
The sample program won't work on my P2, all I get is (edited for clarity):
#
Native P2 MicroPython
Heap Size: 128 kB
#
Heap ptr = 0x434d9, Stack ptr = 0x7f760
MicroPython v1.13-8-g4b51b34d8-dirty on 2020-10-28; P2 BOARD with Propeller2 P2X8C4M64P
Type "help()" for more information.
...
raw REPL; CTRL-B to exit
OK
exit
�
This project looks like it might be out of date, maybe it's a dead end?
Comments
Thats odd, if it works in the terminal but not Mu. What version of Mu?
I'll have a look at it today Walt
Mu 1.1.1 stable (latest build)
Thanks
I fired up Mu and this is the program from the live stream demo on the LM334/335Z. Mu version is 1.1.0.alpha.2 I would have thought that would be close enough
Even without the temp sensor hardware this should run OK but just show flatline values
Walt what sample code are you trying to run? Is it intended for ESP32? Or some sample code team-oz used?
Tubular, thanks for your help. Tried a few things, found this:
My code works with 1.1.0.alpha.2 (after I changed machine.pin to machine.Pin). But even after this change it doesn't work with 1.1.1.
So there's some change between your version and the latest version that breaks things.
To answer your question, my code is homegrown, based on a Python book I found (from 2009). So it should be generic code, looks like a subset of your code.
import machine
import time
p = machine.Pin(56)
p.off()
while 1 == 1:
p.on()
time.sleep_ms(500)
p.off()
time.sleep_ms(500)
Ok its good we have a working reference point. I'll load the new Mu version and see if it breaks that demo code