Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions DOC/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

!![Alt text](https://github.com/UA6EM/Arduino-MCP4131/blob/mpgsp/DOC/mcp41x1_install.jpeg)

![Alt text](https://github.com/UA6EM/Arduino-MCP4131/blob/mpgsp/DOC/mcp41x1_spi.jpeg)
Binary file added DOC/mcp41x1_install.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added DOC/mcp41x1_spi.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ Example Wiring

![Alt text](https://github.com/dgduncan/Arduino-MCP4131/blob/master/extras/Screen%20Shot%202018-04-08%20at%209.56.42%20PM.png "Example Wiring Diagram")


!![Alt text](https://github.com/UA6EM/Arduino-MCP4131/blob/mpgsp/DOC/mcp41x1_install.jpeg)

![Alt text](https://github.com/UA6EM/Arduino-MCP4131/blob/mpgsp/DOC/mcp41x1_spi.jpeg)

License
=====


```
The MIT License (MIT)

Expand Down
8 changes: 4 additions & 4 deletions keywords.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
MCP4131 KEYWORD1
readWiper KEYWORD2
writeWiper KEYWORD2
decrementWiper KEYWORD2
incrementWiper KEYWORD2
readValue KEYWORD2
writeValue KEYWORD2
decrementValue KEYWORD2
incrementValue KEYWORD2
6 changes: 3 additions & 3 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name=MCP4131 library
version=1.0.0
version=1.0.1
author=Derek Duncan
maintainer=Derek Duncan
maintainer=ua6em
sentence=A library to control an MCP4131 digital potentiometer
paragraph=A library to control an MCP4131 digital potentiometer
category=Device Control
url=https://github.com/dgduncan/Arduino-MCP4131
url=https://github.com/UA6EM/Arduino-MCP4131/tree/mpgsp
architectures=*
10 changes: 5 additions & 5 deletions src/MCP4131.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ MCP4131::MCP4131(int slavePin) {
pinMode(slavePin, OUTPUT);
}

byte MCP4131::readWiper() {
byte MCP4131::readValue() {
return sendCommand(ADDRESS_WIPER0, COMMAND_READ, 255);
}

void MCP4131::writeWiper(unsigned int wiperValue) {
void MCP4131::writeValue(unsigned int wiperValue) {
sendCommand(ADDRESS_WIPER0, COMMAND_WRITE, wiperValue);
}

Expand Down Expand Up @@ -65,11 +65,11 @@ byte MCP4131::sendCommand(byte address, char command, unsigned int data) {

}

void MCP4131::decrementWiper() {
void MCP4131::decrementValue() {
sendCommand(ADDRESS_WIPER0, COMMAND_DECREMENT);
}

void MCP4131::incrementWiper() {
void MCP4131::incrementValue() {
sendCommand(ADDRESS_WIPER0, COMMAND_INCREMENT);
}

Expand All @@ -79,4 +79,4 @@ void MCP4131::enableChip() {

void MCP4131::disableChip() {
digitalWrite(slaveSelectPin, HIGH);
}
}
8 changes: 4 additions & 4 deletions src/MCP4131.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ class MCP4131
{
public:
MCP4131(int slave_select_pin);
byte readWiper();
void writeWiper(unsigned int wiperValue);
void decrementWiper();
void incrementWiper();
byte readValue();
void writeValue(unsigned int wiperValue);
void decrementValue();
void incrementValue();

private:
const static byte ADDRESS_WIPER0 = 0x0;
Expand Down