Go Down

Topic: Python 3 (MicroPython) on Arduino Due! (Read 414 times) previous topic - next topic

eerimoq

Sep 17, 2016, 10:29 am Last Edit: Sep 17, 2016, 10:35 am by eerimoq
Hi everybody,

MicroPython has been ported to Arduino Due and works very well to toggle pins and using the serial port!

Install it in the Arduino IDE as described on the page below. There is one cavet, you must disable upload verification in the IDE because it times out after 2 minutes and the upload fails.

http://pumbaa.readthedocs.io/en/latest/installation.html#arduino-arduino-ide

Once installed and the interactive sketch has been uploaded you can use the serial monitor to write Python 3 code on the Due!

The documentation for the port is here: http://pumbaa.readthedocs.io/en/latest/index.html

Github project: https://github.com/eerimoq/pumbaa

Enjoy! =)

eerimoq

#1
Sep 24, 2016, 11:49 pm Last Edit: Sep 25, 2016, 10:11 am by eerimoq
Hi,

the .ino-file in Pumbaa is a Python script instead of a C++ file as it normally is. Just edit it and voila, you have your Python sketch running on the Arduino Due!

The Hello world and Blink looks like this:

Hello world

Arduino IDE: File -> Exmaples -> Pumbaa -> hello_world

hello_world.ino:

Code: [Select]
print('Hello world!')

Blink

Arduino IDE: File -> Exmaples -> Pumbaa -> blink

blink.ino:

Code: [Select]
import time
from simba import Board, Pin

LED = Pin(Board.PIN_LED, Pin.OUTPUT)

while True:
    LED.toggle()
    time.sleep(0.5)


NOTE: The Pumbaa Arduino IDE build system requires Python to be installed on your computer, and "python" must be found in PATH.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy