Translate

Scratch 2.0 Extension For The micro:bit Just Published


I just published a new Scratch 2.0 extension for the micro:bit computer. It's called s2m and can be found on Github. A User's Guide is also available.

Electronic Playground With Arduino and Scratch 2




Marcelo Ravai just published a wonderful Instructables and a hackster.io article on creating physical computing projects using s2aio and Scratch. He demonstrates how to control LEDs, switches, a passive infrared (PIR) sensor, servos, buzzers, ultrasonic distance sensors, temperature sensors, servo motors, temperature sensors and light sensors.

The article provides links to the Scratch code for all of the projects. In addition, Marcello provides detailed wiring instructions, making it easy to quickly get up and running.

Check it out for some great summer fun!

C4 Labs Review

Zebra Black Ice Case For The Raspberry Pi

My latest open source efforts have been almost exclusively devoted to the Raspberry Pi. Over the years I have developed a strong affinity for this little powerhouse of a computer, but was never particularly pleased with the choices for housing the unit. 

I have gone from no housing at all, just letting it sit on my lab bench, to trying several of the inexpensive ABS cases available on the market.  I was never pleased with any of these choices. The "naked bench top" approach always left the computer exposed to mayhem, and the ABS cases never fit quite correctly, making installing and removing the SD cards difficult, not to mention removing the board from the cases, an exercise in frustration.

So I went on a quest for a quality case and found the C4 Labs family of products. I purchased a Zebra Black Ice case and was immediately impressed with both the physical design and the design aesthetics. You do have to assemble the case, which takes about 10 minutes, but it is well worth the effort. The case not only provides substantial protection for the RPi, but is truly a thing of beauty. Its rounded corners, and color accent make me smile each time I see or pick up the case. That is not something I had ever gotten from working with the RPi before.

The case comes with a set of heat sinks, as well as a set of soft feet. It allows access to GPIO pins, the DSI display connector and CSI camera connector. It provides for air flow on both the top and bottom, and has holes for screw mounting the case if desired.

If that wasn't enough, C4 Labs provides wonderful, personal,  customer service. I had some questions and not only were they answered and resolved quickly, but C4 Labs went over and beyond to make sure that I was satisfied. This is a rare thing these days.

I highly recommend this case for its protection, design integrity, quality construction, and aesthetics. If you too want to smile when you use your RPi, check out C4 Labs cases.

NOTE: I am not an employee of C4 Labs, nor have they solicited for this review, I am just one happy customer.


The Documentation For s2-pi has been updated and can be found here:


To install the demo code either type:

sudo pip3 install s2-pi


Or

The SmartiPi Touch

A Versatile, Five Star Solution For Mounting The Raspberry Pi Touch Display

Recently I purchased a Raspberry Pi touch display and quickly came to the realization that I needed a way to easily position and protect the display on my desk. Before checking out the various cases, I came up with the following list of must haves: 
  • Good design using highest quality components
  • Simple to assemble.
  • Be able to house my Raspberry Pi.
  • Does not require image positioning adjustment to fit the needs of the case.
After checking out all the cases available I found only one that checked all of the boxes, and that was the SmartiPi Touch case. It was breeze to assemble, holds my Raspberry Pi, is constructed of high quality materials and orients the screen in its natural position without having to diddle with rotating the image 180 degrees (some cases require you to do that!).

In addition, the SmartiPi case includes a Raspberry Pi camera case that mounts onto the main case using a Lego compatible bracket. Last week, I wanted to mount the camera on the case, only to realize that I did not have the appropriate bracket. I contacted SmartiPi to see what type of Lego bracket I needed to get.  They informed me that I should have received one in the kit of parts. and promptly sent one to me, free of charge.

With the quality of product and quality of customer service, SmartiPi is truly five star.

Python Banyan Has Been Released!


I am pleased to announce the initial release of the Python Banyan Framework. The Python Banyan User's Guide  explains how to create and run a Python Banyan application. Many of the examples operate in a standalone fashion, without the need of a Raspberry Pi or Arduino, but there are also examples demonstrating GPIO control, such as the  Raspberry Pi driven BCD Clock display, pictured above.

The framework is currently Python 3 compatible only, and will run on Windows, Linux and the Mac.

So What Is Python Banyan?

