UCI-UAVForge / Avionics-16-17

1 stars 13 forks source link

Digital Potentiometer Code #33

Closed alihashemi2002 closed 8 years ago

alihashemi2002 commented 9 years ago

Write code that does the following in function form:

  1. Takes two inputs: resistance value (100-100k ohms) and pot number (1-4)
  2. Calculates the required digital value to send to the pot (using equation in datasheet)
  3. Writes the calculated value to the specified pot number

Notes: Pot number is either pot 1,2,3,4. These will be the same as the 4 'RDAC' values in the datasheet resembled by 3 bits. Use the equation for Rwa, set that equal to the resistance value that a user inputs to the function, solve for Dw and send that value to the corresponding pot register. For our part, RAB=100kOhms.

Deliverable for this item: Code that implements the above function in the arduino environment

Estimated time for this item: 2 Hours

AD5204_5206.pdf

SpacePirate commented 9 years ago

Hey @alihashemi2002,

I am using the equation in the datasheet: Rwa = (256-Dx)/256 * Rab + Rw

Here, what is Rw?

jason-watkins commented 8 years ago

This issue should be reevaluated and assigned a new milestone or closed as appropriate.

alihashemi2002 commented 8 years ago

Closing this task since the scope of the project has changed. We are going to focus further on the autopilot rather than a digitally controlled power supply.