bii internals: C vs Python efficiency

In our bii internal series we’ve walked through the process to convert our python code into C code, compile it as a python native extension to distribute it for different platforms. One of the major drawbacks of using native code is that we are not supporting all systems but, on the other side, we gain in efficiency and have more control over the environments where the app runs. We’re doing some benchmark to see how much faster is biicode processing projects: running all in python code or with the native extensions.

Continue reading

bii internals: Automating MacOS pkg generation

In a previous posts we talked about how we cythonized and packaged biicode with pyinstaller. Now we will explain how to generate installers for the different systems, starting with mac. The problem with pkg generation is that most of the existing tutorials and references are xcode oriented, and we just wanted to use plain console.

Continue reading

bii internals: Packaging a compiled app with PyInstaller

In a previous post we talked about how we compiled biicode into c extensions. Today we are going to talk about how we prepare it for execution with PyInstaler. PyInstaller is a program that converts (packages) Python programs into stand-alone executables, under Windows, Linux, Mac OS X, Solaris and AIX. It does so by packaging together your code with all third party libraries your code is using along with python runtime libraries. Third party libraries are discovered inspecting imports in your code but this is a problem when your code is in binary extension.

Continue reading

bii internals: Compiling your python application with Cython

We are starting a series of blog posts about how we package biicode. We are starting from grounds up, we will discuss compilation, packaging and last but not least installers creation.

Cython

Distributing your python app to clients it’s a common task that can become hard when “obfuscated code” come as requirement. Common answers in forums are on the lines of “Python is not the language you’re looking for” or “What are you trying to hide?” which are a way of trying to avoid the problem, not to solve it. This task can be easily achieved with Cython.

Cython can be used to compile your python app with biicode

Cython-logo” by The logo may be obtained from Cython.. Licensed under Fair use via Wikipedia.

Continue reading

Compile for Arduino using any editor

Arduino IDE is a great tool for starters as it sets introduction to programming friction to a minimum. However, as soon as you want to develop more complex projects you discover it’s not enough. Sure you can edit your code with any editor, but you still need to respect Arduino IDE code structure (which is a bit restricting) if you want to be able to compile the code and flash it to your board.

Continue reading

State machine: A more advanced example

For the Arduino Day we posted a state machine library. Today we are going to make a more elaborated example.

in this example we have a button that is used to switch states in the same way than the previous example and a LCD screen. The LCD screen will rotate among various messages when we press the button.

Here is the schematic:

LCD Button State Machine

Continue reading

Arduino day project: Persistent state machine

For the Arduino Day I’ve built a state machine library or deterministic automaton. A state machine serves as a manager that organizes a set of states, or behaviors. It manages the transition between states, and the state itself.

There was already a state machine library in arduino playground but there a couple things I didn’t like about it:

Continue reading