Home


Fab academy

Week 15: Intarface and Applications Programming



Week 15: Interface and Applications Programming

This week's assignment requires me to develop an application that interfaces with input and/or output devices on a custom-made board. For this task, I am utilizing the Coquiduino Serial board from Week 14, which enables the connection of two ATtiny microcontrollers via serial communication in parallel. The HC-05 Bluetooth module will serve as the master, sending instructions to the Coquiduino Serial slaves.

MIT App Inventor:

To create the application, I used MIT App Inventor to design a straightforward interface. This interface includes controls for managing LEDs on Node A and Node B, with on/off buttons for each node. The objective of this project is to establish efficient communication and control between the mobile application and the hardware components, demonstrating the integration of wireless technology with embedded systems.

UI Programming:

APPINVENTOR

Block Programming:

APPINVENTOR

APK Screenshot:

SS



Programming: Arduino IDE

Node A:


    #include <SoftwareSerial.h>
   // *** Define the RX and TX pins
               
   #define TX   9  //
   #define RX   10  // 
   #define LED1 1
   #define LED2 2
   #define LED3 3       
  
  SoftwareSerial mySerial(RX, TX);
                
   char chr;
                 
  void setup() {
  // initialize serial communications at 9600 bps:
                  
  mySerial.begin(9600);
  pinMode(TX,INPUT);
  pinMode(LED1, OUTPUT);
  pinMode(LED2, OUTPUT);
  pinMode(LED3, OUTPUT);
  }
                  
   void loop() {
  if (mySerial.available() > 0) {
   char chr = mySerial.read();
  
                  
   if (chr == '1') {   
   digitalWrite(LED1, HIGH);
   delay(500);
   digitalWrite(LED2, HIGH);
   delay(500);
   digitalWrite(LED3, HIGH);
   delay(500);
 

    pinMode(TX,OUTPUT);
    mySerial.println("Node A: LED ON");
    delay(1000);
   pinMode(TX,INPUT);
  }
  
  else if (chr == '2') {
  digitalWrite(LED1, LOW);
   delay(500);
   digitalWrite(LED2, LOW);
   delay(500);
   digitalWrite(LED3, LOW);
   delay(500);
 

    pinMode(TX,OUTPUT);
    mySerial.println("Node A: LED OFF");
    delay(1000);
   pinMode(TX,INPUT);
  }
  }
  }
        



Node B:


    #include <SoftwareSerial.h>
   // *** Define the RX and TX pins
               
   #define TX   9  //
   #define RX   10  // 
   #define LED1 1
   #define LED2 2
   #define LED3 3       
  
  SoftwareSerial mySerial(RX, TX);
                
   char chr;
                 
  void setup() {
  // initialize serial communications at 9600 bps:
                  
  mySerial.begin(9600);
  pinMode(TX,INPUT);
  pinMode(LED1, OUTPUT);
  pinMode(LED2, OUTPUT);
  pinMode(LED3, OUTPUT);
  }
                  
   void loop() {
  if (mySerial.available() > 0) {
   char chr = mySerial.read();
  
                  
   if (chr == '3') {   
   digitalWrite(LED1, HIGH);
   delay(500);
   digitalWrite(LED2, HIGH);
   delay(500);
   digitalWrite(LED3, HIGH);
   delay(500);
 

    pinMode(TX,OUTPUT);
    mySerial.println("Node B: LED ON");
    delay(1000);
   pinMode(TX,INPUT);
  }
  
  else if (chr == '4') {
  digitalWrite(LED1, LOW);
   delay(500);
   digitalWrite(LED2, LOW);
   delay(500);
   digitalWrite(LED3, LOW);
   delay(500);
 

    pinMode(TX,OUTPUT);
    mySerial.println("Node B: LED OFF");
    delay(1000);
   pinMode(TX,INPUT);
  }
  }
  }
        



Uploading Code Using Programmer:

LoadingCode



Final Result:


Group Assigment Page!!


Group Assigment Personal Aport:

This week's group assignment provided valuable insights into various development tools and their applications. We compared several platforms including Arduino IDE, MIT App Inventor, p5.js, Node-RED, Flutter, Unity, and Blynk. Each tool offers unique features and benefits, making them suitable for different types of projects:

Tool Comparison Chart

Tool Description Key Features Applications
Arduino IDE Open-source electronics platform based on easy-to-use hardware and software.
  • Simple and intuitive IDE
  • Extensive library support
  • Cross-platform (Windows, macOS, Linux)
  • Easy to get started with lots of tutorials
  • Low-cost hardware
Interactive prototypes
MIT App Inventor Web-based IDE for creating Android applications, originally by Google, now maintained by MIT.
  • Easy interface
  • Ideal for beginners and non-programmers
  • Mobile applications
  • Educational projects
  • No installation required
Educational projects, prototype projects
JavaScript with p5.js Library aimed at making coding accessible for artists, designers, educators, and beginners.
  • Web-based, runs in any modern browser
  • Great for creating interactive graphics and animations
  • Web-native, no need for installation
  • Extensive documentation and examples
Web applications, interactive art, dashboards visualization
Node-RED Flow-based development tool for visual programming, originally developed by IBM.
  • Browser-based flow editor
  • Wide range of nodes available for different tasks
  • Easy to use visual interface
IoT applications, automation, data integration
Flutter Open-source UI software development kit created by Google.
  • Single codebase for multiple platforms
  • Rich set of pre-designed widgets
  • Hot reload for rapid development
Mobile, web, and desktop applications
Unity Cross-platform game engine developed by Unity Technologies.
  • Powerful 3D engine
  • Extensive asset store
  • Scripting with C#
Games, interactive simulations
Blynk Platform for controlling Arduino, Raspberry Pi, and other microcontroller boards over the Internet.
  • Drag-and-drop interface
  • Wide hardware support
  • Widgets for control and monitoring
  • Easy to use, connects to Blynk cloud
IoT projects


Knowing the tools available and understanding how they work helps us make informed decisions depending on the kind of application required. This approach allows us to search for an efficient workflow and reduce time consumption. This assignment underscored the importance of understanding the strengths and applications of different development tools. By leveraging the right tool for each project, we can enhance efficiency, creativity, and functionality in our Fab Academy projects, ultimately pushing the boundaries of digital fabrication and embedded system design.


You can download the files HERE!