You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In wiring_analog.c, analogRead() disables the DAC if analogWrite() was previously used to enabled the DAC on the same pin.
In my situation, I am writing a value out the DAC and reading back in on the same pin using the ADC, as part of ADC calibration. Therefore, I don't want the DAC disabled.
A suggested fix is to add another function that is a copy of analogRead() with a new name (e.g. analogReadOptionalDisable()) with an additional argument 'bool disableDAC'. Use the argument to decide whether to disable the DAC or not. Change analogRead() to call this function with the argument 'true'.
The text was updated successfully, but these errors were encountered:
In wiring_analog.c, analogRead() disables the DAC if analogWrite() was previously used to enabled the DAC on the same pin.
In my situation, I am writing a value out the DAC and reading back in on the same pin using the ADC, as part of ADC calibration. Therefore, I don't want the DAC disabled.
A suggested fix is to add another function that is a copy of analogRead() with a new name (e.g. analogReadOptionalDisable()) with an additional argument 'bool disableDAC'. Use the argument to decide whether to disable the DAC or not. Change analogRead() to call this function with the argument 'true'.
The text was updated successfully, but these errors were encountered: