Example host software for the Maxim Integrated MAX5487, MAX5488, MAX5489 Digital Pot/Digital Potentiometer/Rheostat/Variable Resistor. Hosted on the MAX32630FTHR FeatherWing micro-controller board.
Dependencies: MAX5487_Digital_Pot_Potentiometer_Rheostat_Resistor_Wiper USBDevice max32630fthr
main.cpp
- Committer:
- jungkeviny
- Date:
- 2018-07-15
- Revision:
- 2:241a8806aaff
- Parent:
- 1:9f552131dd08
File content as of revision 2:241a8806aaff:
#include "mbed.h" #include "max32630fthr.h" #include "USBSerial.h" #include "MAX5487.h" MAX32630FTHR pegasus(MAX32630FTHR::VIO_3V3); Serial daplink(P2_1, P2_0); USBSerial microUSB; DigitalOut led1(LED1); // led to blink DigitalOut selectPin(P3_0); // Pin 3_0 is used to drive chip enable low SPI spi(P5_1, P5_2, P5_0); // mosi, miso, sclk int main() { MAX5487 test(spi, selectPin); spi.format(8,0); spi.frequency(1000000); // Write a command test.writeCommand(MAX5487::Wiper_RegA, 0x55); test.writeCommand(MAX5487::Copy_Wiper_RegA_to_NV_RegA); // Blink LED while (true) { led1 = !led1; Thread::wait(500); } }