/* Program to generate waveforms using DAC on Wytec EduPad board * The Wytec EduPad board has an MCP4725 two channel DAC on I2C. * A sawtooth waveform is generated on channel 0 and a sine wave channel 1. * * Energia 1.6.10E18 */ #include char SLAVEADDR = 0x60; // DAC MCP4725 address void setup() { Wire.begin(); } int i; void loop() { // create a sawtooth waveform i++; // write to MCP4725 DAC through I2C Wire.beginTransmission(SLAVEADDR); // start talking to DAC Wire.write(0x40); // send command Wire.write(i >> 4) & 0xFF; // send high byte data Wire.write(i << 4) & 0xFF; // send low byte data Wire.endTransmission(); // stop }