Interface and Application Programming


The aim of this assigment was to write an application that interfaces with an input or output device. I select a potenciometer, the PCB I made for the Input Device Assigment on 1th week.


We had a lot of languages to writhe the application (C, C++, .NET, Java, Arduino, Rubi, Phyton, even Scratch! We also had a lot of options for the interfaces, graphics, etc. Since my programming level is still on basics, I select Processing for the task.


The first step is to download and install Processing.Then, to start connecting the ATtiny processor of your device, open this sketch file.


From this file you can set all the actions that you want to make with your input device to display the results in a graphical interface. I make the test with two differents Processing examples: Beziers and Arm. The first one was not such a good idea, since the movements of the bezier graphic with the potentiometer was not so accurate, but was a useful excersize. With Ferdi, our tutor, we made a lot of changes, to adapt to the potentiometer device.



Then, I use the Arm Processing example to se how it work with my potentiometer input device. And it was really nice, much better than the Bezier graphic.


A as the program is rather long for an image, you can download it from this link.


The next challege was to use the Arm Processing with two potentiometers; so we need to connect another to the PCB. Let's hack it!




Once the second potentiometers is soldered on the PCB, the next step was to reprogram the input device, adding the command lines of the second potentiometers. I programmed with Arduino IDE on the 10th week, and as then, we find a loto of problems with equivalences of ATtiny 45 pins in the Arduino IDE. Finally, we decide to change the connection of the potentiometer to the PB0, to the PB4 pin, that was free. That permit us to use que correct equivalence number of the pin.


This graphic is really useful tool to check the ATtiny procesor pins to program it with Arduino IDE.


To program the potentiometer device, throw our FabISP, yo just need to made some corrections to the Process program to use the Arm routine with the two potentiometers.