Contact Final Project Assignments My Lab About Me

Week 13

Interface and Application Programming

Assignment 13

For this week's assignment I tried to make an Interface on the computer that will allow me send any particular angle to the servo ranging from (0 to 180)

1.Software Used

  • Processing
  • Processing is a flexible software sketchbook and a language for learning how to code within the context of the visual arts. Since 2001, Processing has promoted software literacy within the visual arts and visual literacy within technology. There are tens of thousands of students, artists, designers, researchers, and hobbyists who use Processing for learning and prototyping. To read further about this software you can click Here.

  • The Interface of this software looks much like the Arduino IDE.
  • Processing Interface

  • Inorder to connect the interface created in the Processing software with Arduino code, we first need to include a Library Control P5 in Processing software, which is shown below:

  • Go to Sketch>Import Library>Add Library
  • Step1 towards installing Library

  • Now search and install the Control P5 library
  • Step2 towards installing Library

  • After this I wrote the code which is shown below:
  • Processing Code

    2. Board used

    The circuit board that I used in this assignment is Arduino Leonardo, which I have made as a part of my Final Project. I am using one of the I/O pins of Leonardo to give the controlling signal to the Servo Motor. Further Info about the board can be obtained from my Final Project Page

    Leonardo Board


    3. Arduino Programming

    For Arduino code I wrote a simple program that takes data coming to the serial pins and write that value to the position pin of servo connected to it. The code can be seen in the picture below:
    Arduino Code

    4. Results

    Once the Arduino code was complete, I uploaded the code to the Arduino IDE and closed it. Then I opened the Processing Software and Run the code which resulted in a small window to appear on my PC screen. which is shown below:
    Resulting interface

    Slider position at 20 degrees

    Slider position at 150 degrees

    The complete video showing the results of Interface operating the servo motor can be seen in the video attached below
    Video showing the working

    That's all for week13..
  • All the Files of Week 13 can be downloaded from Here.




  • Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.