refined dac example

master
edwin 4 years ago
parent 146a254f40
commit 8fd0bb88cb

@ -136,16 +136,19 @@ void mcp4725_test()
MCP4725 dac(&i2c);
dac = 0xFFFF;
dac = 0x0000;
for(i = 5 ; i > 0; i--)
for(i = 20 ; i > 0; i--)
{
std::cout << "off" << std::endl;
dac = 0x0000;
usleep(2000000);
std::cout << static_cast<unsigned int>(i) << std::endl;
std::cout << "on" << std::endl;
dac = 0xFFFF;
usleep(2000000);
std::cout << "off" << std::endl;
dac = 0x0000;
usleep(2000000);
}
/*
MCP4725 dac(//MCP4725::pwrd_md::normal,

Binary file not shown.
Loading…
Cancel
Save