Nanpy 0.7 - Use your Arduino board with Python

Andrea Stagi stagi.andrea at gmail.com
Wed Jan 2 16:22:14 CET 2013


Hi,

Happy new year! :)

New year, new release: Nanpy 0.7 is out with some changes:

- Now we use the official version of edam's Arduino makefile
(http://ed.am/dev/make/arduino-mk)
- Added support to the CapacitiveSensor library
(http://playground.arduino.cc//Main/CapacitiveSensor?from=Main.CapSense)
and map function
- Improvements on the communication speed and bugfixing

We also have a repository with some projects made using Nanpy:
https://github.com/nanpy/eggsamples ... if you have a project made
with Nanpy and it's open source please let us know!! :)

Enjoy Nanpy and discover its simplicity expecially using it with a
RaspberryPi.. in the last MagPi issue I explain how to accomplish
that: http://www.themagpi.com/

Remember that Nanpy is now an organization on Github! Join us and/or
donate if you like it!

https://github.com/nanpy

WHAT IS NANPY
--------------------
Nanpy is a pure Python library that allows you communicating with an
Arduino board connected via USB. Classes and methods used are really
similar to the Arduino framework's ones, but simpler and with some
additional features, so people who haven't worked with an Arduino can
be easily introduced to his world.. The main purpose of Nanpy is
making developers' life easier, giving them something simple and fast
to use to create prototypes and scripts interacting with Arduino,
saving time and making them concentrate on the problem.
There are a lot of projects able to do something similar, using Python
or other languages, but  Nanpy can do more! Nanpy is easily extensible
and can theoretically use every library Arduino supports, allowing you
to create how many objects you want and without worrying about
deallocation. Also, you can use Nanpy in parallel and concurrence
programs. Nanpy is under heavy development but is growing fast and
just supports the main methods of OneWire, Lcd, Tone,
DallasTemperature, Stepper and Servo libraries. Just a word of
warning: Raspberry Pi may not provide enough power to drive an
Arduino, so you might need external power.

UNDER THE WOOD
------------------------
With Nanpy you can write your Arduino programs using Python,
communicating via serial port without sending hard-to-remember codesor
limiting you to use only one object: when you create an object in
Python it will be automatically created into your Arduino at runtime..

For example if you write something like

    Arduino.pinMode(13, Arduino.OUTPUT)

    Arduino.digitalWrite(13, Arduino.HIGH)

or

    tone = Tone(13)

or

    lcd = Lcd([7, 8, 9, 10, 11, 12], [16, 2])

    lcd.printString("Hello World!")

or

    ds = DallasTemperature(5)


Nanpy creates the correct object into Arduino for you.. Also, you haven't to
take care of deallocation, Nanpy deallocates objects into Arduino as
soon as the correspondent Python objects get deleted. Look at the
examples to see how simple it is..
(https://github.com/nanpy/nanpy/tree/master/examples) :)

I tried running Nanpy on a Raspberry board and it works great!!(that's
the result from one of my friends' Twitter account
https://twitter.com/andreagrandi/status/251702684380434434 :) ). Also
you can use it in other devices suppoting Python and serial
communication, with Django, for creating prototypes
faster etc.. because you use Python and you don't have to flash the
firmware every time. Last but not least, firmware part of Nanpy is
Python-indipendent, so you can write another implementation of Nanpy
in any other language, for example Java, and see an Arduino controlled
via Android (ok, in this case we should use Android USB Host API,
writing our own driver, because Android doesn't provide anything to
access device files). We will work on this in the future :)

DONATE
-----------
Do you like Nanpy? Contributions/suggestions/bug reporting/spreading
the project/beers/coffee are accepted :) if you want to donate a coffee
and be sure that we will work during the night, here's the link

https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=TDTPP5JHVJK8J

Thanks for your attention!

Best regards,

=.4.S.=

-- 
Andrea Stagi (@4ndreaSt4gi) -  Software Engineer
Job profile: http://linkedin.com/in/andreastagi
Website: http://4spills.blogspot.it/
Github: http://github.com/astagi


More information about the Python-announce-list mailing list