Week 13:

 Interface & Application Programming

Task

I have this week worked with interface & application programming and completed the following:

Why Node-RED

I have limited experience in programming and thought that the visual interface of Node-RED and it's multiple add-on Nodes (originally especially the Google Node) made it a tool suitable for me and my final project.

Conclusion

Node-RED proved to be powerfull both for managing logical operations, interfacing with other data sources/receivers, the process of building the web-application was a brezze and most importantly the visual interface allowed me to better grasp te logic behind my codes.

Communicating from Node-RED through Serial to PCB

Installing Node-RED

I found this quick guide and installed Node-RED with the following command:

sudo npm install -g --unsafe-perm node-red

I then updated using the following command:

sudo npm i -g npm

And then installed the Google API by running the following command in the root directory of your Node-RED install:

cd /Users/nicolaisens/node_modules/npm
npm install node-red-node-google
Installing Google API for Node-RED

Running Node-RED

I then ran the following command in terminal and opened 'http://localhost:1880' in my browser:

node-red
Messing around in Node-RED

Messing around in Node-RED

I then started messing around in Node-RED. The various nodes are devided into sections ie. Input, Output, Google, Dashboard etc.

I started with the ambition of reading a free/busy reading of a Google Calender - and came up with a quite elaborate 'logic' for reading a calender and if free having the option to make a booking (See the GIF).

My major issue was to get Node-RED to query the Google Calender. I would have made it work if just I have had more time!

Creating a Flow in Node-RED

Creating a Serial Interface

Creating a Simple Serial Flow

So due to time management I scale down the my ambition, and made this simple flow with two Dashboard buttons sending respectively a "0" or a "1" to a serial output.

The pictures shows:

  • Layout of the flow
  • Setup of the Serial Out
  • Layout of the Dashboard
Creating the Flow
Setting up the Serial Connection
The Application Interface

The Functionality of The Application

I continued to do changes and improvements to both the Node-RED flow and the C-code (I ). Which by the end resulted in the designfiles below.

The Application in Action

Polishing the Code and The Application

I continued through multiple iterations to do changes and improvements to both the Node-RED flow and the C-code, which resulted in the design files below.

The changes included the following:

  • Reducing LED Flickering (the original code were ment to blink)
  • Adding ability to control more than 9 LEDs (by using both alpha & numerics)
  • Developing a an interactive mockup of a booking interface
  • Adding varoius links to promote my company and my paticipation in FabAcademy
Flow with Multiple Switches
The Interactive Mockup of a Booking Interface
The Addition of Promotional Links

Concluding Remarks

The Unafraid Amateur

I started FabAcademy with a basic knowledge of Arduino ie. able to skim through, make iterative changes and do some debugging. I was not feeling uncomfortable when messing with Arduino Code.

I am thrilled that I experienced the exact same feeling by the end of FabAcademy when I was digging into the C-code and modifying it to my needs and starting to understand it's logic and meaning.