Week 11

Interface + Application Programming

I feel like I conquered this week-- after 2 weeks of /not quite getting it/, I think this week I was able to successfully fix everything that was broken from the last two weeks and also get something done for this week. Think of this week as my OUTPUT + INPUT + INTERFACE project!

For this week specifically, I wanted to make a semi-circle that would be able to take the inputs from the light sensors, transform that into degrees ( 0 to 180 ), and move an indicator to that value.

















Using last week's board, I tried to fix things up a bit. I looked into the code after last week's lecture, and I think I really began to understand the whole thing.

With help from Tomer, we were able to get a read from the photoransistor, but we weren't able to get the servo to move just yet. I looked deeper into that later.




Here is my code-- it was a bit of a Frankenstein's code, but it worked really well for me! Some notes:

- Servo library from Arduino does not work with attiny44; instead you need one that is 8-bit.
- Be aware of which pins are RX/TX! This messed us up for a long time.
- The values were a bit weird, so we kind of got a round-about, tricky way to get values that made any sense.

This is a lot of stiched-together code from templates. I used Neil's codes to set up the servo and the phototransistor. I then again used the Knob example Arduino code to change the input from potentiometer to phototransistor. I also figured out that the value for OCR1A was what controlled the servo. It all began to make sense!



It's alliiiiiivvveeee!!!!! I was able to get my input and output device working this week!



Processing is super interesting, and I'm very interested in working with this more. I read lots of tutorials and I think with the following links, anyone should be able to get Processing to do something.

http://www.instructables.com/id/Arduino-to-Processing-Serial-Communication-withou/?ALLSTEPS
http://academy.kaziunas.com/tutorials/interface_application_programming_processing.php
https://learn.sparkfun.com/tutorials/connecting-arduino-to-processing

Although I didn't get the right values to read, at least it was reading! Check out the video:



This was the result. I got the geometries and the math there, but I just need to get the right values to read into Processing. Currently troubleshooting this.