Você está na página 1de 5

CuteDigi Playground • View topic - Step by Step on running

CuteDigi Playground • View topic - Step by Step on running CuteDigi Playground A place to

CuteDigi Playground

A place to explore and exchange ideas

http://www.cutedigi.com/forum/viewtopic.php?f=10&t=31&st

Search…

Advanced search

SearchSearch… Advanced search

Board index ‹ Python-on-a-chip Python-on-a-chip

Change font sizeAdvanced search Search Board index ‹ Python-on-a-chip Print view FAQ Register Login Step by Step on

Print viewSearch Board index ‹ Python-on-a-chip Change font size FAQ Register Login Step by Step on running

FAQindex ‹ Python-on-a-chip Change font size Print view Register Login Step by Step on running PyMite

Registerindex ‹ Python-on-a-chip Change font size Print view FAQ Login Step by Step on running PyMite

LoginPython-on-a-chip Change font size Print view FAQ Register Step by Step on running PyMite on Arduino

Step by Step on running PyMite on Arduino Mega

Post a reply

Search this topic…

SearchSearch this topic…

1 post • Page 1 of 1

Step by Step on running PyMite on Arduino Mega

1 of 1 Step by Step on running PyMite on Arduino Mega by jingfeng on Tue

by jingfeng on Tue Aug 18, 2009 10:42 pm

In this tutorial, we are going to show how to run PyMite on Arduino Mega

The Arduino Mega board can be ordered from:

http://www.cutedigi.com/product_info.php?products_id=4232

1. Install tools:

A: Cygwin http://www.cygwin.com/

Remember to select GCC and python packages.

B. Install WinAVR:

http://sourceforge.net/projects/winavr/files/

C. Download PyMite 8

http://www.pythononachip.org

CuteDigi Playground • View topic - Step by Step on running

http://www.cutedigi.com/forum/viewtopic.php?f=10&t=31&st

2. Download our arduino mega port and place under trunk$\src\platform

our arduino mega port and place under trunk$\src\platform arduinomega.rar ArduinoMega port (94 KiB) Downloaded 66

arduinomega.rar ArduinoMega port (94 KiB) Downloaded 66 times

3. Under trunk$, do

make PLATFORM=arduinomega

If it shows pmfeatures.h is missing, please check that you are using the make from WinAVR. Correct the PATH to make sure you are using that make.

The following is the command to check:

$ make --version GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

This program built for i386-pc-mingw32

4. The next step is to program the generated main.hex to the Arduino mega board.

You need STK500, and install AVR studio. Choose Device type ATMEGA1280, and fuse setting is shown as

CuteDigi Playground • View topic - Step by Step on running

http://www.cutedigi.com/forum/viewtopic.php?f=10&t=31&st

5. Find a serial port and see what comes out from the serial

5. Find a serial port and see what comes out from the serial port of Arduino Mega:

CuteDigi Playground • View topic - Step by Step on running

http://www.cutedigi.com/forum/viewtopic.php?f=10&t=31&st

The following is main.py, the Python script that got

The following is main.py, the Python script that got running:

Code: Select all

#

#

PyMite - A flyweight Python interpreter for 8-bit and larger

microcontrollers.

#

Copyright 2002 Dean Hall. All rights reserved.

#

PyMite is offered through one of two licenses: commercial or open-source.

#

See the LICENSE file at the root of this package for licensing details.

#

#

#

This is a sample application that calls functions in the AVR module.

#

""" NATIVE #include <avr/io.h>

CuteDigi Playground • View topic - Step by Step on running

"""

http://www.cutedigi.com/forum/viewtopic.php?f=10&t=31&st

print "Hello world."

#

# Initialize the AVR's port A pin direction

#

def init():

""" NATIVE /* Set port A pins as all outputs */ DDRA = 0xFF; NATIVE_SET_TOS(PM_NONE);

return PM_RET_OK; """ pass

init() import avr

avr.portA(0xaa)

print "Expect a NameError (0xEA) after this." foo()

jingfeng

Pos ts : 21 Joined: Tue Aug 18, 2009 10:25 pm

Top

Post a reply 1 post • Page 1 of 1

Return to Python-on-a-chip

Jump to:

Python-on-a-chip Go
Python-on-a-chip
Go

Who is online

Users browsing this forum: No registered users and 1 guest

Board indexUsers browsing this forum: No registered users and 1 guest The team • Delete all board

The team • Delete all board cookies • All times are UTC - 7 hours [ DST Delete all board cookies • All times are UTC - 7 hours [ DST ]

all board cookies • All times are UTC - 7 hours [ DST ] Powered by

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group