Car stereo control using TDA7419 for input select, audio control. Adafruit 96x64 monochrome 0.96" display to show the audio selections four buttons to control selections. Next steps: take input from the car steering wheel controls!
Dependencies: Adafruit_GFX PinDetect_KL25Z PreampTDA7419 mbed
Diff: main.cpp
- Revision:
- 2:2b0cf4d80668
- Parent:
- 1:f5b8687f67b8
- Child:
- 3:8d3cc3488cd8
--- a/main.cpp Sun Oct 12 04:48:34 2014 +0000 +++ b/main.cpp Sun Oct 19 04:30:40 2014 +0000 @@ -1,6 +1,7 @@ #include "mbed.h" #include "PinDetect.h" #include "Adafruit_SSD1306.h" +#include "PreampTDA7419.h" PinDetect PinUp ( PTA1 ); PinDetect PinLeft ( PTD4 ); @@ -19,6 +20,7 @@ SPI2 gSpi(PTD2,NC,PTD1); Adafruit_SSD1306 display (gSpi, PTD0, PTD5, PTA13); // SPI obect, DC, RST, CS +PreampTDA7419 Preamp (PTE0, PTE1); void testfillrect(void) { uint8_t color = 1; @@ -43,12 +45,6 @@ display.display(); } -/////////////////////////// -// Variables for TDA7419 // -/////////////////////////// -// I2C address for TDA7419 -#define TDA7419_ADDRESS 0x44 - //////////////////////////////////// // register addresses for TDA7419 // //////////////////////////////////// @@ -103,14 +99,11 @@ char atten_mix = 8; char atten_sub = 10; -void i2c_write(char device_address, char command, char value) { - // wait(0.3); - //display.printf("Transmitted!!"); - //display.update(); -} void writeToTDA7419 (char address, char value) { - i2c_write(TDA7419_ADDRESS, address, value); + if (!Preamp.i2c_write(address, value)) { + //displayWrite("Trans Failed", 0); + } } /////////////////////////////////