You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
721 B
47 lines
721 B
extern "C" {
|
|
#include <Wire/Wire.h>
|
|
}
|
|
|
|
#include "../global.h"
|
|
#include "ds1803.h"
|
|
|
|
DS1803::DS1803()
|
|
{
|
|
#ifdef WIRE_LIB_SCAN_MOD
|
|
/*if (!Wire.isStarted())*/ Wire.begin();
|
|
#else
|
|
Wire.begin();
|
|
#endif
|
|
}
|
|
|
|
/**
|
|
* Instantiate the object
|
|
**/
|
|
DS1803 DPOT = DS1803();
|
|
|
|
void DS1803::setWiper(uint8_t value, uint8_t wiperAddr)
|
|
{
|
|
if (!Wire.checkAddress(DS1803_WADDR)) return;
|
|
|
|
Wire.beginTransmission(DS1803_WADDR);
|
|
Wire.send(wiperAddr); // Send the wiper address
|
|
|
|
Wire.send(value);
|
|
|
|
Wire.endTransmission();
|
|
}
|
|
/*
|
|
uint8_t DS1803::getValue()
|
|
{
|
|
if (!Wire.checkAddress(DS1803_WADDR)) return;
|
|
|
|
Wire.requestFrom(DS1803_RADDR, 2);
|
|
|
|
while (Wire.available()) {
|
|
Serial.println((uint8_t)Wire.receive(), DEC);
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
*/
|