i wish to start my own project completely from scratch and chose a digital protractor
(don't ask why i just thought lets have summit different ;D)
anyway i would like to ask your opinion on how to go about doing the soft ware
i have choose to use a pot as the input - depending on its analogue input i want to arduino to recognise the relevant angle something like this
read pot
if pot value = 1 print.serial 1 degree
if pot value = 5 serial.print 2 degree
and so on and on then for the else i will display error or something
sound ok so far???
now this is where i am getting lost
anothe feature i want to add to it (just for learning purpose really) is being able to edit the angle the arduino displays with 4 buttons (edit, increase, decrease, save)
i really do not have a clue how to go about that and this is where i need help
i just can't get my head around editing them - i can get the buttons in no problem at all and get them to do stuff but to make it edit something and save it i am just lost
Read the pot, map the value to an angle and print the value is a single line of code, but I don't get the "edit the value" bit.
What is it you want to do?
BTW, make sure you don't specify a pot intended for audio applications (log).
for example if i measure a angle i know is 90 degree but the protractor says is 85 degree i want to be able to change the 85 degree that shows up on the protractor to the known 90 degree
I'd suggest you move along first to getting the mechanical pot part working. Find out what the full measurement range is you will be reading. Get the range mapping/units conversion and display working. Then if you find it doesn't hold a good repeatable calibration you can add that function later.
So, the next step would be to add switches and 4 LEDs and resistors. Make an LED come on when a switch is presses, and off when it is pressed again.
When you get that working, and there are plenty of examples on the web, and included in the examples, you will have a pretty good idea how to alter the value, in whichever way you need to. To store the value, look at the EEPROM reference:
It removes the absolute and just measures referencial changes in angle - so you would have to calibrate to zero every time you turn it on, the upside is precision would go way up.
Rather than use a potentially expensive encoder, you can make your own and use a different optical encoder to read a printed larger strip.
Well depending on the actual travel range (% of normal 270 degree travel) of the pot used, and the step rate of the encoder (steps per revolution) used it's kind of a toss up of which would give better resolution without specific data on both the pot and encoder. The pot would be an easier software effort.