Interface and Application Programming

Back to Mónica Pedro ←main page ←Assigments

Assigment:

 
        individual assignment:
    write an application that interfaces a user  with an
         input &/or output device that you made
    
        group assignment:
      compare as many tool options as possible
    

for my Project I want to:

use the Raspberry Pi NoIR camera and take photos of the Biology going on the fungarium, meaning that I should be able to access both pictures (full image and IR image) and compute them in order to know about the biology happening on the Fungos plate

Interface with a User

I would like to have a Webinterface for my project.... but since I'm not ready to use my own boards, I'll do this assigment based on Machine being built by our Local group...

Reference studied...

In terms of User interface I'll reverse engineering the code made for FabScanPi, where they have:

  1. all components are running on latesd Debian based Raspberry Pi operating system called Raspbian wich has a good documentation online - Raspbian Documentation
  2. It had been created a Raspbian Image that has all the software components and configurations pre-installed. I'll install this image in a secondary SD Card just to try it out and see if I understand the image
  3. Frontend: The idea behing was to make it Browser-Enabled. So it can be run on all operating systems wich are able to run modern Web-Browsers. JavaScript and WebGl are used to illustrate the 3D rendered scenes and models in realtime.
  4. Backend: is running on the FabScanPi based Raspbian operating sytem behind the FabScanPi Web-Enabled frontend. The backend is the heart of the software it is doing all the calculations during a scan process.
  5. Firmware: defines the smallest siftware component of the project. It is needed to control the hardware components like lasers, motors and led lights. It is a Arduino based. The firmware is automatically flashed to the FabScanPi HAT if a new version is availabe.

Raspbian

Raspbian Images - I fallowed the Raspberry Pi documentation... on Writing an image to the SD card

So need to instal ETCHER which I made from BalenaEtcher

With Etcher the process to creat Raspbian images is as follows:

I downloaded the FabScanPi image ZIP from the FAbScanPi GutHub page mariolukas/FabScanPi-Build-Raspbian which as 581MB


to document on Raspbian

in order to document whats going I'd installed the SCROT

MMAL - Multi-Media Abstraction Layer

MMAL API is a framework wich is used to provide a host-side, simple and relative low-level interface to multimedia components running on VideoCore. It also provides a component interface so that new components can be easily created and integrated into the framework.

OpenMAX

Open Media Acceleration, often shortened as "OMX", is a non-proprietary and royality-free cross-platform set of C-language programming interfaces. It provides abstractios for routines that are especially useful for processing of audio, video, and still images. more about OpenMAX

Node.js

What exactly is Node.js?

Node.js is a JavaScript runtime environment.But how it works?

The Node run-time environment includes everything we need to execute a program written in JavaScript.

Node.js came into existence when the original developers of JavaScript extended it from something we could only run in browser to something we could run on our machine as a standalone application.

with it we can do more with JavaScript than interactive websites.

Both the browser JavaScript and Node.js run the V8 JavaScript runtime engine. The engine takes the JavaScript code and converts it to a faster machine code.

Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient.

I/O refers to input/output. It can be anything ranging from reading/writing local files to making an HTTP request to an API.

I/O takes time and hence blocks other functions.

in Non-blocking requestes, we can initiate a data request without waiting for the response of the previous. We can initiate both requests in parallel.

This non-blocking I/O eliminates the need for multi-threading since the server can handle multiple requests at the same time.

Python

Studdyng Python from Python tutorial

Coding Style:


Modules

Script: is a file writen in a text editor with the comands intended for the interpreter

module definitions in a file that could be used in scripts or in an interactive instance of the interpreter. definitions from a module can be imported into other modules or into the main module.

A module is a file containing Python definitions and statements. The file name is the module name with the suffix .py appended. Within a module, the module’s name (as a string) is available as the value of the global variable __name__.

Python on my MAC

I assisted the two videos from Fab Academy Tutorials - that I really recomend:

both provided me good overview of Python and its universe, in terms of users and sources of inspiration...adn sources os learning.. scuh as

, that you can find here - How to Think Like a Computer Scientist

here are some references important for starting with this programming language and universe:


and I started programing in IDLE...


Then I need to have a way to create USER Interfaces, and there was two main options:

went for advice on internet and choosed the TkInter after reading this nice reflection of a profssional... Python GUI Programming: WxPython Vs. Tkinter


TkInter

TkInter - the "de-facto" standard Python GUI

reading about it on doc.Python.org

Graphic User Interfaces with Tk

Tk/Tcl has long been a integral part of Python. It provides a robust platform independent windowing toolkit, that is available to Python programmers using tkinter package, and is extension, the tkinter.tix and thetkinter.ttk modules.

So playing with TkInter on the Raspberry...

My first TkInter User Interface...a simple window with two buttons.. one to close and another to Say "Hello World!"

Here is the Code - Download

Flask... Web development, on a drop at a time

Fask website

Flask is a microframework for Python based on Werkzeug, Jinja 2 and good intentions....


Kivy ... Pyhton Mobile applicaions...

Kivy - python library for mobile applicaions...

Kivy has more libraries that could be used for instance to access Mobile sensors and actuators...

they have lot's of examples...

.....

PACKAGING.... py2app on a MAC

Taking pictures in Raspberry Pi Camera NoIR

My first prrogram to take fotos with and without IR

in order to document I'd to instal SCROP