Skip to content

15. Interface and application programming

Working in group

  • Compare as many tool options as possible.
  • The tools that have been investigated and can be applied in this work block are: P5.js and Teachable Machine.

    P5.js

    - p5.js is a JavaScript library for creative programming.
    - It's a reinterpretation of Processing, but now as a web language, unlike Processing, which runs on your computer.
    - It is a free and open source tool; accessible to all.
    - It presents a fairly friendly interface, which even allows us to edit the examples that it makes available to us.

    The following is an example that can be applied to an interface.

    These are downloadable that can easily be worked on in Processing

    Teachable Machine

    It is a web-based AI tool developed by Google that makes building machine learning models fast, easy, and accessible to everyone.

    Basically it allows you to create video and audio type applications.

    An application can be created that, based on image recognition, has a specific behavior. It could be similar to the behavior of a sensor for example.

    Individual assignment

  • Write an application that interfaces a user with an input and/or output device that you made
  • App

    An application will be developed that allows controlling the activation and deactivation of the led on the pcb, via bluetooth, through a cell phone.
    The physical implementation will be similar to the one in the following image:

    The interface layout in MIT App Inventor will be similar to the following:

    The instructions of what the program will do will be:

    /*Application: Interface
    Author: Guadalupe Nieves Choque Choque*/
    #include <SoftwareSerial.h>
    #define pin_tx      7
    #define pin_rx      8
    SoftwareSerial SerialPort(pin_rx, pin_tx); 
    
    #define pinLed      2
    void setup() {
      SerialPort.begin(9600);
      pinMode(pinLed, OUTPUT);
      digitalWrite(pinLed, LOW);
    }
    
    void loop() {
      if (SerialPort.available()){
        switch(SerialPort.read()){
          case '1':
            digitalWrite(pinLed, HIGH);
          break;
          case '0':
            digitalWrite(pinLed, LOW);
          break;
        }
      }
    }
    

    On the Arduino:

    Running the application physically

    In the video:

    Natives files

    Ord Description Files
    1 App Inferface Interface.ino