mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-10-03 18:09:02 -04:00
+ extended example
+ set I2C -> 100KHz
This commit is contained in:
parent
4126dfc63a
commit
144e1d7e02
@ -23,8 +23,8 @@ MCP4725::MCP4725(uint8_t device)
|
||||
void MCP4725::begin()
|
||||
{
|
||||
Wire.begin();
|
||||
|
||||
TWBR = 72;
|
||||
|
||||
// 0=1000 1=888 2=800 8=500
|
||||
// 12=400KHz 24=250 32=200 72=100 152=50
|
||||
// F_CPU/16+(2*TWBR) // TWBR is a uint8_t
|
||||
|
@ -81,6 +81,17 @@ void setup()
|
||||
|
||||
void loop()
|
||||
{
|
||||
for (int i=0; i< 4096; i++)
|
||||
{
|
||||
DAC.setValue(i);
|
||||
delay(10);
|
||||
}
|
||||
for (int i=0; i< 4096; i++)
|
||||
{
|
||||
DAC.setValue(4096 - i);
|
||||
delay(10);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user