Python Banyan is a lightweight, reactive framework used to create flexible, non-blocking, event driven, asynchronous applications. It was designed primarily to implement physical computing applications for devices such as the Raspberry Pi and Arduino, but it is not limited to just that domain, and may be used to create application in any domain.
Most traditional physical computing libraries or frameworks use an object oriented model that results in a single, tightly coupled, monolithic executable image. Python Banyan uses an extension of the object oriented model, called the component based model. A component based application is comprised of a set of independent, loosely coupled modules. Functionality is easily added to a Python Banyan application, and in fact it may be added to a fully running system without the need to recompile or reboot.
Because each module is a self contained entity, applications can be created with a set of modules that use different versions of Python, and in fact, you can even add modules written in other computer languages.
In addition, the modules may be run on a single computer, or may be distributed across multiple computers running different operating systems, without having to change a single line of code.
Where Can You Find Python Banyan?

Python Banyan is located in its own Github repository and may be found here.

20 January 2017

What Have I Been Doing Lately?

My last posting was in October of 2016, and since then I have been working on moving the code and lessons I learned from the razmq project to a new project called Python Banyan. The code has been complete for some time now, but I have been struggling to get it documented. I am pleased to say that the documentation is well under way and hopefully will be complete in about 2 weeks time (hopefully shorter). You can view a draft of  the User's Guide here, but be mindful it is subject to change. 

WHAT IS PYTHON BANYAN?

Python Banyan is a lightweight, reactive framework used to create flexible, non-blocking, event driven, asynchronous applications. It was designed primarily to implement physical computing applications for devices such as the Raspberry Pi and Arduino, but it is not limited to just that domain, and may be used to create application in any domain.
Most traditional physical computing libraries or frameworks use an object oriented model that results in a single, tightly coupled, monolithic executable image. Python Banyan uses an extension of the object oriented model, called the component based model. A component based application is comprised of a set of independent, loosely coupled modules. Functionality is easily added to a Python Banyan application, and in fact it may be added to a fully running system without the need to recompile or reboot.
Because each module is a self contained entity, applications can be created with a set of modules that use different versions of Python, and in fact, you can even add modules written in other computer languages.
In addition, the modules may be run on a single computer, or may be distributed across multiple  computers running different operating systems, without having to change a single line of code.

A Little More Detail

The Python Banyan Framework consists of a single, simple base class. All Banyan compatible components inherit from this class. When a Banyan component is first invoked, it automatically connects to a common shared software backplane. All of the complexity of managing connections is hidden within and handled by the base class. All Banyan modules exchange information with each another by sending or publishing user defined protocol messages via the backplane. All routing and message buffering is automatically handled by the Framework. Each Banyan component can "publish" messages, "subscribe" to receive specific messages or both publish and subscribe messages. A Banyan component is not limited as to how many types of messages it may subscribe to.
Because Banyan messages are not computer language specific, components written in other computer Languages, such as JavaScript, can be used within a Python Banyan application. A simple JavaScript demo is provided in the examples section below.
Python Banyan takes full advantage of the ZeroMQ networking library that not only provides connectivity, but in addition acts as a concurrency framework. All of this is handled transparently by the Python Banyan base class. If your application requires additional concurrency support, you are free to choose whatever works best for your application, such as a multi-threading or a Python asyncio approach. User defined messages are prepared for transport across the network by wrapping them in theMessage Pack format.
The complexities of MessagePack are handled transparently by the base class, both for transmitting and receiving messages.

A User's Guide Is Provided. Here is what the guide covers:

Chapter 1 is an introduction to developing with Python Banyan. An application tailored specifically for this purpose will be presented in detail.
In chapter 2, a demonstration of, and a discussion about creating physical computing components with Python Banyan.
To demonstrate Python Banyan's flexibility, applications will be built from Python 2 components, Python 3 components and even a JavaScript component, all cooperating and communicating with each other within a single Python Banyan application.
Python Banyan applications may be distributed across multiple computers, all without changing a single line of code. Using the components created in this guide, all of the components will first be launched to run on a Raspberry Pi, and then then the components will be re-distributed across a Linux Unbuntu PC, a Windows PC and the Raspberry Pi without having to change a single line of code.
In Chapter 3, we will add components to control an 8x8 bicolor LED matrix connected to a Raspberry Pi. A demonstration of using Python Banyan to control an i2c device will be presented.
If you need to control multiple i2c devices sharing the same i2c pins, Python Banyan provides the concurrency support for you to do so.
Chapter 4 will discuss how to use Python's setup tools to convert a Banyan component into an executable file and have it automatically installed on the execution path.