Created
January 28, 2018 21:45
-
-
Save Seich/fc47626e99ea3f9e05fda276fe6cdafb to your computer and use it in GitHub Desktop.
Arduino Potentiometer Notes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example program | |
#include <iostream> | |
#include <string> | |
#define WRITE 0b00 | |
#define READ 0b11 | |
#define WIPER0 0b0000 | |
#define WIPER1 0b0001 | |
#define TCON 0b0100 | |
#define STATUS 0b0101 | |
int main() | |
{ | |
int addr = 0b0000; | |
int cmd = 0b00; | |
int data = 0b0000000000; | |
addr |= WIPER1; | |
cmd |= READ; | |
std::cout << addr + cmd + data; | |
} | |
1111 1111 | |
1000 0000 | |
B00000010 | |
pot->increment(Address::Wiper0); | |
pot->decrement(Address::Wiper0); | |
pot->read(Address::Wiper0); | |
pot->set(Address::Wiper0, 255); | |
pot->on(); | |
pot->off(); | |
pot->wiper0 | |
AAAA CC xx | |
0b00000000 | |
0b00010000 | |
0100 00 00 | |
0101 00 00 | |
0001 0000 1110 0010 ideal | |
0100 0111 0000 1000 current | |
0100 0111 0000 1000 | |
01000111 01111111 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment