Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python.announce > #1267

ANN Nanpy 0.9

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <stagi.andrea@gmail.com>
X-Original-To python-announce-list@python.org
Delivered-To python-announce-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'python.': 0.02; 'url:pypi': 0.03; 'configure': 0.05; 'repository': 0.05; 'subject:ANN': 0.07; 'suppose': 0.07; 'prototypes': 0.09; 'setup.py': 0.09; 'spreading': 0.09; 'url:github': 0.09; 'contribute': 0.11; 'python': 0.11; 'anyway': 0.14; '###': 0.16; '13th': 0.16; '2],': 0.16; 'clone': 0.16; 'develer': 0.16; 'extensible': 0.16; 'lcd': 0.16; 'patches': 0.16; 'specifying': 0.16; 'to:addr:python-announce-list': 0.16; 'tool.': 0.16; 'world!")': 0.16; 'url:)': 0.16; 'language': 0.16; 'library': 0.18; 'all,': 0.19; 'examples': 0.20; 'import': 0.22; 'email addr:gmail.com&gt;': 0.22; 'print': 0.22; 'install': 0.23; 'creating': 0.23; 'library,': 0.24; 'simpler': 0.24; 'specify': 0.24; 'first,': 0.26; 'second': 0.26; '----------': 0.26; 'donate': 0.26; 'reporting': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'included': 0.31; 'code': 0.31; 'that.': 0.31; 'skip:c 30': 0.32; 'skip:m 30': 0.32; 'run': 0.32; 'another': 0.32; 'url:python': 0.33; 'announce': 0.33; 'screen': 0.34; 'connection': 0.35; 'skip:s 30': 0.35; 'something': 0.35; 'objects': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'doubt': 0.36; 'thanks': 0.36; 'url:org': 0.36; 'example,': 0.37; 'turn': 0.37; 'skip:- 20': 0.37; 'two': 0.37; 'project': 0.37; 'easily': 0.37; 'skip:- 10': 0.38; 'supporting': 0.39; 'to:addr:python.org': 0.39; '8bit%:6': 0.40; 'how': 0.40; 'skip:u 10': 0.60; 'url:it': 0.60; 'skip:a 30': 0.61; 'new': 0.61; 'simply': 0.61; 'simple': 0.61; 'first': 0.61; 'making': 0.63; 'our': 0.64; 'different': 0.65; 'great': 0.65; 'url:blogspot': 0.65; 'url:cgi-bin': 0.65; 'life': 0.66; 'note:': 0.66; 'website:': 0.67; 'positions': 0.67; 'url:0': 0.67; 'contact': 0.67; 'led': 0.72; 'serial': 0.72; 'glad': 0.83; 'andrea': 0.84; 'easier,': 0.84; 'works!': 0.91; 'more!': 0.95
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=4fA7dEGYRU5dIwms/Ed2hqvVWCDYehCOne9fnwS0fhc=; b=SMxreMOpQKS2EepaAT5sdypnNoqO4h51P4mSKdemohBhyeIC/JhkTwJeWVzoLM2TWV zpaxnTOJoKjDxtmgb/AAk8UlilMv/emNjcqAP3ipNkaLkoraOg0LEVmuvk8QlljIhv2/ djmYObLFPNa1WdXGrW7LQTsQ6KIAQ/oYdqfzrl3NqZmPyF7OtHV+JIFsA32xNoiUbDRJ uQru8yUbBggZe4JcseG3V9rpOr9Bg7dxhvIuFLZOTTJyrMqAmz2hidgOlxIGHtA20jqf e64Tu7w6YXbMf0WU46aOQL51WBSPkdzw/Q0MYbzfaH2EiiFIuXDhhy39bpN7lVq2wgDT zoTw==
MIME-Version 1.0
X-Received by 10.224.115.68 with SMTP id h4mr52016406qaq.35.1398190731908; Tue, 22 Apr 2014 11:18:51 -0700 (PDT)
Date Tue, 22 Apr 2014 20:18:51 +0200
Subject ANN Nanpy 0.9
From Andrea Stagi <stagi.andrea@gmail.com>
To python-announce-list@python.org
X-Mailman-Approved-At Wed, 23 Apr 2014 09:52:35 +0200
Content-Type text/plain; charset=UTF-8
X-Content-Filtered-By Mailman/MimeDel 2.1.15
X-BeenThere python-announce-list@python.org
X-Mailman-Version 2.1.15
Precedence list
Reply-To python-list@python.org
List-Id Announcement-only list for the Python programming language <python-announce-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-announce-list>, <mailto:python-announce-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-announce-list/>
List-Post <mailto:python-announce-list@python.org>
List-Help <mailto:python-announce-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-announce-list>, <mailto:python-announce-list-request@python.org?subject=subscribe>
Approved python-announce-list@python.org
Newsgroups comp.lang.python.announce
Message-ID <mailman.9460.1398239557.18130.python-announce-list@python.org> (permalink)
Lines 102
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1398239557 news.xs4all.nl 2854 [2001:888:2000:d::a6]:34748
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python.announce:1267

