Interface and application programming

Week 12- Documentation

Assignments:

Processing:

I started out by choosing an interesting software to program in, I choose Processing because Neil and Frosti spoke so well about that software and said it was a great place to start there for beginners. I started out by going through tutorials(linked below) on youtube where I learned the basics of Processing. After I had done those tutorials it was time to start connecting Processing with Arduino serial.

  1. I started out by opening up a new sketch in Processing and Arduino.

  2. In Processing I started out by going to Sketch and there I went into Import libarary... and selected Serial.Selecting serial

  3. After selecting the serial it was time to start coding both in Arduino and Processing.

  4. Here is a link to my embedded programming assignment where I go over the basics of Arduino.

  5. Here is the code that I used in Arduino: Arduino file
    The Arduino code

  6. Here is the code that I used in Processing: Processing fileThe Processing code

  7. When you have finsihed coding and verified the Arduino code it's time to program the board. Connect a FTDI cable from the computer to the FTDI and connect your programmer to your computer and the board(I am using the FabISP44). Make sure that all the cables are connected correctly. To connect the variable resistor correctly you put GND into the GND and the VCC into the VCC but you put the data pin into the ECHO.Hero shot

  8. After you have connected all the cables correctly you click "upload" in Arduino and then you have programmed your board.

  9. After that you can move to Processing and there you can press the play button and then your program pops up and you can start to play with your program.

  10. The program that I wrote lets you change color of the background and the circle by turning the variable resistor. When you move your mouse around you are able to change the size of the circle.

Problems:

I had a lot of problems during this weeks assignment. The main problem this week was getting the serial from a board to serial with the RX and TX. I started out by using the HELLO HC: SR04.45 board but after many hours of trying to get the right information from the board we realized that the board was missing a connection to the TX in the FTDI connection so then I changed the plan and used a variable resistor to get the information and it worked well.
Another minor problem that I had was with defining the serial but that was fixed by placeing < SoftwareSerial.h > on top of the screeen. We also had a probmem with the baud settings and I had seen in other tutotrials that people where using a lot of different baud rates. In the code we used 9600 bauds and in the serial monitor we had to use 1200 bauds to get the right information on the screen.

Tutorials I used:

Files:

Software I used:

Copyright © Gísli Snær Guðmundsson 2020