diff options
-rw-r--r-- | main.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
@@ -99,19 +99,13 @@ class DAC { i2c.write_reg(0x4a, 0x02, 0x9e); i2c.write_reg(0x4a, 0x06, (0 << 7) | (1 << 6) | (0 << 4) | (1 << 2) | (3 << 0)); - set_volume(-0x40); - //i2c.write_reg(0x4a, 0x1a, 0); - //i2c.write_reg(0x4a, 0x1b, 0); - //i2c.write_reg(0x4a, 0x1a, -0x40 & 0x7f); - //i2c.write_reg(0x4a, 0x1b, -0x40 & 0x7f); } uint8_t get_volume() { return volume; } - void set_volume(uint8_t v) { + void set_volume(uint8_t c, uint8_t v) { volume = v; - i2c.write_reg(0x4a, 0x1a, volume & 0x7f); - i2c.write_reg(0x4a, 0x1b, volume & 0x7f); + i2c.write_reg(0x4a, 0x1a + c, volume & 0x7f); } }; |