Added a function for writing to the DAC registers