Week 15: Intarface 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.
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.
#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);
}
}
}
#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);
}
}
}
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 | Description | Key Features | Applications |
---|---|---|---|
Arduino IDE | Open-source electronics platform based on easy-to-use hardware and software. |
|
Interactive prototypes |
MIT App Inventor | Web-based IDE for creating Android applications, originally by Google, now maintained by MIT. |
|
Educational projects, prototype projects |
JavaScript with p5.js | Library aimed at making coding accessible for artists, designers, educators, and beginners. |
|
Web applications, interactive art, dashboards visualization |
Node-RED | Flow-based development tool for visual programming, originally developed by IBM. |
|
IoT applications, automation, data integration |
Flutter | Open-source UI software development kit created by Google. |
|
Mobile, web, and desktop applications |
Unity | Cross-platform game engine developed by Unity Technologies. |
|
Games, interactive simulations |
Blynk | Platform for controlling Arduino, Raspberry Pi, and other microcontroller boards over the Internet. |
|
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.