We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2018-01-18
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Digital potentiometer
Downloaded: 5687 times
Not followed.
License: MIT license
DIGI POT 5 click is a digitally controlled quad potentiometer, with the resistance of 10KΩ. It has an 8bit wiper step resolution, which allows the wiper to take 257 different discrete positions (across 256 internal resistors).
Do you want to subscribe in order to receive notifications regarding "DIGI POT 5 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "DIGI POT 5 click" changes.
Do you want to report abuse regarding "DIGI POT 5 click".
Library description
The library contains functions that perform basic SPI commands on click board registers.
Key functions:
uint8_t digipot5_writeReg(uint8_t regAddress, uint16_t writeData);- Function writes to the click board registers
uint8_t digipot5_readReg(uint8_t regAddress, uint16_t * pReadData);- Reads from the click board registers
uint8_t digipot5_setResistance(uint8_t regAddress, uint16_t value);- Sets the resistance of the selected wiper
Example description
mikrobus_logWrite("Setting wiper 0 to zero scale value.", _LOG_LINE); digipot5_setResistance(_DIGIPOT5_WIPER0_VOLATILE, _DIGIPOT5_ZEROSCALE); mikrobus_logWrite("Setting wiper 1 to 3k Ohm.", _LOG_LINE); digipot5_setResistance(_DIGIPOT5_WIPER1_VOLATILE, _DIGIPOT5_3KOHM); mikrobus_logWrite("Setting wiper 2 to 5k Ohm.", _LOG_LINE); digipot5_setResistance(_DIGIPOT5_WIPER2_VOLATILE, _DIGIPOT5_HALFSCALE_5K); mikrobus_logWrite("Setting wiper 3 to full scale (10k Ohm).", _LOG_LINE); digipot5_setResistance(_DIGIPOT5_WIPER3_VOLATILE, _DIGIPOT5_FULLSCALE_10K); delay_ms(2000); mikrobus_logWrite("Decrementing wiper 3 by 5 steps.", _LOG_LINE); digipot5_decrementReg(_DIGIPOT5_WIPER3_VOLATILE); digipot5_decrementReg(_DIGIPOT5_WIPER3_VOLATILE); digipot5_decrementReg(_DIGIPOT5_WIPER3_VOLATILE); digipot5_decrementReg(_DIGIPOT5_WIPER3_VOLATILE); digipot5_decrementReg(_DIGIPOT5_WIPER3_VOLATILE); delay_ms(2000); mikrobus_logWrite("Decrementing wiper 3 by another 5 steps.", _LOG_LINE); digipot5_decrementReg(_DIGIPOT5_WIPER3_VOLATILE); digipot5_decrementReg(_DIGIPOT5_WIPER3_VOLATILE); digipot5_decrementReg(_DIGIPOT5_WIPER3_VOLATILE); digipot5_decrementReg(_DIGIPOT5_WIPER3_VOLATILE); digipot5_decrementReg(_DIGIPOT5_WIPER3_VOLATILE); delay_ms(2000); mikrobus_logWrite("Setting wiper 0 to full scale value.", _LOG_LINE); digipot5_setResistance(_DIGIPOT5_WIPER0_VOLATILE, _DIGIPOT5_FULLSCALE_10K); mikrobus_logWrite("Setting wiper 1 to 8k Ohm.", _LOG_LINE); digipot5_setResistance(_DIGIPOT5_WIPER1_VOLATILE, _DIGIPOT5_8KOHM); mikrobus_logWrite("Setting wiper 2 to 4k Ohm.", _LOG_LINE); digipot5_setResistance(_DIGIPOT5_WIPER2_VOLATILE, 0x68); mikrobus_logWrite("Setting wiper 3 to zero scale value.", _LOG_LINE); digipot5_setResistance(_DIGIPOT5_WIPER3_VOLATILE, _DIGIPOT5_ZEROSCALE);
Additional notes and information
Depending on the development board you are using, you may need USB UART click, USB UART 2 clickor RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.