Show key headers only | View raw


Hi all,

I'm glad to announce you Nanpy 0.9 release!
https://pypi.python.org/pypi/nanpy/0.9

The main purpose of Nanpy is making programmers' life easier, giving them
something to create prototypes faster and use Arduino in a simpler way,
thanks to a simple and powerful language like Python. Also Nanpy can run on
RaspberryPi (tested with Raspbian http://www.raspbian.org/) so you can use
it for communicating with Arduino :)

Let's start with a classic example, turn on a led placed in the 13th pin..

        from nanpy import (ArduinoApi, SerialManager)

        connection = SerialManager()
        a = ArduinoApi(connection=connection)
        a.pinMode(13, a.OUTPUT)
        a.digitalWrite(13, a.HIGH)

NOTE: you can also use the old serial_manager global object

There are a lot of projects able to do that. Nanpy can do more!
Nanpy is easily extensible and can theoretically use every library,
allowing you to create how many objects you want.
We started supporting OneWire, Lcd, Stepper and Servo library and they're
still incomplete.
Let's try to connect our 16x2 lcd screen on pins 7, 8, 9, 10, 11, 12 and
print something!

        connection = SerialManager()
        lcd = Lcd([7, 8, 9, 10, 11, 12], [16, 2], connection=connection)
        lcd.printString("Hello World!")

really straightforward now, isn't it? :)

Multithreading
--------------
What happens if you call methods in an async context? Nothing bad, all
works! every call is mutually exclusive.. For example, suppose that two
threads need to write on the same Lcd and in different positions at the
same time... well, just call printString on the Lcd object specifying the
position (row and column)

        #Thread_1
        ...
        lcd.printString("Hello First Row!", 0, 0)
        ...

        #Thread_2
        ....
        lcd.printString("Hello Second Row!", 0, 1)
        ...

How to build and install
------------------------
You need to build the firmware for your Arduino first, just clone the
firmware repository at https://github.com/nanpy/firmware and follow the
README to configure and build it.

To install Nanpy Python library just type (as root):

        python setup.py install

How to use
----------
### Serial communication

Nanpy autodetects the serial port for you, anyway you can specify another
serial port manually:

        from nanpy import SerialManager
        connection = SerialManager(device='/dev/ttyACM1')

### Import modules

Import all the modules you need :)

        from nanpy import Arduino
        from nanpy import (OneWire, Lcd)
        ...

How to contribute
-----------------
Nanpy needs a lot of work to be a great tool. You can contribute with
patches (bugfixing, writing improvements, creating support for a new
library not included in Nanpy yet, writing examples and so on), writing
documentation, reporting bugs, creating packages or simply spreading Nanpy
through the web if you like it :) If you have any doubt or problem, please
contact me at <stagi.andrea@gmail.com>

Do you want to support us with a coffee? We need it to code all night long!
if you like this project and you want to support it with some cents, please
donate :)
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=TDTPP5JHVJK8J


-- 
Andrea Stagi (@4stagi) - Develer S.r.l
Job profile: http://linkedin.com/in/andreastagi
Website: http://4spills.blogspot.it/
Github: http://github.com/astagi

Back to comp.lang.python.announce | Previous | Next | Find similar | Unroll thread


Thread

ANN Nanpy 0.9 Andrea Stagi <stagi.andrea@gmail.com> - 2014-04-22 20:18 +0200

csiph-web