├── 25LC2014_clear └── 25LC2014_clear.ino ├── 25LC2014_dump ├── 25LC2014_dump.ino └── aceledent.bin ├── Alpine_remote_control ├── README.md ├── alpine_code_scane_with_lcd_shield │ └── alpine_code_scane_with_lcd_shield.ino ├── alpine_remote_control_emulator │ └── alpine_remote_control_emulator.ino └── alpinescan_by_amar_kulo │ └── alpinescan_by_amar_kulo.ino ├── BM20avr ├── BM20avr.ino ├── IS2020.cpp ├── IS2020.h ├── LICENSE.md ├── MMI.h ├── Music.h ├── commands.h └── events.h ├── K02_serial_example └── K02_serial_example.ino ├── README.md ├── Tripling ├── confort_blinker.fz ├── confort_blinker_new.fzz └── tripling_schema.png ├── VAG_radio_to_navi_display └── VAG_radio_to_navi_display.ino ├── VWFIS ├── FIS_protocol_emulator │ ├── FIS_protocol_emulator.ino │ └── LICENSE.md ├── FIS_protocol_emulator_with_lib │ ├── FIS_protocol_emulator_with_lib.ino │ └── bitmaps.h ├── README.md ├── emulated_comunication_with_ack.png └── read_cluster │ └── read_cluster.ino ├── VW_radio_remote_control ├── README.md ├── audi_MFSW_eletric_connection_schematics.pdf ├── code_finder │ └── code_finder.ino ├── emulator │ └── emulator.ino └── remote_control_codes_control_unit_to_radio.ods ├── audi_concert_RDS ├── rds_100khz.csv └── rs232c_dump9600_8N1 ├── audi_volume_fix ├── AM2FM.txt ├── CD2FM.txt ├── CD2TP.txt ├── CD_next_track.txt ├── FM1-to-FM2.txt ├── FM2-to-FM1.txt ├── FM2AM.txt ├── FM2TAPE.txt ├── FM2TAPE2CD.txt ├── LICENSE.md ├── TAPE_CPS_DOLBY_ETC.txt ├── TAPE_EJECT.txt ├── TAPE_FF_FR.txt ├── TAPE_REVERSE.txt ├── audi_volume_fix.ino ├── enable12V.txt ├── fix_module_by_tomcad.txt ├── fix_module_by_tomcad2.txt ├── fix_module_by_tomcad3.txt ├── newchip.txt ├── poweron.txt ├── volumeDOWM.txt └── volumeUP.txt ├── char_fix_radio_mode_moped ├── VAGFISReader.cpp ├── VAGFISReader.h ├── VAGFISWriter.cpp ├── VAGFISWriter.h ├── bitmaps.h └── char_fix_radio_mode_moped.ino ├── fake_xenon_adjuster ├── README.md └── fake_xenon_adjuster.ino ├── gearbox_selector_protocol └── gearbox_selector_protocol.ino ├── myMatrix ├── README.me ├── font5x7.h ├── font6x16.h ├── font7x11.h ├── font7x16.h ├── font8x16.h ├── myMATRIX.h ├── myMATRIXClass.cpp └── myMATRIXClass.h ├── read_audi_concert_display ├── LICENSE.md └── read_audi_concert_display.ino ├── read_symphonyII_code └── read_symphonyII_code.ino ├── stm32_i2c_slave55 └── stm32_i2c_slave55.ino └── wavegen └── wavegen.ino /25LC2014_clear/25LC2014_clear.ino: -------------------------------------------------------------------------------- 1 | //code for fixing acceledent aura when it stops working and the LED Indicator is flashing alternating green and orange 2 | 3 | /* Example program for use with EEPROMsimple.h 4 | Arduino Uno Memory Expansion Sample Program 5 | Author: J. B. Gallaher 07/09/2016 6 | Library created and expanded by: D. Dubins 23-Jan-20 7 | 8 | Sample program to use a Serial EEPROM chip to expand memory for an Arduino Uno 9 | giving access to an additional 128kB of random access memory. The 25LC1024 uses 10 | the Serial Peripheral Interface (SPI) to transfer data and commands between the 11 | UNO and the memory chip. 12 | 13 | Used the following components: 14 | (1) Arduino Uno 15 | (2) Microchip 25LC1024 SPI EEPROM chip 16 | 17 | Wiring: 18 | 25LC1024 - Uno: 19 | --------------- 20 | pin 1 -- D10 (SS) 21 | pin 2 -- D12 (MISO) 22 | pin 3, 7, 8 -- +5V 23 | pin 4 -- GND 24 | pin 5 -- D11 (MOSI) 25 | pin 6 -- D13 (SCK) 26 | */ 27 | #include 28 | 29 | #define CSPIN 10 // Default Chip Select Line for Uno (change as needed) 30 | EEPROMsimple EEPROM; //initialize an instance of this class 31 | 32 | /******* Set up code to define variables and start the SCI and SPI serial interfaces *****/ 33 | void setup() 34 | { 35 | uint32_t address = 0; // create a 32 bit variable to hold the address (uint32_t=long) 36 | Serial.begin(115200); // set communication speed for the serial monitor 37 | SPI.begin(); // start communicating with the memory chip 38 | 39 | 40 | /********* Read a single Byte *********************/ 41 | //Serial.println("Reading each data byte individually: "); 42 | byte value; // create variable to hold the data value read 43 | for(long i = 0; i <=131072; i++){ 44 | address = i; 45 | EEPROM.WriteByte(address, 0xFF); 46 | } 47 | Serial.println("done"); 48 | } 49 | 50 | void loop(){ 51 | } 52 | -------------------------------------------------------------------------------- /25LC2014_dump/25LC2014_dump.ino: -------------------------------------------------------------------------------- 1 | //code for dumping eeprom from acceledent aura when it stops working and the LED Indicator is flashing alternating green and orange 2 | 3 | /* Example program for use with EEPROMsimple.h 4 | Arduino Uno Memory Expansion Sample Program 5 | Author: J. B. Gallaher 07/09/2016 6 | Library created and expanded by: D. Dubins 23-Jan-20 7 | 8 | Sample program to use a Serial EEPROM chip to expand memory for an Arduino Uno 9 | giving access to an additional 128kB of random access memory. The 25LC1024 uses 10 | the Serial Peripheral Interface (SPI) to transfer data and commands between the 11 | UNO and the memory chip. 12 | 13 | Used the following components: 14 | (1) Arduino Uno 15 | (2) Microchip 25LC1024 SPI EEPROM chip 16 | 17 | Wiring: 18 | 25LC1024 - Uno: 19 | --------------- 20 | pin 1 -- D10 (SS) 21 | pin 2 -- D12 (MISO) 22 | pin 3, 7, 8 -- +5V 23 | pin 4 -- GND 24 | pin 5 -- D11 (MOSI) 25 | pin 6 -- D13 (SCK) 26 | */ 27 | #include 28 | 29 | #define CSPIN 10 // Default Chip Select Line for Uno (change as needed) 30 | EEPROMsimple EEPROM; //initialize an instance of this class 31 | 32 | /******* Set up code to define variables and start the SCI and SPI serial interfaces *****/ 33 | void setup() 34 | { 35 | uint32_t address = 0; // create a 32 bit variable to hold the address (uint32_t=long) 36 | Serial.begin(115200); // set communication speed for the serial monitor 37 | SPI.begin(); // start communicating with the memory chip 38 | 39 | 40 | /********* Read a single Byte *********************/ 41 | //Serial.println("Reading each data byte individually: "); 42 | byte value; // create variable to hold the data value read 43 | int y = 0; 44 | for (long i = 0; i <= 131072; i++) { 45 | /*if (!y){ 46 | Serial.print(i,HEX); 47 | Serial.print(": "); 48 | }*/ 49 | address = i; // use the loop counter as the memory address 50 | value = EEPROM.ReadByte(address); // reads a byte of data at that memory location 51 | Serial.write(value); // Let's see what we got 52 | //Serial.print(" "); 53 | /*y++; 54 | if(y==32){ 55 | Serial.println(); 56 | y=0; 57 | }*/ 58 | 59 | } 60 | 61 | 62 | } 63 | 64 | void loop() { 65 | } 66 | -------------------------------------------------------------------------------- /25LC2014_dump/aceledent.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaskovacik/arduino/f05afbf2832779639f7acf65efefe63748cfe9e0/25LC2014_dump/aceledent.bin -------------------------------------------------------------------------------- /Alpine_remote_control/README.md: -------------------------------------------------------------------------------- 1 | - alpine_remote_control_emulator: emulator/simulator of alpine remote control (in my case CDE-9880R) designed for work with peugeot 206 (year 1998) 2 | 3 | - alpine_code_scane_with_lcd_shield: remote control code scanner (better name is generator of codes) for alpine radions originaly writen by amar kulo (original code in alpinescan_by_amar_kulo) patched to work with LCD keypad shield from ebay 4 | -------------------------------------------------------------------------------- /Alpine_remote_control/alpine_code_scane_with_lcd_shield/alpine_code_scane_with_lcd_shield.ino: -------------------------------------------------------------------------------- 1 | //example use of LCD4Bit_mod library 2 | 3 | #include 4 | #include 5 | //create object to control an LCD. 6 | //number of lines in display=1 7 | LCD4Bit_mod lcd = LCD4Bit_mod(2); 8 | 9 | //Key message 10 | int adc_key_val[5] ={30, 150, 360, 535, 760 }; 11 | int NUM_KEYS = 5; 12 | int adc_key_in; 13 | int key=-1; 14 | int oldkey=-1; 15 | 16 | // constants 17 | const unsigned int outputPin = 3; 18 | 19 | // variables 20 | unsigned int iProbe[] = {128, 128, 128}; 21 | unsigned int iMemPos = 10; 22 | unsigned int iHello[24] = {1,1,0,1,0,1,1,1, 1,1,0,1,1,0,1,1, 1,0,1,0,1,0,1,1}; 23 | unsigned int iFounded[] = {87, 253, 85, 107, 247, 85, 111, 237, 85, 119, 235, 85, 173, 238, 213, 183, 219, 85, 187, 218, 213, 93, 250, 213, 219, 214, 213, 109, 246, 213, 171, 239, 85, 85, 255, 85}; // replace with your values 24 | unsigned int iLoopState = 0; // 0 = stopped, 1 = started 25 | unsigned int iCurrentCombination; 26 | 27 | // functions 28 | int *dec2bin(int iDec); 29 | void sendPrevious(); 30 | void sendButton(); 31 | void sendNext(); 32 | void saveCombination(); 33 | void printCombinations(); 34 | void importCombinations(); 35 | void sendNextCombination(); 36 | void sendPreviousCombination(); 37 | void changeState(); 38 | 39 | void setup() { 40 | lcd.init(); 41 | lcd.clear(); 42 | lcd.printIn("Program started"); 43 | Serial.begin(9600); 44 | Serial.println("Program started"); 45 | // initialize pins 46 | // output pin 47 | pinMode(outputPin, OUTPUT); 48 | // read last known values from eeprom 49 | for (int i = 0; i < 3; i++) 50 | { 51 | iProbe[i] = EEPROM.read(i); 52 | } 53 | 54 | // read last save position from eeprom 55 | iMemPos = EEPROM.read(5); 56 | if (iMemPos == 0) iMemPos = 10; 57 | 58 | // print saved combinations 59 | printCombinations(); 60 | 61 | } 62 | 63 | void loop() { 64 | 65 | adc_key_in = analogRead(0); // read the value from the sensor 66 | digitalWrite(13, HIGH); 67 | key = get_key(adc_key_in); // convert into key press 68 | 69 | if (key != oldkey) // if keypress is detected 70 | { 71 | delay(50); // wait for debounce time 72 | adc_key_in = analogRead(0); // read the value from the sensor 73 | key = get_key(adc_key_in); // convert into key press 74 | if (key != oldkey) 75 | { 76 | oldkey = key; 77 | if (key >=0){ 78 | lcd.cursorTo(2, 0); //line=2, x=0 79 | switch (key) { 80 | 81 | case 0: 82 | lcd.clear(); 83 | lcd.printIn("Send Next"); 84 | sendNext(); 85 | // sendNextCombination(); 86 | break; 87 | case 1: 88 | // misc 89 | // eraseEeprom(); 90 | saveCombination(); 91 | // importCombinations(); 92 | break; 93 | case 2: 94 | lcd.clear(); 95 | lcd.printIn("Repeate last"); 96 | // resend last combination 97 | sendButton(); 98 | break; 99 | case 3: 100 | lcd.clear(); 101 | lcd.printIn("Send Previous"); 102 | sendPrevious(); 103 | break; 104 | case 4: 105 | changeState(); 106 | // sendPreviousCombination(); 107 | break; 108 | 109 | } 110 | } 111 | } 112 | } 113 | 114 | if (iLoopState == 1) 115 | { 116 | sendNext(); 117 | } 118 | } 119 | 120 | // Convert ADC value to key number 121 | int get_key(unsigned int input) 122 | { 123 | int k; 124 | 125 | for (k = 0; k < NUM_KEYS; k++) 126 | { 127 | if (input < adc_key_val[k]) 128 | { 129 | 130 | return k; 131 | } 132 | } 133 | 134 | if (k >= NUM_KEYS) 135 | k = -1; // No valid key pressed 136 | 137 | return k; 138 | } 139 | 140 | void changeState() // function that starts or stops looping for the codes 141 | { 142 | lcd.clear(); 143 | if (iLoopState == 0) 144 | { 145 | iLoopState = 1; 146 | Serial.print("Start looping"); 147 | lcd.printIn("Start looping"); 148 | } else { 149 | iLoopState = 0; 150 | Serial.print("Stop looping"); 151 | lcd.printIn("Stop looping"); 152 | } 153 | } 154 | 155 | int* dec2bin(int iDec) // function for converting decimal to binary 156 | { 157 | static int iResult[7]; 158 | for (int i = 0; i <= 7; i++) 159 | { 160 | iResult[i] = iDec % 2; 161 | iDec = iDec / 2; 162 | } 163 | 164 | return iResult; 165 | } 166 | 167 | void printArray(int* iArray) // function for output of array in reversed mode for binary values 168 | { 169 | 170 | for (int x = 0; x <= 7; x++) 171 | { 172 | Serial.print(iArray[7-x]); 173 | } 174 | 175 | Serial.print(" "); 176 | } 177 | 178 | void sendPrevious() // function that sends previous code 179 | { 180 | if (iProbe[2] > 85) 181 | { 182 | iProbe[2] = 85; 183 | goto sendme; 184 | } 185 | if (iProbe[1] > 214) 186 | { 187 | --iProbe[1]; 188 | iProbe[2] = 213; 189 | goto sendme; 190 | } 191 | if (iProbe[0] > 85) 192 | { 193 | iProbe[2] = 213; 194 | iProbe[1] = 255; 195 | --iProbe[0]; 196 | goto sendme; 197 | } 198 | sendme: 199 | sendButton(); 200 | } 201 | 202 | void sendNext() // function that sends next code 203 | { 204 | if (iProbe[2] < 213) 205 | { 206 | iProbe[2] = 213; 207 | goto sendme; 208 | } 209 | 210 | if (iProbe[1] < 255) 211 | { 212 | ++iProbe[1]; 213 | iProbe[2] = 85; 214 | goto sendme; 215 | } 216 | if (iProbe[0] < 219) 217 | { 218 | ++iProbe[0]; 219 | iProbe[2] = 85; 220 | iProbe[1] = 214; 221 | goto sendme; 222 | } 223 | sendme: 224 | sendButton(); 225 | } 226 | 227 | void sendButton() // main function that sends codes on the output pin 228 | { 229 | // debug 230 | Serial.println("Probing button combination:"); 231 | for (int i = 0; i < 3; i++) 232 | { 233 | EEPROM.write(i,iProbe[i]); 234 | Serial.print(iProbe[i]); 235 | Serial.print(" "); 236 | } 237 | Serial.print("\n"); 238 | 239 | printArray(dec2bin(iProbe[0])); 240 | Serial.print(" "); 241 | printArray(dec2bin(iProbe[1])); 242 | Serial.print(" "); 243 | printArray(dec2bin(iProbe[2])); 244 | Serial.print("\n"); 245 | 246 | // init part 247 | //first send 8ms high 248 | digitalWrite(outputPin, HIGH); 249 | delay(8); 250 | // send 4.5ms low 251 | digitalWrite(outputPin, LOW); 252 | delayMicroseconds(4500); 253 | 254 | // send hello part 255 | for (int i = 0; i < 24; i++) 256 | { 257 | if (iHello[i] == 0) 258 | { 259 | digitalWrite(outputPin, LOW); 260 | } else { 261 | digitalWrite(outputPin, HIGH); 262 | } 263 | // end part 264 | delayMicroseconds(500); 265 | // wait 0.5ms 266 | digitalWrite(outputPin, LOW); 267 | delayMicroseconds(500); 268 | } 269 | 270 | for (int i = 0; i < 3; i++) 271 | { 272 | int *iArr = dec2bin(iProbe[i]); 273 | 274 | // test part 275 | for (int x = 0; x < 8; x++) 276 | { 277 | if (iArr[7-x] == 0) 278 | { 279 | digitalWrite(outputPin, LOW); 280 | } else { 281 | digitalWrite(outputPin, HIGH); 282 | } 283 | // end part 284 | delayMicroseconds(500); 285 | // wait 0.5ms 286 | digitalWrite(outputPin, LOW); 287 | delayMicroseconds(500); 288 | } 289 | } 290 | 291 | // end part 292 | // send 41ms low 293 | digitalWrite(outputPin, LOW); 294 | delay(41); 295 | } 296 | 297 | void eraseEeprom() // function for erasing of the eeprom 298 | { 299 | lcd.clear(); 300 | lcd.printIn("EEprom erase."); 301 | iProbe[0] = 85; 302 | iProbe[1] = 214; 303 | iProbe[2] = 85; 304 | 305 | for (int i = 0; i<3; i++) 306 | { 307 | EEPROM.write(i, iProbe[i]); 308 | } 309 | EEPROM.write(5, 10); 310 | iMemPos = 10; 311 | Serial.println("EEprom erased."); 312 | lcd.cursorTo(2,0); 313 | lcd.printIn("Done."); 314 | } 315 | 316 | void saveCombination() // function for saving of founded combination on the eeprom 317 | { 318 | lcd.clear(); 319 | lcd.printIn("Saving combination:"); 320 | for (int i = 0; i < 3; i++) 321 | { 322 | EEPROM.write(iMemPos + i, iProbe[i]); 323 | } 324 | EEPROM.write(5, iMemPos+3); 325 | iMemPos = iMemPos + 3; 326 | Serial.println("Combination saved."); 327 | lcd.cursorTo(2,0); 328 | lcd.printIn("Done."); 329 | 330 | } 331 | 332 | void printCombinations() // function that print list of codes saved on eeprom 333 | { 334 | Serial.print("Number of saved configurations: "); 335 | Serial.print((iMemPos - 10) / 3, DEC); 336 | Serial.print("\n"); 337 | if (iMemPos == 10) return; 338 | int x = 0; 339 | for (int i = 10; i < iMemPos; i++) 340 | { 341 | if (x == 3) 342 | { 343 | Serial.print("\n"); 344 | x = 0; 345 | } 346 | x = x + 1; 347 | Serial.print(EEPROM.read(i), DEC); 348 | Serial.print(" "); 349 | } 350 | 351 | } 352 | 353 | void sendNextCombination() // function that sends next combination from eeprom 354 | { 355 | if(iCurrentCombination == ((iMemPos - 10) / 3) - 1) 356 | { 357 | iCurrentCombination = 0; 358 | } else { 359 | iCurrentCombination++; 360 | } 361 | 362 | Serial.print("\nSending combination nr "); 363 | Serial.print(iCurrentCombination, DEC); 364 | Serial.print("\n"); 365 | 366 | for(int i = 0; i < 3; i++) 367 | { 368 | iProbe[i] = EEPROM.read(i + 10 + (iCurrentCombination * 3)); 369 | Serial.print(" "); 370 | } 371 | 372 | Serial.print("\n"); 373 | sendButton(); 374 | } 375 | 376 | void sendPreviousCombination() // function that sends previous combination from eeprom 377 | { 378 | if(iCurrentCombination == 0) 379 | { 380 | iCurrentCombination = ((iMemPos - 10) / 3) - 1; 381 | } else { 382 | iCurrentCombination--; 383 | } 384 | 385 | Serial.print("\nSending combination nr "); 386 | Serial.print(iCurrentCombination, DEC); 387 | Serial.print("\n"); 388 | 389 | for(int i = 0; i < 3; i++) 390 | { 391 | iProbe[i] = EEPROM.read(i + 10 + (iCurrentCombination * 3)); 392 | Serial.print(" "); 393 | } 394 | 395 | Serial.print("\n"); 396 | 397 | sendButton(); 398 | } 399 | 400 | void importCombinations() // function that import combinations from iFounded array and saves them to eeprom 401 | { 402 | Serial.print("\n"); 403 | Serial.print("Importing combinations."); 404 | 405 | for (int i = 0; i < (sizeof(iFounded) / 2); i++) 406 | { 407 | EEPROM.write(i+10, iFounded[i]); 408 | } 409 | 410 | iMemPos = (sizeof(iFounded) / 2) + 10; 411 | 412 | EEPROM.write(5, iMemPos); 413 | 414 | Serial.print("\n"); 415 | Serial.print("Importing done."); 416 | Serial.print("\n"); 417 | } 418 | -------------------------------------------------------------------------------- /Alpine_remote_control/alpinescan_by_amar_kulo/alpinescan_by_amar_kulo.ino: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Alpine code scanner v 0.24 by Amar Kulo - dzoner@gmail.com 4 | 5 | Program sends wired remote code combinations to the HU with button press or via loop. 6 | 7 | Five buttons are present: 1. previous code/combination 8 | 2. repeat code 9 | 3. next code/combination 10 | 4. start/stop looping 11 | 5. save combination/import combinations/erase eeprom 12 | 13 | When code is sent it's automatically showed on serial console. 14 | 15 | */ 16 | #include 17 | 18 | 19 | // constants 20 | const unsigned int outputPin = 13; 21 | const unsigned int iButtonPin[] = {12,11,10,9,8}; 22 | const unsigned int iButtons = 4; 23 | 24 | // variables 25 | unsigned int iButtonState[5]; 26 | unsigned long lButtonDown[5]; 27 | unsigned int iProbe[] = {128, 128, 128}; 28 | unsigned int iMemPos = 10; 29 | unsigned int iHello[24] = {1,1,0,1,0,1,1,1, 1,1,0,1,1,0,1,1, 1,0,1,0,1,0,1,1}; 30 | unsigned int iFounded[] = {87, 253, 85, 107, 247, 85, 111, 237, 85, 119, 235, 85, 173, 238, 213, 183, 219, 85, 187, 218, 213, 93, 250, 213, 219, 214, 213, 109, 246, 213, 171, 239, 85, 85, 255, 85}; // replace with your values 31 | unsigned int iLoopState = 0; // 0 = stopped, 1 = started 32 | unsigned int iCurrentCombination; 33 | 34 | // functions 35 | int *dec2bin(int iDec); 36 | void sendPrevious(); 37 | void sendButton(); 38 | void sendNext(); 39 | void saveCombination(); 40 | void printCombinations(); 41 | void importCombinations(); 42 | void sendNextCombination(); 43 | void sendPreviousCombination(); 44 | void changeState(); 45 | 46 | void setup() { 47 | // initialize the serial console 48 | Serial.begin(9600); 49 | Serial.println("Program started"); 50 | // initialize pins 51 | // output pin 52 | pinMode(outputPin, OUTPUT); 53 | // input pins 54 | for (int i = 0; i <= iButtons + 1; i++) { 55 | pinMode(iButtonPin[i], INPUT); 56 | } 57 | 58 | // read last known values from eeprom 59 | for (int i = 0; i < 3; i++) 60 | { 61 | iProbe[i] = EEPROM.read(i); 62 | } 63 | 64 | // read last save position from eeprom 65 | iMemPos = EEPROM.read(5); 66 | if (iMemPos == 0) iMemPos = 10; 67 | 68 | // print saved combinations 69 | printCombinations(); 70 | } 71 | 72 | void loop(){ 73 | for (int i = 0; i <= iButtons; i++) { 74 | // read the state of the button 75 | iButtonState[i] = digitalRead(iButtonPin[i]); 76 | 77 | // check if the button is pressed 78 | if (iButtonState[i] == 1){ 79 | if(lButtonDown[i] == 0) { 80 | // save time when button is pressed down 81 | lButtonDown[i] = millis(); 82 | } 83 | } 84 | 85 | if (iButtonState[i] == 0){ 86 | if(lButtonDown[i] > 0) { 87 | if (i == 0) { 88 | // previous 89 | sendPrevious(); 90 | // sendPreviousCombination(); 91 | } else if (i == 1) { 92 | // resend last combination 93 | sendButton(); 94 | } else if (i == 2){ 95 | // next 96 | sendNext(); 97 | // sendNextCombination(); 98 | } else if (i == 3) { 99 | changeState(); 100 | } else if (i == 4){ 101 | // misc 102 | eraseEeprom(); 103 | // saveCombination(); 104 | // importCombinations(); 105 | } 106 | // cleanup 107 | lButtonDown[i] = 0; 108 | iButtonState[i] = 0; 109 | } 110 | } 111 | } 112 | if (iLoopState == 1) 113 | { 114 | sendNext(); 115 | } 116 | } 117 | 118 | void changeState() // function that starts or stops looping for the codes 119 | { 120 | if (iLoopState == 0) 121 | { 122 | iLoopState = 1; 123 | Serial.print("Start looping"); 124 | } else { 125 | iLoopState = 0; 126 | Serial.print("Stop looping"); 127 | } 128 | } 129 | 130 | int* dec2bin(int iDec) // function for converting decimal to binary 131 | { 132 | static int iResult[7]; 133 | for (int i = 0; i <= 7; i++) 134 | { 135 | iResult[i] = iDec % 2; 136 | iDec = iDec / 2; 137 | } 138 | 139 | return iResult; 140 | } 141 | 142 | void printArray(int* iArray) // function for output of array in reversed mode for binary values 143 | { 144 | 145 | for (int x = 0; x <= 7; x++) 146 | { 147 | Serial.print(iArray[7-x]); 148 | } 149 | 150 | Serial.print(" "); 151 | } 152 | 153 | void sendPrevious() // function that sends previous code 154 | { 155 | if (iProbe[2] > 85) 156 | { 157 | iProbe[2] = 85; 158 | goto sendme; 159 | } 160 | if (iProbe[1] > 214) 161 | { 162 | --iProbe[1]; 163 | iProbe[2] = 213; 164 | goto sendme; 165 | } 166 | if (iProbe[0] > 85) 167 | { 168 | iProbe[2] = 213; 169 | iProbe[1] = 255; 170 | --iProbe[0]; 171 | goto sendme; 172 | } 173 | sendme: 174 | sendButton(); 175 | } 176 | 177 | void sendNext() // function that sends next code 178 | { 179 | if (iProbe[2] < 213) 180 | { 181 | iProbe[2] = 213; 182 | goto sendme; 183 | } 184 | 185 | if (iProbe[1] < 255) 186 | { 187 | ++iProbe[1]; 188 | iProbe[2] = 85; 189 | goto sendme; 190 | } 191 | if (iProbe[0] < 219) 192 | { 193 | ++iProbe[0]; 194 | iProbe[2] = 85; 195 | iProbe[1] = 214; 196 | goto sendme; 197 | } 198 | sendme: 199 | sendButton(); 200 | } 201 | 202 | void sendButton() // main function that sends codes on the output pin 203 | { 204 | // debug 205 | Serial.println("Probing button combination:"); 206 | for (int i = 0; i < 3; i++) 207 | { 208 | EEPROM.write(i,iProbe[i]); 209 | Serial.print(iProbe[i]); 210 | Serial.print(" "); 211 | } 212 | Serial.print("\n"); 213 | 214 | printArray(dec2bin(iProbe[0])); 215 | Serial.print(" "); 216 | printArray(dec2bin(iProbe[1])); 217 | Serial.print(" "); 218 | printArray(dec2bin(iProbe[2])); 219 | Serial.print("\n"); 220 | 221 | // init part 222 | //first send 8ms high 223 | digitalWrite(outputPin, HIGH); 224 | delay(8); 225 | // send 4.5ms low 226 | digitalWrite(outputPin, LOW); 227 | delayMicroseconds(4500); 228 | 229 | // send hello part 230 | for (int i = 0; i < 24; i++) 231 | { 232 | if (iHello[i] == 0) 233 | { 234 | digitalWrite(outputPin, LOW); 235 | } else { 236 | digitalWrite(outputPin, HIGH); 237 | } 238 | // end part 239 | delayMicroseconds(500); 240 | // wait 0.5ms 241 | digitalWrite(outputPin, LOW); 242 | delayMicroseconds(500); 243 | } 244 | 245 | for (int i = 0; i < 3; i++) 246 | { 247 | int *iArr = dec2bin(iProbe[i]); 248 | 249 | // test part 250 | for (int x = 0; x < 8; x++) 251 | { 252 | if (iArr[7-x] == 0) 253 | { 254 | digitalWrite(outputPin, LOW); 255 | } else { 256 | digitalWrite(outputPin, HIGH); 257 | } 258 | // end part 259 | delayMicroseconds(500); 260 | // wait 0.5ms 261 | digitalWrite(outputPin, LOW); 262 | delayMicroseconds(500); 263 | } 264 | } 265 | 266 | // end part 267 | // send 41ms low 268 | digitalWrite(outputPin, LOW); 269 | delay(41); 270 | } 271 | 272 | void eraseEeprom() // function for erasing of the eeprom 273 | { 274 | iProbe[0] = 85; 275 | iProbe[1] = 214; 276 | iProbe[2] = 85; 277 | 278 | for (int i = 0; i<3; i++) 279 | { 280 | EEPROM.write(i, iProbe[i]); 281 | } 282 | EEPROM.write(5, 10); 283 | iMemPos = 10; 284 | Serial.println("EEprom erased."); 285 | } 286 | 287 | void saveCombination() // function for saving of founded combination on the eeprom 288 | { 289 | for (int i = 0; i < 3; i++) 290 | { 291 | EEPROM.write(iMemPos + i, iProbe[i]); 292 | } 293 | EEPROM.write(5, iMemPos+3); 294 | iMemPos = iMemPos + 3; 295 | Serial.println("Combination saved."); 296 | } 297 | 298 | void printCombinations() // function that print list of codes saved on eeprom 299 | { 300 | Serial.print("Number of saved configurations: "); 301 | Serial.print((iMemPos - 10) / 3, DEC); 302 | Serial.print("\n"); 303 | if (iMemPos == 10) return; 304 | int x = 0; 305 | for (int i = 10; i < iMemPos; i++) 306 | { 307 | if (x == 3) 308 | { 309 | Serial.print("\n"); 310 | x = 0; 311 | } 312 | x = x + 1; 313 | Serial.print(EEPROM.read(i), DEC); 314 | Serial.print(" "); 315 | } 316 | 317 | } 318 | 319 | void sendNextCombination() // function that sends next combination from eeprom 320 | { 321 | if(iCurrentCombination == ((iMemPos - 10) / 3) - 1) 322 | { 323 | iCurrentCombination = 0; 324 | } else { 325 | iCurrentCombination++; 326 | } 327 | 328 | Serial.print("\nSending combination nr "); 329 | Serial.print(iCurrentCombination, DEC); 330 | Serial.print("\n"); 331 | 332 | for(int i = 0; i < 3; i++) 333 | { 334 | iProbe[i] = EEPROM.read(i + 10 + (iCurrentCombination * 3)); 335 | Serial.print(" "); 336 | } 337 | 338 | Serial.print("\n"); 339 | sendButton(); 340 | } 341 | 342 | void sendPreviousCombination() // function that sends previous combination from eeprom 343 | { 344 | if(iCurrentCombination == 0) 345 | { 346 | iCurrentCombination = ((iMemPos - 10) / 3) - 1; 347 | } else { 348 | iCurrentCombination--; 349 | } 350 | 351 | Serial.print("\nSending combination nr "); 352 | Serial.print(iCurrentCombination, DEC); 353 | Serial.print("\n"); 354 | 355 | for(int i = 0; i < 3; i++) 356 | { 357 | iProbe[i] = EEPROM.read(i + 10 + (iCurrentCombination * 3)); 358 | Serial.print(" "); 359 | } 360 | 361 | Serial.print("\n"); 362 | 363 | sendButton(); 364 | } 365 | 366 | void importCombinations() // function that import combinations from iFounded array and saves them to eeprom 367 | { 368 | Serial.print("\n"); 369 | Serial.print("Importing combinations."); 370 | 371 | for (int i = 0; i < (sizeof(iFounded) / 2); i++) 372 | { 373 | EEPROM.write(i+10, iFounded[i]); 374 | } 375 | 376 | iMemPos = (sizeof(iFounded) / 2) + 10; 377 | 378 | EEPROM.write(5, iMemPos); 379 | 380 | Serial.print("\n"); 381 | Serial.print("Importing done."); 382 | Serial.print("\n"); 383 | } 384 | -------------------------------------------------------------------------------- /BM20avr/BM20avr.ino: -------------------------------------------------------------------------------- 1 | #include "IS2020.h" 2 | #include "MMI.h" 3 | #include "Music.h" 4 | #include "commands.h" 5 | //#include "events.h" 6 | #define DEBUG 1 7 | 8 | uint8_t verbose = 0, play = 0; 9 | 10 | IS2020 BT(10, 11); // RX, TX 11 | 12 | uint8_t selectedDevID = 0x00; 13 | 14 | void setup() { 15 | pinMode(12, OUTPUT); 16 | digitalWrite(12, LOW); 17 | 18 | pinMode(2, INPUT); 19 | // Open serial communications and wait for port to openM: 20 | Serial1.begin(57600); 21 | 22 | Serial1.println("starting up .."); 23 | BT.init(115200); 24 | 25 | // delay(500); 26 | // Serial1.println("Read_Linked_Device_Information 0"); 27 | // BT.Read_Linked_Device_Information(0, CRLDI_query_device_name); 28 | // delay(500); 29 | // Serial1.println("Read_Linked_Device_Information 1"); 30 | // BT.Read_Linked_Device_Information(1, CRLDI_query_device_name); 31 | // delay(500); 32 | // Serial1.println("Read_Paired_Device_Record"); 33 | // BT.Read_Paired_Device_Record(); 34 | } 35 | 36 | void loop() { // run over and over 37 | if (Serial1.available() > 0) 38 | { 39 | 40 | // read the incoming byte: 41 | switch (Serial1.read()) 42 | { 43 | case 'd': 44 | //read pair device record 45 | BT.Read_Paired_Device_Record (); 46 | break; 47 | case '=': 48 | // NEXT SONG 49 | BT.MMI_Action(0x00, next_song); 50 | break; 51 | case ']': 52 | // NEXT CD 53 | 54 | break; 55 | case '[': 56 | // PREVIOUS CD 57 | 58 | break; 59 | case '-': 60 | // PREVIOUS SONG 61 | BT.MMI_Action(0x00, previous_song); 62 | break; 63 | case 'p': 64 | // PLAY/PAUSE 65 | play = !play; 66 | if (play) { 67 | BT.Music_Control(0x00, PAUSE); 68 | } 69 | else 70 | { 71 | BT.Music_Control(0x00, PLAY); 72 | } 73 | break; 74 | // seek forward f 75 | // seek rewind r 76 | // scan mode s 77 | // shuffle mode h 78 | case 'f': 79 | // seek frward 80 | BT.Music_Control(0x00, PLAY); 81 | break; 82 | case 'r': 83 | // seek rewind 84 | 85 | break; 86 | case 's': 87 | Serial1.println("calling"); 88 | // make call 1234567891234567892 89 | BT.MakeCall(0x00, "1234567891234567892"); 90 | break; 91 | case 'l': 92 | // list 93 | BT.MMI_Action(0x00, query_call_list_info); 94 | BT.MMI_Action(0x00, triger_to_query_call_list_info); 95 | break; 96 | case 'v': //verbose 97 | verbose = !verbose; 98 | break; 99 | case 'h': //help 100 | Serial1.println("next track button ="); 101 | Serial1.println("previous track button -"); 102 | Serial1.println("next CD ]"); 103 | Serial1.println("previous CD ["); 104 | Serial1.println("play/stop p"); 105 | Serial1.println("seek forward f"); 106 | Serial1.println("seek rewind r"); 107 | Serial1.println("call 1234567891234567891 s"); 108 | Serial1.println("shuffle mode l"); 109 | Serial1.println("help h"); 110 | break; 111 | case 'i': //info 112 | { 113 | 114 | Serial1.print("Battery level MAX dev0: "); Serial1.print(BT.maxBatteryLevel[0]); Serial1.print(" dev1: "); Serial1.println(BT.maxBatteryLevel[1]); 115 | 116 | Serial1.print("Battery level CURRENT dev0: "); Serial1.print(BT.currentBatteryLevel[0]); Serial1.print(" dev1: "); Serial1.println(BT.currentBatteryLevel[1]); 117 | Serial1.println(); 118 | Serial1.println(); 119 | for (uint8_t i = 0; i < DEVICENAME_LENGHT_SUPPORT; i++) { 120 | if (BT.deviceName[0][i] != 0x00) 121 | Serial1.write(BT.deviceName[0][i]); 122 | } 123 | Serial1.println(" info:"); 124 | if (BT.deviceInBandRingtone[0])Serial1.print("Has in Band Rington."); 125 | if (BT.deviceIsiAP[0]) { 126 | Serial1.println("- iAP device"); 127 | } else { 128 | Serial1.println("- SPP device"); 129 | } 130 | if (BT.deviceSupportAVRCPA13[0]) 131 | Serial1.println("- AVRCP 1.3 supported"); //reply if remote device support AVRCP v1.3 132 | if (BT.deviceHfAndA2dpGain[0] != 0x00 ) { 133 | Serial1.print("A2DP Gain: "); 134 | Serial1.println(BT.deviceHfAndA2dpGain[0] << 4); 135 | Serial1.print("HF Gain: "); 136 | Serial1.println(BT.deviceHfAndA2dpGain[0] & 0x0F); 137 | } 138 | if ( BT.deviceLineInGain[0] != 0x00 ) { 139 | Serial1.print("Line in Gain: "); 140 | Serial1.println(BT.deviceLineInGain[0]); 141 | } 142 | 143 | for (uint8_t i = 0; i < DEVICENAME_LENGHT_SUPPORT; i++) { 144 | if (BT.deviceName[1][i] != 0x00) 145 | Serial1.write(BT.deviceName[1][i]); 146 | } 147 | Serial1.println(" info:"); 148 | if (BT.deviceInBandRingtone[1])Serial1.print("Has in Band Rington."); 149 | if (BT.deviceIsiAP[1]) { 150 | Serial1.println("- iAP device"); 151 | } else { 152 | Serial1.print("- SPP device"); 153 | } 154 | if (BT.deviceSupportAVRCPA13[1]) 155 | Serial1.println("- AVRCP 1.3 supported"); //reply if remote device support AVRCP v1.3 156 | if ( BT.deviceHfAndA2dpGain[1] != 0x00 ) { 157 | Serial1.print("A2DP Gain: "); 158 | Serial1.println(BT.deviceHfAndA2dpGain[1] << 4); 159 | Serial1.print("HF Gain: "); 160 | Serial1.println(BT.deviceHfAndA2dpGain[1] & 0x0F); 161 | } 162 | if ( BT.deviceLineInGain[1] != 0x00 ) { 163 | Serial1.print("Line in Gain: "); 164 | Serial1.println(BT.deviceLineInGain[1]); 165 | } 166 | 167 | if (DEBUG) { 168 | /* 169 | Event Format: Event Event Code Event Parameters 170 | Read_BTM_Version_Reply 0x18 type, version 171 | 172 | Description: 173 | 174 | Event Parameters: type SIZE: 1 BYTE 175 | Value Parameter Description 176 | 0x00 uart version 177 | 0x01 BTM FW version 178 | 179 | version SIZE: 2 Octets 180 | Value Parameter Description 181 | 0xXXYY 182 | 1st byte bit[7:5]: flash version 183 | 1st byte bit[4:0]: rom version 184 | 2nd byte bit[7:4] : flash sub version 185 | 2nd byte bit[3:0] : flash control version 186 | for example 00 07 means version 0.07 187 | 188 | */ 189 | Serial1.println(); 190 | Serial1.println(" UART version: "); 191 | Serial1.print(" flash version: "); Serial1.println((uint8_t)(BT.BTMUartVersion >> 13), HEX); 192 | Serial1.print(" rom version: "); Serial1.println((uint8_t)((BT.BTMUartVersion >> 8) & 0x1F), HEX); 193 | Serial1.print(" flash sub version: "); Serial1.println(((uint8_t)(BT.BTMUartVersion >> 4) & 0x0F), HEX); 194 | Serial1.print("flash control version: "); Serial1.println((uint8_t)(BT.BTMUartVersion & 0x0F), HEX); 195 | Serial1.println(); 196 | Serial1.println(" BT FW version: "); 197 | Serial1.print(" flash version: "); Serial1.println((uint8_t)(BT.BTMFWVersion >> 13), HEX); 198 | Serial1.print(" rom version: "); Serial1.println((uint8_t)((BT.BTMFWVersion >> 8) & 0x1F), HEX); 199 | Serial1.print(" flash sub version: "); Serial1.println(((uint8_t)(BT.BTMFWVersion >> 4) & 0x0F), HEX); 200 | Serial1.print("flash control version: "); Serial1.println((uint8_t)(BT.BTMFWVersion & 0x0F), HEX); 201 | 202 | } 203 | 204 | } 205 | break; 206 | } 207 | 208 | } 209 | BT.getNextEventFromBT(); 210 | if (BT.BTMstatusChanged) { 211 | BT.BTMstatusChanged = 0; 212 | 213 | if (BT.deviceName[0][0] == 0x00) 214 | BT.Read_Linked_Device_Information(0, CRLDI_query_device_name); 215 | delay(500); 216 | if (BT.deviceName[1][0] == 0x00) 217 | BT.Read_Linked_Device_Information(1, CRLDI_query_device_name); 218 | // set to 1 in EVT_BTM_Status, when this event happen main program shoud read array BTMStatus[] 219 | Serial1.print("BTM status: dev0: "); Serial1.print(BT.BTMStatus[0], HEX); Serial1.print(" dev1: "); Serial1.println(BT.BTMStatus[1], HEX); 220 | } 221 | 222 | if (BT.callStatusChanged) { 223 | BT.callStatusChanged = 0; 224 | ;//set to 1 in case we are making/receiving call then check callStatus[] 225 | Serial1.print("Call status: dev0: "); Serial1.print(BT.callStatus[0], HEX); Serial1.print(" dev1: "); Serial1.println(BT.callStatus[1], HEX); 226 | } 227 | 228 | if (BT.SMSstatus[0]) { 229 | Serial1.print("Device "); 230 | Serial1.print(BT.SMSstatus[0]); 231 | Serial1.println(" has unreaded sms"); 232 | } 233 | 234 | if (BT.SMSstatus[1]) { 235 | Serial1.print("Device "); 236 | Serial1.print(BT.SMSstatus[1]); 237 | Serial1.println(" has unreaded sms"); 238 | } 239 | 240 | 241 | } 242 | -------------------------------------------------------------------------------- /BM20avr/IS2020.h: -------------------------------------------------------------------------------- 1 | #ifndef ISSC2020_h 2 | #define ISSC2020_h 3 | 4 | #include 5 | #include 6 | //#include 7 | #include "MMI.h" 8 | #include "Music.h" 9 | #include "commands.h" 10 | #include "events.h" 11 | 12 | #define STARTBYTE 0xAA 13 | 14 | #define DUMMYBYTE 0x00 15 | #define DEBUG 1 16 | #define DEVICENAME_LENGHT_SUPPORT 10 17 | 18 | 19 | //class SoftwareSeriM 20 | 21 | class IS2020 22 | { 23 | public: 24 | IS2020(uint8_t RX, uint8_t TX){};//: is2020Serial(RX, TX) {} //todo MFB and P0 port 25 | ~IS2020(); 26 | 27 | void init(uint32_t baudrate); 28 | uint8_t MakeCall(uint8_t deviceId, char phoneNumber[19]); //return event from BT will be handled elseware??? event call status 29 | uint8_t Make_Extension_Call(uint8_t deviceId, char phoneNumber[10]); ; 30 | void MMI_Action (uint8_t deviceId, uint8_t action); 31 | void Event_Mask_Setting (); 32 | void Music_Control (uint8_t deviceId, uint8_t action); 33 | void Change_Device_Name (char bt_name[32]); 34 | void Change_PIN_Code (char pin[4]); 35 | void BTM_Parameter_Setting (uint8_t parameter_value); 36 | void Read_BTM_Version (uint8_t type); 37 | void Get_PB_By_AT_Cmd (uint8_t deviceId); 38 | void Vendor_AT_Command (uint8_t deviceId, char cmd_payload[32]); 39 | void AVC_Specific_Cmd (uint8_t deviceId, uint8_t avc_cmd_payload[]); 40 | void AVC_Group_Navigation (uint8_t deviceId,uint8_t navigation_type); 41 | void Read_Link_Status (); 42 | void Read_Paired_Device_Record (); 43 | void Read_Local_BD_Address (); 44 | void Read_Local_Device_Name (); 45 | void Set_Access_PB_Method (uint8_t APBM); 46 | void Send_SPP_iAP_Data (uint8_t deviceId, uint8_t type, uint16_t total_length, uint16_t payload_length, uint8_t payload[]); 47 | void BTM_Utility_Function (uint8_t utility_function_type,uint8_t parameter); 48 | void Event_ACK (uint8_t cmd); 49 | void Additional_Profiles_Link_Setup(uint8_t deviceId, uint8_t linked_profile); 50 | void Read_Linked_Device_Information(uint8_t deviceId, uint8_t query); 51 | void Profiles_Link_Back (); 52 | void Disconnect (); 53 | void MCU_Status_Indication (); 54 | void User_Confirm_SPP_Req_Reply (); 55 | void Set_HF_Gain_Level (); 56 | void EQ_Mode_Setting (); 57 | void DSP_NR_CTRL (); 58 | void GPIO_Control (); 59 | void MCU_UART_Rx_Buffer_Size (); 60 | void Voice_Prompt_Cmd (); 61 | void MAP_REQUEST (); 62 | void Security_Bonding_Req (); 63 | void Set_Overall_Gain (); 64 | int SerialAvailable(); 65 | int SerialRead(); 66 | int getNextEventFromBT(); 67 | uint8_t BTMstatusChanged = 0; // set to 1 in EVT_BTM_Status, when this event happen main program shoud read array BTMStatus[] 68 | uint8_t callStatusChanged = 0; //set to 1 in case we are making/receiving call then check callStatus[] 69 | uint8_t BTMStatus[2] = {0, 0}; //state, link_info 70 | uint8_t callStatus[2] = {0, 0}; //data_base_index, call_status 71 | uint8_t callerId[2][32]; 72 | uint8_t SMSstatus[2] = {0, 0}; //[0] - link 0 status, [1] link 1 status 73 | uint8_t missedCallStatus[2] = {0, 0}; 74 | uint8_t maxBatteryLevel[2] = {0, 0}; 75 | uint8_t currentBatteryLevel[2] = {0, 0}; 76 | uint8_t roamingStatus[2] = {0, 0}; 77 | uint8_t maxSignalLevel[2] = {0, 0}; 78 | uint8_t currentSignalLevel[2] = {0, 0}; 79 | uint8_t serviceStatus[2] = {0, 0}; 80 | uint8_t BTMBatteryStatus[2] = {0, 0}; 81 | uint8_t BTMChargingStatus = 0; 82 | uint8_t HFGainLevel[2] = {0, 0}; // this can be only 0x0F max, so we can bitbang device zero and one to one byte if we got to low mem state ... 83 | uint8_t EQMode = 0; 84 | uint8_t PBAPAccessFinish = 0; 85 | uint8_t deviceName[2][DEVICENAME_LENGHT_SUPPORT];//= {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; 86 | uint8_t deviceInBandRingtone[2] = {0, 0}; //remake this for some bit masked variable .... this is just 0 or 1 for each device .. 87 | uint8_t deviceIsiAP[2] = {0, 0}; 88 | uint8_t deviceSupportAVRCPA13[2] = {0, 0} ; //reply if remote device support AVRCP v1.3 89 | uint8_t deviceHfAndA2dpGain[2] = {0, 0}; 90 | uint8_t deviceLineInGain[2] = {0, 0}; 91 | int BTMUartVersion = 0; 92 | int BTMFWVersion = 0; 93 | uint8_t LinkStatus[7] = {0, 0, 0, 0, 0, 0, 0}; 94 | uint8_t btAddress[7][6]; 95 | 96 | private: 97 | //SoftwareSerial is2020Serial; 98 | 99 | void SendPacketArrayInt(uint16_t packetSize, uint8_t cmd, uint8_t deviceId, uint8_t data[]); 100 | void SendPacketInt(uint8_t cmd, uint8_t data); 101 | void SendPacketArrayChar(uint16_t packetSize, uint8_t cmd, uint8_t deviceId, char data[]); 102 | uint8_t checkCkeckSum(int size, uint8_t data[]); 103 | void DBG(String text); 104 | 105 | }; 106 | 107 | 108 | #endif 109 | -------------------------------------------------------------------------------- /BM20avr/MMI.h: -------------------------------------------------------------------------------- 1 | #define add_remove_SCO_link 0x01 2 | #define force_end_active_call 0x02 3 | #define accept_incoming_call 0x04 4 | #define reject_incoming_call 0x05 5 | #define end_call_transfer_to_headset 0x06 //1. End call if SCO exist. OR 2. Voice transfer to headset if SCO not exist." 6 | #define togle_mic_mute 0x07 //1. Mute microphone if microphone is not mute OR 2. Active microphone if microphone is mute" 7 | #define mute_mic 0x08 //Mute microphone 8 | #define unmute_mic 0x09 //Active microphone 9 | #define voice_dial 0x0A 10 | #define cancel_voice_dial 0x0Bl 11 | #define last_number_redial 0x0C 12 | #define togle_active_hold_call 0x0D //Set the active call on hold and active the hold call 13 | #define voice_transfer 0x0E 14 | #define query_call_list_info 0x0F //Query call list information(CLCC) 15 | #define thee_way_call 0x10 16 | #define release_waiting_or_hold_call 0x11 //release the waiting call or on hold call 17 | #define end_active_call_accepet_waiting_or_held_call 0x12 //accept the waiting call or active the on hold call and release the active call 18 | #define initiate_HF_connection 0x16 19 | #define disconnect_HF_link 0x17 //disconnect HF link 20 | #define increase_microphone_gain 0x24 21 | #define decrease_microphone_gain 0x25 22 | #define switch_primary_seconday_HF 0x26 //switch primary HF device and secondary HF device role 23 | #define increase_speaker_gain 0x30 24 | #define decrease_speaker_gain 0x31 25 | #define next_song 0x34 26 | #define previous_song 0x35 27 | #define disconnect_A2DP_link 0x3B 28 | #define next_audio_efect 0x3C 29 | #define previous_audio_efect 0x3D 30 | #define enter_pairing_mode 0x50 //enter pairing mode (from power off state) 31 | #define power_on_button_press 0x51 //power on button press 32 | #define power_on_button_release 0x52 //power on button release 33 | #define eeprom_to_defaults 0x56 //Reset some eeprom setting to default setting 34 | #define enter_pairing_mode_fast 0x5D //fast enter pairing mode (from non-off mode) 35 | #define power_off 0x5E //switch power off: to execute the power_off process directly, actually, the combine command set, power off button press and release, could be replace by this command. 36 | #define toggle_buzzer 0x60 //Enable buzzer if buzzer is OFF Disable buzzer if buzzer is ON 37 | #define disable_buzzer 0x61 38 | #define toggle_buzzer2 0x62 //"Enable buzzer Disable buzzer if buzzer is ON" 39 | #define change_tone 0x63 //Change tone set (SPK module support two sets of tone) 40 | #define battery_status 0x6A //Indicate battery status 41 | #define exit_pairing_mode 0x6B //Exit pairing mode 42 | #define link_past_device 0x6C //link last device 43 | #define disconnect_all_link 0x6D //disconnect all link 44 | #define triger_to_query_call_list_info 0x0f //trigger SPK Module to query call list information 45 | 46 | /* 47 | 48 | Ex: 49 | [+CLCC:,,,,[,,[,]][+CLCC:,,,,[,,[,]][...]]] 50 | 51 | idx : Call identification number 52 | dir : 53 | 0:Mobile originated (MO) call 54 | 1:Mobile originated (MT) call 55 | state: State of the call 56 | 0:ACTIVE 57 | 1:HELD 58 | 2: Dialing (MO) 59 | 3: Alerting (MO) 60 | 4: Incoming (MT) 61 | 5: Waiting (MT) 62 | mode: 63 | 0: Voice 64 | 1: Data 65 | 2: Fax 66 | 3: Voice followed by data, voice mode 67 | 4: Alternating voice/data, voice mode 68 | 5: Alternating voice/fax, voice mode 69 | 6: Voice followed by data, data mode 70 | 7: Alternating voice/data, data mode 71 | 8: Alternating voice/fax, fax mode 72 | 9: Unknown 73 | mpty: 74 | 0:Call is not one of multiparty (conference) call parties 75 | 1:Call is one of multiparty (conference) call parties 76 | */ 77 | -------------------------------------------------------------------------------- /BM20avr/Music.h: -------------------------------------------------------------------------------- 1 | #define STOP_FFW_RWD 0x00 // Stop fast forward or rewind 2 | #define FFW 0x01 //fast forward 3 | #define REPFFW 0x02 //fast forward with repeat send fast forward command every 800ms 4 | #define RWD 0x03 //rewind 5 | #define REPRWD 0x04 //rewind with repeat send rewind command every 800ms 6 | #define PLAY 0x05 //PLAY command 7 | #define PAUSE 0x06 //PAUSE command 8 | #define TOGLE_PLAY_PAUSE0x07 //PLAY PAUSE toggle 9 | #define STOP 0x08 //STOP command 10 | 11 | #define CRLDI_query_device_name 0x00 12 | #define CRLDI_query_in_band_ringtone_status 0x01 13 | #define CRLDI_query_if_remote_device_is_iAP_device 0x02 14 | #define CRLDI_query_if_remote_device_support_AVRCP_v13 0x03 15 | #define CRLDI_query_HF_A2DP_gain 0x04 16 | #define CRLDI_query_Line_In_gain 0x05 17 | 18 | -------------------------------------------------------------------------------- /BM20avr/commands.h: -------------------------------------------------------------------------------- 1 | #define CMD_Make_Call 0x00 2 | #define CMD_Make_Extension_Call 0x01 3 | #define CMD_MMI_Action 0x02 4 | #define CMD_Event_Mask_Setting 0x03 5 | #define CMD_Music_Control 0x04 6 | #define CMD_Change_Device_Name 0x05 7 | #define CMD_Change_PIN_Code 0x06 8 | #define CMD_BTM_Parameter_Setting 0x07 9 | #define CMD_Read_BTM_Version 0x08 10 | #define CMD_Get_PB_By_AT_Cmd 0x09 11 | #define CMD_Vendor_AT_Command 0x0A 12 | #define CMD_AVC_Specific_Cmd 0x0B 13 | #define CMD_AVC_Group_Navigation 0x0C 14 | #define CMD_Read_Link_Status 0x0D 15 | #define CMD_Read_Paired_Device_Record 0x0E 16 | #define CMD_Read_Local_BD_Address 0x0F 17 | #define CMD_Read_Local_Device_Name 0x10 18 | #define CMD_Set_Access_PB_Method 0x11 19 | #define CMD_Send_SPP_iAP_Data 0x12 20 | #define CMD_BTM_Utility_Function 0x13 21 | #define CMD_Event_ACK 0x14 22 | #define CMD_Additional_Profiles_Link_Setup 0x15 23 | #define CMD_Read_Linked_Device_Information 0x16 24 | #define CRLDI_query_device_name 0x00 25 | #define CRLDI_query_in-band_ringtone_status 0x01 26 | #define CRLDI_query_if_remote_device_is_iAP_device 0x02 27 | #define CRLDI_query_if_remote_device_support_AVRCP_v1.3 0x03 28 | #define CRLDI_query_HF_A2DP_gain 0x04 29 | #define CRLDI_query_Line_In_gain 0x05 30 | #define CMD_Profiles_Link_Back 0x17 31 | #define CMD_Disconnect 0x18 32 | #define CMD_MCU_Status_Indication 0x19 33 | #define CMD_User_Confirm_SPP_Req_Reply 0x1A 34 | #define CMD_Set_HF_Gain_Level 0x1B 35 | #define CMD_EQ_Mode_Setting 0x1C 36 | #define CMD_DSP_NR_CTRL 0x1D 37 | #define CMD_GPIO_Control 0x1E 38 | #define CMD_MCU_UART_Rx_Buffer_Size 0x1F 39 | #define CMD_Voice_Prompt_Cmd 0x20 40 | #define CMD_MAP_REQUEST 0x21 41 | #define CMD_Security_Bonding_Req 0x22 42 | #define CMD_Set_Overall_Gain 0x23 43 | -------------------------------------------------------------------------------- /BM20avr/events.h: -------------------------------------------------------------------------------- 1 | #define EVT_Command_ACK 0x00 2 | #define EVT_BTM_Status 0x01 3 | #define EVT_Call_Status 0x02 4 | #define EVT_Caller_ID 0x03 5 | #define EVT_SMS_Received_Indication 0x04 6 | #define EVT_Missed_Call_Indication 0x05 7 | #define EVT_Phone_Max_Battery_Level 0x06 8 | #define EVT_Phone_Current_Battery_Level 0x07 9 | #define EVT_Roaming_Status 0x08 10 | #define EVT_Phone_Max_Signal_Strength_Level 0x09 11 | #define EVT_Phone_Current_Signal_Strength_Level 0x0A 12 | #define EVT_Phone_Service_Status 0x0B 13 | #define EVT_BTM_Battery_Status 0x0C 14 | #define EVT_BTM_Charging_Status 0x0D 15 | #define EVT_Reset_To_Default 0x0E 16 | #define EVT_Report_HF_Gain_Level 0x0F 17 | #define EVT_EQ_Mode_Indication 0x10 18 | #define EVT_PBAP_Missed_Call_History 0x11 19 | #define EVT_PBAP_Received_Call_History 0x12 20 | #define EVT_PBAP_Dialed_Call_History 0x13 21 | #define EVT_PBAP_Combine_Call_History 0x14 22 | #define EVT_Phonebook_Contacts 0x15 23 | #define EVT_PBAP_Access_Finish 0x16 24 | #define EVT_Read_Linked_Device_Information_Reply 0x17 25 | #define EVT_Read_BTM_Version_Reply 0x18 26 | #define EVT_Call_List_Report 0x19 27 | #define EVT_AVC_Specific_Rsp 0x1A 28 | #define EVT_BTM_Utility_Req 0x1B 29 | #define EVT_Vendor_AT_Cmd_Reply 0x1C 30 | #define EVT_Report_Vendor_AT_Event 0x1D 31 | #define EVT_Read_Link_Status_Reply 0x1E 32 | #define EVT_Read_Paired_Device_Record_Reply 0x1F 33 | #define EVT_Read_Local_BD_Address_Reply 0x20 34 | #define EVT_Read_Local_Device_Name_Reply 0x21 35 | #define EVT_Report_SPP_iAP_Data 0x22 36 | #define EVT_Report_Link_Back_Status 0x23 37 | #define EVT_Ringtone_Finish_Indicate 0x24 38 | #define EVT_User_Confrim_SSP_Req 0x25 39 | #define EVT_Report_AVRCP_Vol_Ctrl 0x26 40 | #define EVT_Report_Input_Signal_Level 0x27 41 | #define EVT_Report_iAP_Info 0x28 42 | #define EVT_REPORT_AVRCP_ABS_VOL_CTRL 0x29 43 | #define EVT_Report_Voice_Prompt_Status 0x2A 44 | #define EVT_Report_MAP_Data 0x2B 45 | #define EVT_Security_Bonding_Res 0x2C 46 | #define EVT_Report_Type_Codec 0x2D 47 | -------------------------------------------------------------------------------- /K02_serial_example/K02_serial_example.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * K02 exmaple 3 | * module has 5modes: 4 | * 5 | * mode1 R19 not instaled: module wil send pulse on echo line after at least 10us pulse on trigger line (tested, works with external pulldown - 4k7) 6 | * 7 | * mode2 R19 = 300k: module will send pulse on echo line after at least 10ms pulse on trigger line (tested, works with external pulldown - 4k7) 8 | * 9 | * mode3 R19 = 120k(100k works): module will send serial data at 9600 each 100ms 10 | * data format: 11 | * 0xFF 12 | * upper 8bit 13 | * lower 8bit 14 | * check sum = ((upper+lower)&0xff) 15 | * 16 | * mode3 R19 = 47k: module will send serial data at 9600 after receivind any data on RX line 17 | * data format: 18 | * 0xFF 19 | * upper 8bit 20 | * lower 8bit 21 | * check sum = ((upper+lower)&0xff) 22 | * 23 | * mode5 R19 = 0: module will send continuesly asci data: 24 | * Gap=1234mm 25 | */ 26 | 27 | #include 28 | 29 | SoftwareSerial K02(6, 7); // RX, TX 30 | 31 | void setup() 32 | { 33 | Serial.begin(115200); 34 | K02.begin(9600); 35 | 36 | } 37 | 38 | void loop() 39 | { 40 | delay(100); 41 | //mySerial.write(0xFF); //for mode 4 42 | while(K02.available()) 43 | { 44 | if (K02.read() == 0xFF ) { //start 45 | while(K02.available()<3){};//wait for all data to be buffered 46 | uint8_t upper_data = K02.read(); 47 | uint8_t lower_data = K02.read(); 48 | uint8_t sum = K02.read(); 49 | if (((upper_data + lower_data) & 0xff) == sum) { 50 | Serial.print(F("distance: ")); 51 | uint16_t distance = (upper_data << 8) | (lower_data & 0xff); 52 | Serial.print(distance / 10); 53 | Serial.println(" cm"); 54 | } 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Alpine 2 | ==== 3 | 4 | - Emulating alpine car stereo/radio remote control 5 | 6 | Tripling 7 | ===== 8 | 9 | - Smart car sign light, status: untested 10 | 11 | VWCDCEMU 12 | ======= 13 | 14 | - VAG CDC Emulator with Arduinos (atmegax8,attiny85) 15 | moved to https://github.com/tomaskovacik/vwcdavr/ 16 | 17 | 18 | -------------------------------------------------------------------------------- /Tripling/confort_blinker_new.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaskovacik/arduino/f05afbf2832779639f7acf65efefe63748cfe9e0/Tripling/confort_blinker_new.fzz -------------------------------------------------------------------------------- /Tripling/tripling_schema.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaskovacik/arduino/f05afbf2832779639f7acf65efefe63748cfe9e0/Tripling/tripling_schema.png -------------------------------------------------------------------------------- /VAG_radio_to_navi_display/VAG_radio_to_navi_display.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * VAG radio message to navigation mode converter 3 | * for STM32(this one is tested only for now) so USE LEVEL SHIFTER! 4 | * if transistor based one is used put pull down resistor 5 | * on enable line with HALF value of pull up on level shifter (check schematic of that shifter) 6 | * 7 | */ 8 | 9 | #include 10 | #include 11 | 12 | //arduino 13 | #define RADIO_CLK 2 14 | #define RADIO_DATA 4 15 | #define RADIO_ENA 3 16 | //stm32 17 | //#define RADIO_CLK PB0 //on EXTI0 18 | //#define RADIO_DATA PA1 //no interrupt attached to this pin only using digitalRead here 19 | //#define RADIO_ENA PB1 //on EXTI1 20 | 21 | // FIS 22 | //arduino 23 | #define FIS_CLK 5 24 | #define FIS_DATA 6 25 | #define FIS_ENA 7 26 | //stm32 27 | //#define FIS_CLK PB3 28 | //#define FIS_DATA PB5 29 | //#define FIS_ENA PA15 30 | 31 | VAGFISWriter fisWriter( FIS_CLK, FIS_DATA, FIS_ENA, 1); 32 | VAGFISReader radio_read(RADIO_CLK, RADIO_DATA, RADIO_ENA); 33 | 34 | long last_fis_refresh = 0; 35 | long last_radio_update = 0; 36 | 37 | char radioBuffer[16]; 38 | 39 | void setup() { 40 | Serial.begin(115200); 41 | radio_read.begin(); 42 | fisWriter.begin(); 43 | fisWriter.initScreen(0x80, 0, 0, 1, 1); 44 | delay(2000); 45 | fisWriter.sendMsg(" RADIO 2 NAVI "); 46 | delay(2000); 47 | fisWriter.sendMsg(" BY KOVO "); 48 | delay(2000); 49 | } 50 | 51 | 52 | void loop() { 53 | if (radio_read.hasNewMsg()) { 54 | //we are using RADIO mode to NAVI mode, so msg from RADIO is probably not NAVI :), no need to check if it is or not 55 | for (uint8_t i = 1; i < radio_read.getSize() - 1; i++) { //1st byte is msg ID, last is checksumm 56 | radioBuffer[i - 1] = radio_read.readData(i); 57 | Serial.write(radioBuffer[i - 1]); 58 | } 59 | Serial.println(); 60 | radio_read.clearNewMsgFlag(); 61 | last_radio_update = millis(); 62 | 63 | } 64 | 65 | if ((millis() - last_fis_refresh) > 100) { 66 | fisWriter.sendMsg(radioBuffer); 67 | last_fis_refresh = millis(); 68 | } 69 | 70 | if ((millis() - last_radio_update) > 3000) { 71 | radio_read.ACK(); 72 | last_radio_update = millis(); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /VWFIS/FIS_protocol_emulator/FIS_protocol_emulator.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * obsolete, check version with lib based on modified lib from https://github.com/arildlangseid/vw_t4_tcu_temp_to_fis/tree/master/vw_t4_tcu_temp_to_fis 3 | * 4 | * https://github.com/tomaskovacik/arduino/tree/master/VWFIS/FIS_protocol_emulator_with_lib 5 | * 6 | * library can be found here: https://github.com/tomaskovacik/VAGFISWriter 7 | * 8 | * 9 | * 10 | * uncoment if you are using NAVI 11 | * 12 | */ 13 | 14 | //#define NAVI 15 | 16 | //data pin 4 17 | //clk pin 3 18 | //ena pin 2 19 | 20 | //stm32 ready? :) 21 | #define FIS_WRITE_CLK 3//PB3 22 | #define FIS_WRITE_DATA 4//PB5 23 | #define FIS_WRITE_ENA 2//PA15 24 | //WRITE TO CLUSTER 25 | 26 | #define FIS_WRITE_PULSEW 50 27 | #define FIS_WRITE_STARTPULSEW 100 28 | #define FIS_WRITE_START 0xF0 //something like address, first byte is always 15 29 | //END WRITE TO CLUSTER 30 | 31 | //#define BINCODE 000011111011111010101010101110111011011010111100101100111010101010111101101011001011001110110000101010011011111010110100101101101011111010010011 32 | // 000011111011111010101010101110111011011010111100101100111010101010111101101011001011001110110000101010011011111010110100101101101011111010010011 33 | 34 | //int BINCODE[144]={ 35 | //0,0,0,0,1,1,1,1, 36 | //1,0,1,1,1,1,1,0, 37 | //1,0,1,0,1,0,1,0, 38 | //1,0,1,1,1,0,1,1, 39 | //1,0,1,1,0,1,1,0, 40 | //1,0,1,1,1,1,0,0, 41 | //1,0,1,1,0,0,1,1, 42 | //1,0,1,0,1,0,1,0, 43 | //1,0,1,1,1,1,0,1, 44 | //1,0,1,0,1,1,0,0, 45 | //1,0,1,1,0,0,1,1, 46 | //1,0,1,1,0,0,0,0, 47 | //1,0,1,0,1,0,0,1, 48 | //1,0,1,1,1,1,1,0, 49 | //1,0,1,1,0,1,0,0, 50 | //1,0,1,1,0,1,1,0, 51 | //1,0,1,1,1,1,1,0, 52 | //1,0,0,1,0,0,1,1}; 53 | 54 | //WRITE TO CLUSTER 55 | String FIS_WRITE_line1 = "FIS PROTOCOL EMULATOR BY KOVO"; //upper line 8characters are static, more then 8 will rotate 56 | String FIS_WRITE_line2 = "HTTP://KOVO-BLOG.BLOGSPOT.SK"; //lover line 8characters are static, more then 8 will rotate 57 | String FIS_WRITE_sendline1 = " "; 58 | String FIS_WRITE_sendline2 = " "; 59 | long FIS_WRITE_rotary_position_line1 = -8; 60 | long FIS_WRITE_rotary_position_line2 = -8; 61 | char FIS_WRITE_CHAR_FROM_SERIAL; 62 | int FIS_WRITE_line = 1; 63 | long FIS_WRITE_last_refresh = 0; 64 | int FIS_WRITE_nl = 0; 65 | volatile uint8_t FIS_WRITE_ACKSTATE = 0; 66 | //END WRITE TO CLUSTER 67 | 68 | //WRITE TO CLUSTER 69 | void FIS_WRITE_sendTEXT(String FIS_WRITE_line1, String FIS_WRITE_line2); 70 | void FIS_WRITE_sendByte(int Bit); 71 | void FIS_WRITE_startENA(); 72 | void FIS_WRITE_stopENA(); 73 | void FIS_WRITE_ACK(); 74 | //END WRITE TO CLUSTER 75 | 76 | void setup() { 77 | //WRITE TO CLUSTER 78 | pinMode(FIS_WRITE_ENA, OUTPUT); 79 | digitalWrite(FIS_WRITE_ENA, LOW); 80 | pinMode(FIS_WRITE_ENA, INPUT); 81 | digitalWrite(FIS_WRITE_ENA, LOW); //disable pullup https://www.arduino.cc/en/Reference/DigitalWrite 82 | attachInterrupt(digitalPinToInterrupt(FIS_WRITE_ENA), FIS_WRITE_ACK, FALLING); 83 | pinMode(FIS_WRITE_CLK, OUTPUT); 84 | digitalWrite(FIS_WRITE_CLK, HIGH); 85 | pinMode(FIS_WRITE_DATA, OUTPUT); 86 | digitalWrite(FIS_WRITE_DATA, HIGH); 87 | Serial.begin(9600); 88 | //END WRITE TO CLUSTE 500 && (FIS_WRITE_line1_length > 0 || FIS_WRITE_line2_length > 0)) { 132 | if (FIS_WRITE_line1_length > 8) { 133 | FIS_WRITE_sendline1 = " "; 134 | for (int i = 0; i < 8; i++) { 135 | if (FIS_WRITE_rotary_position_line1 + i >= 0 && (FIS_WRITE_rotary_position_line1 + i) < FIS_WRITE_line1_length) { 136 | FIS_WRITE_sendline1[i] = FIS_WRITE_line1[FIS_WRITE_rotary_position_line1 + i]; 137 | } 138 | } 139 | if (FIS_WRITE_rotary_position_line1 < FIS_WRITE_line1_length) { 140 | FIS_WRITE_rotary_position_line1++; 141 | } else { 142 | FIS_WRITE_rotary_position_line1 = -8; 143 | FIS_WRITE_sendline1 = " "; 144 | } 145 | } else { 146 | FIS_WRITE_sendline1 = FIS_WRITE_line1; 147 | } 148 | if (FIS_WRITE_line2_length > 8) { 149 | FIS_WRITE_sendline2 = " "; 150 | for (int i = 0; i < 8; i++) { 151 | if (FIS_WRITE_rotary_position_line2 + i >= 0 && (FIS_WRITE_rotary_position_line2 + i) < FIS_WRITE_line2_length) { 152 | FIS_WRITE_sendline2[i] = FIS_WRITE_line2[FIS_WRITE_rotary_position_line2 + i]; 153 | } 154 | } 155 | if (FIS_WRITE_rotary_position_line2 < FIS_WRITE_line2_length) { 156 | FIS_WRITE_rotary_position_line2++; 157 | } else { 158 | 159 | FIS_WRITE_rotary_position_line2 = -8; 160 | } 161 | } else { 162 | FIS_WRITE_sendline2 = FIS_WRITE_line2; 163 | } 164 | // Serial.println("refresh"); 165 | //FIS_WRITE_sendTEXT(FIS_WRITE_sendline1,FIS_WRITE_sendline2); 166 | FIS_WRITE_last_refresh = millis(); 167 | //end refresh 168 | } 169 | if (FIS_WRITE_ACKSTATE) { 170 | FIS_WRITE_ACKSTATE = 0; 171 | FIS_WRITE_sendTEXT(FIS_WRITE_sendline1, FIS_WRITE_sendline2); 172 | } 173 | //END WRITE TO CLUSTER 174 | } 175 | 176 | //WRITE TO CLUSTER 177 | 178 | void FIS_WRITE_ACK() { 179 | detachInterrupt(digitalPinToInterrupt(FIS_WRITE_ENA)); 180 | FIS_WRITE_ACKSTATE = 1; 181 | }; 182 | 183 | void FIS_WRITE_sendTEXT(String FIS_WRITE_line1, String FIS_WRITE_line2) { 184 | 185 | Serial.println(FIS_WRITE_line1); 186 | Serial.println(FIS_WRITE_line2); 187 | int FIS_WRITE_line1_length = FIS_WRITE_line1.length(); 188 | int FIS_WRITE_line2_length = FIS_WRITE_line2.length(); 189 | if (FIS_WRITE_line1_length <= 8) { 190 | for (int i = 0; i < (8 - FIS_WRITE_line1_length); i++) { 191 | FIS_WRITE_line1 += " "; 192 | } 193 | } 194 | if (FIS_WRITE_line2_length <= 8) { 195 | for (int i = 0; i < (8 - FIS_WRITE_line2_length); i++) { 196 | FIS_WRITE_line2 += " "; 197 | } 198 | } 199 | #ifdef NAVI 200 | uint8_t FIS_WRITE_CRC = 0x81; 201 | #else 202 | uint8_t FIS_WRITE_CRC = (0xFF ^ FIS_WRITE_START); 203 | #endif 204 | 205 | FIS_WRITE_startENA(); 206 | #ifdef NAVI 207 | FIS_WRITE_sendByte(0x81); 208 | FIS_WRITE_sendByte(0x12); 209 | FIS_WRITE_CRC ^= 0x12; 210 | FIS_WRITE_sendByte(0xF0); 211 | FIS_WRITE_CRC ^= 0xF0; 212 | #else 213 | FIS_WRITE_sendByte(0xFF ^ FIS_WRITE_START); 214 | #endif 215 | 216 | for (int i = 0; i <= 7; i++) 217 | { 218 | if (FIS_WRITE_line1[i] > 96) FIS_WRITE_line1[i] = FIS_WRITE_line1[i] - 32; 219 | #ifdef NAVI 220 | FIS_WRITE_sendByte(FIS_WRITE_line1[i]); 221 | FIS_WRITE_CRC ^= FIS_WRITE_line1[i]; 222 | #else 223 | FIS_WRITE_sendByte(0xFF ^ FIS_WRITE_line1[i]); 224 | FIS_WRITE_CRC += FIS_WRITE_line1[i]; 225 | #endif 226 | 227 | } 228 | for (int i = 0; i <= 7; i++) 229 | { 230 | if (FIS_WRITE_line2[i] > 96) FIS_WRITE_line2[i] = FIS_WRITE_line2[i] - 32; 231 | #ifdef NAVI 232 | FIS_WRITE_sendByte(FIS_WRITE_line2[i]); 233 | FIS_WRITE_CRC ^= FIS_WRITE_line2[i]; 234 | #else 235 | FIS_WRITE_sendByte(0xFF ^ FIS_WRITE_line2[i]); 236 | FIS_WRITE_CRC += FIS_WRITE_line2[i]; 237 | #endif 238 | 239 | } 240 | #ifdef NAVI 241 | FIS_WRITE_sendByte(FIS_WRITE_CRC-1 ); 242 | #else 243 | FIS_WRITE_sendByte(FIS_WRITE_CRC % 0x100); 244 | #endif 245 | FIS_WRITE_stopENA(); 246 | 247 | } 248 | 249 | void FIS_WRITE_sendByte(int Byte) { 250 | static int iResult[8]; 251 | for (int i = 0; i <= 7; i++) 252 | { 253 | iResult[i] = Byte % 2; 254 | Byte = Byte / 2; 255 | } 256 | for (int i = 7; i >= 0; i--) { 257 | switch (iResult[i]) { 258 | case 1: digitalWrite(FIS_WRITE_DATA, HIGH); 259 | break; 260 | case 0: digitalWrite(FIS_WRITE_DATA, LOW); 261 | break; 262 | } 263 | digitalWrite(FIS_WRITE_CLK, LOW); 264 | delayMicroseconds(FIS_WRITE_PULSEW); 265 | digitalWrite(FIS_WRITE_CLK, HIGH); 266 | delayMicroseconds(FIS_WRITE_PULSEW); 267 | } 268 | } 269 | 270 | void FIS_WRITE_startENA() { 271 | pinMode(FIS_WRITE_ENA, INPUT); 272 | digitalWrite(FIS_WRITE_ENA, LOW); //disable pullup 273 | while (!digitalRead(FIS_WRITE_ENA)) { 274 | pinMode(FIS_WRITE_ENA, OUTPUT); 275 | digitalWrite(FIS_WRITE_ENA, HIGH); 276 | delayMicroseconds(FIS_WRITE_STARTPULSEW); 277 | digitalWrite(FIS_WRITE_ENA, LOW); 278 | delayMicroseconds(FIS_WRITE_STARTPULSEW); 279 | digitalWrite(FIS_WRITE_ENA, HIGH); 280 | } 281 | } 282 | 283 | void FIS_WRITE_stopENA() { 284 | digitalWrite(FIS_WRITE_ENA, LOW); 285 | pinMode(FIS_WRITE_ENA, INPUT); 286 | digitalWrite(FIS_WRITE_ENA, LOW); //disable pullup 287 | attachInterrupt(digitalPinToInterrupt(FIS_WRITE_ENA), FIS_WRITE_ACK, FALLING); 288 | } 289 | //END WRITE TO CLUSTER 290 | 291 | -------------------------------------------------------------------------------- /VWFIS/FIS_protocol_emulator_with_lib/FIS_protocol_emulator_with_lib.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * based on modified lib from https://github.com/arildlangseid/vw_t4_tcu_temp_to_fis/tree/master/vw_t4_tcu_temp_to_fis 3 | * 4 | * library can be found here: https://github.com/tomaskovacik/VAGFISWriter 5 | * 6 | */ 7 | #include "VAGFISWriter.h" 8 | #include "bitmaps.h" 9 | //#include 10 | 11 | #define MinRefresh 100 12 | 13 | 14 | // FIS 15 | #define FIS_CLK 13 // - Arduino 13 - PB5 16 | #define FIS_DATA 11 // - Arduino 11 - PB3 17 | #define FIS_ENA 8 // - Arduino 8 - PB0 18 | VW2002FISWriter fisWriter( FIS_CLK, FIS_DATA, FIS_ENA ); 19 | static char fisBuffer[10]= {'B','5',' ','F','A','M','I','L','I','A'} ; 20 | int myInit=2; 21 | uint8_t frameBuffer[704]; 22 | 23 | char grg[3]; 24 | 25 | 26 | void lf(){ 27 | 28 | for (uint8_t line=0;line<8;line++){ 29 | uint8_t tmpdata[1] = {left_door[line]}; 30 | fisWriter.GraphicOut(15,line+19,1,tmpdata,1,0); 31 | delay(1); 32 | } 33 | } 34 | 35 | void lr(){ 36 | 37 | for (uint8_t line=0;line<8;line++){ 38 | uint8_t tmpdata[1] = {left_door[line]}; 39 | fisWriter.GraphicOut(15,line+19+8,1,tmpdata,1,0); 40 | delay(1); 41 | } 42 | } 43 | 44 | void rf(){ 45 | 46 | for (uint8_t line=0;line<8;line++){ 47 | uint8_t tmpdata[1] = {right_door[line]}; 48 | fisWriter.GraphicOut(41,line+19,1,tmpdata,1,0); 49 | delay(1); 50 | } 51 | } 52 | void rr(){ 53 | 54 | for (uint8_t line=0;line<8;line++){ 55 | uint8_t tmpdata[1] = {right_door[line]}; 56 | fisWriter.GraphicOut(41,line+19+8,1,tmpdata,1,0); 57 | delay(1); 58 | } 59 | } 60 | 61 | void trunk_avant(){ 62 | fisWriter.GraphicFromArray(25,41,14,4,avant_trunc,1); 63 | } 64 | void trunk_sedan(){ 65 | fisWriter.GraphicFromArray(23,38,18,7,sedan_trunc,1); 66 | } 67 | 68 | void trunk(){ 69 | trunk_sedan(); 70 | } 71 | 72 | void redrawFrameBuffer(){ 73 | //fisWriter.initScreen(0x82,0,0,64,88); 74 | //fisWriter.GraphicFromArray(0,0,64,88,frameBuffer,1); 75 | for(uint8_t line=0; line<88;line=line+4){ 76 | 77 | fisWriter.GraphicOut(0,line,32,frameBuffer,1,line*8); 78 | } 79 | } 80 | 81 | void setup() { 82 | 83 | //for (uint16_t i=0;i<704;i++){ 84 | // frameBuffer[i]=random(255); 85 | //} 86 | 87 | 88 | //for (uint8_t p=0;p<0xFF;p++){ 89 | // grg[p]=p; 90 | //} 91 | 92 | 93 | //Serial.begin(115200); 94 | fisWriter.FIS_init(); 95 | //Serial.println("hello"); 96 | //delay(3000); 97 | fisWriter.initScreen(0x82,0,0,1,1); 98 | delay(1000); 99 | fisWriter.initScreen(0x82,0,0,64,88); 100 | //delay(100); 101 | //fisWriter.GraphicFromArray(0,0,64,88,frameBuffer,1); 102 | //fisWriter.GraphicFromArray(0,0,64,88,frameBuffer,1); 103 | // Timer1.initialize(800000); 104 | // Timer1.attachInterrupt(redrawFrameBuffer); // blinkLED to run every 0.15 seconds 105 | 106 | } 107 | 108 | 109 | void loop() { 110 | // fisWriter.initScreen(0x82,0,0,1,1); 111 | // delay(100); 112 | // while(myInit>0){ 113 | // fisWriter.initScreen(0x82,0,0,0x40,0x58); 114 | // delay(100); 115 | // myInit--; 116 | // } 117 | //fisWriter.GraphicFromArray(0,0,64,88,frameBuffer,1); 118 | 119 | //for (uint16_t i=0;i<704;i++){ 120 | // frameBuffer[i]=random(255); 121 | //} 122 | fisWriter.GraphicFromArray(0,0,64,88,b5f,1); 123 | //fisWriter.initScreen(0x82,0,0,64,88); 124 | //delay(100); 125 | //fisWriter.GraphicFromArray(0,0,64,65,Q,1); 126 | ////delay(1000); 127 | //fisWriter.GraphicFromArray(0,70,64,16,QBSW,1); 128 | //delay(3000); 129 | //fisWriter.initScreen(0x82,0,0,1,1); 130 | //delay(100); 131 | //fisWriter.sendMsg("12345678 TEST "); 132 | //delay(1000); 133 | //fisWriter.initScreen(0x82,0,0x1B,64,0x30); 134 | //fisWriter.GraphicFromArray(22,1,20,46,sedan,2); 135 | //for (uint8_t x=0;x<2;x++){ 136 | //lf(); 137 | //lr(); 138 | //rf(); 139 | //rr(); 140 | //trunk(); 141 | //lf(); 142 | //lr(); 143 | //rf(); 144 | //rr(); 145 | //trunk(); 146 | //} 147 | //fisWriter.initScreen(0x82,0,0,1,1); 148 | //delay(1000); 149 | //fisWriter.sendMsg(" TEST 12345678"); 150 | //delay(MinRefresh); 151 | 152 | 153 | 154 | 155 | //uint8_t b=0; 156 | //for (uint8_t x=1;x<0xFF;x++){ 157 | // fisWriter.initScreen(0x82,0,0,64,88); 158 | //delay(100); 159 | //sprintf(grg, "%d", b); 160 | // fisWriter.sendMsgFS(20,10,0x01,3,grg); 161 | // delay(100); 162 | // fisWriter.sendMsgFS(20,35,0x09,1,(char*) &b); 163 | // b++; 164 | // delay(1000); 165 | //fisWriter.initScreen(0x82,0,0,64,88); 166 | // 167 | // } 168 | 169 | while(true){ 170 | fisWriter.sendKeepAliveMsg(); 171 | delay(1000); 172 | } 173 | } 174 | 175 | -------------------------------------------------------------------------------- /VWFIS/FIS_protocol_emulator_with_lib/bitmaps.h: -------------------------------------------------------------------------------- 1 | uint8_t avant[138] = { 2 | 0x07,0xfe,0x00 3 | ,0x3f,0xff,0xc0 4 | ,0x78,0x01,0xe0 5 | ,0xc8,0x01,0x30 6 | ,0xb4,0x02,0xd0 7 | ,0xc4,0x02,0x30 8 | ,0x84,0x02,0x10 9 | ,0x84,0x02,0x10 10 | ,0x84,0x02,0x10 11 | ,0x84,0x02,0x10 12 | ,0x84,0x02,0x10 13 | ,0x9f,0xff,0x90 14 | ,0xb0,0x00,0xd0 15 | ,0xe0,0x00,0x70 16 | ,0x80,0x00,0x10 17 | ,0x80,0x00,0x10 18 | ,0x80,0x00,0x10 19 | ,0xe0,0x00,0x70 20 | ,0xb7,0xfe,0xd0 21 | ,0x98,0x01,0x90 22 | ,0x90,0x00,0x90 23 | ,0x90,0x00,0x90 24 | ,0x90,0x00,0x90 25 | ,0x90,0x00,0x90 26 | ,0x90,0x00,0x90 27 | ,0xf0,0x00,0xf0 28 | ,0x90,0x00,0x90 29 | ,0x90,0x00,0x90 30 | ,0x90,0x00,0x90 31 | ,0x90,0x00,0x90 32 | ,0x90,0x00,0x90 33 | ,0x90,0x00,0x90 34 | ,0x90,0x00,0x90 35 | ,0xb0,0x00,0xd0 36 | ,0xd0,0x00,0xb0 37 | ,0x90,0x00,0x90 38 | ,0x90,0x00,0x90 39 | ,0x90,0x00,0x90 40 | ,0x90,0x00,0x90 41 | ,0x98,0x01,0x90 42 | ,0x97,0xfe,0x90 43 | ,0xa0,0x00,0x50 44 | ,0xe0,0x00,0x70 45 | ,0x90,0x00,0x90 46 | ,0x7f,0xff,0xe0 47 | ,0x1f,0xff,0x80 48 | 49 | }; 50 | 51 | uint8_t sedan[138] = { 52 | 0x07,0xfe,0x00 53 | ,0x3f,0xff,0xc0 54 | ,0x78,0x01,0xe0 55 | ,0xc8,0x01,0x30 56 | ,0xb4,0x02,0xd0 57 | ,0xc4,0x02,0x30 58 | ,0x84,0x02,0x10 59 | ,0x84,0x02,0x10 60 | ,0x84,0x02,0x10 61 | ,0x84,0x02,0x10 62 | ,0x84,0x02,0x10 63 | ,0x9f,0xff,0x90 64 | ,0xb0,0x00,0xd0 65 | ,0xe0,0x00,0x70 66 | ,0x80,0x00,0x10 67 | ,0x80,0x00,0x10 68 | ,0x80,0x00,0x10 69 | ,0xe0,0x00,0x70 70 | ,0xb7,0xfe,0xd0 71 | ,0x98,0x01,0x90 72 | ,0x90,0x00,0x90 73 | ,0x90,0x00,0x90 74 | ,0x90,0x00,0x90 75 | ,0x90,0x00,0x90 76 | ,0x90,0x00,0x90 77 | ,0xf0,0x00,0xf0 78 | ,0x90,0x00,0x90 79 | ,0x90,0x00,0x90 80 | ,0x90,0x00,0x90 81 | ,0x90,0x00,0x90 82 | ,0x90,0x00,0x90 83 | ,0x90,0x00,0x90 84 | ,0x90,0x00,0x90 85 | ,0xb8,0x01,0xd0 86 | ,0xe7,0xfe,0x70 87 | ,0x80,0x00,0x10 88 | ,0xc0,0x00,0x30 89 | ,0xa0,0x00,0x50 90 | ,0x90,0x00,0x90 91 | ,0x8c,0x03,0x10 92 | ,0x83,0xfc,0x10 93 | ,0xc0,0x00,0x30 94 | ,0x60,0x00,0x60 95 | ,0x50,0x00,0xa0 96 | ,0x3f,0xff,0xc0 97 | ,0x07,0xfe,0x00 98 | }; 99 | 100 | uint8_t left_door[8] = { 101 | 0x02 102 | ,0x07 103 | ,0x0c 104 | ,0x18 105 | ,0x30 106 | ,0x63 107 | ,0xc5 108 | ,0x79 109 | }; 110 | 111 | uint8_t right_door[8] { 112 | 0xc0 113 | ,0xe0 114 | ,0x30 115 | ,0x18 116 | ,0x0c 117 | ,0xc6 118 | ,0xa3 119 | ,0x9e 120 | }; 121 | 122 | uint8_t avant_trunc[8]{ 123 | 0x40,0x08 124 | ,0xff,0xfc 125 | ,0xff,0xfc 126 | ,0x7f,0xf8 127 | }; 128 | 129 | uint8_t sedan_trunc[21]{ 130 | 0x80,0x00,0x40 131 | ,0xc0,0x00,0xc0 132 | ,0xe0,0x01,0xc0 133 | ,0xf8,0x07,0xc0 134 | ,0x7f,0xff,0x80 135 | ,0x3f,0xff,0x00 136 | ,0x1f,0xfe,0x00 137 | }; 138 | 139 | uint8_t b5f[704]{ 140 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 141 | ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 142 | ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 143 | ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 144 | ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 145 | ,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0x80 146 | ,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0x80 147 | ,0x1f,0xff,0xf0,0x00,0x1f,0xff,0xf1,0x80 148 | ,0x1f,0xff,0xc0,0x00,0x07,0xff,0x01,0x80 149 | ,0x1f,0xff,0x80,0x00,0x03,0xf0,0x01,0x80 150 | ,0x1c,0x0f,0x80,0x00,0x01,0xe0,0x01,0x80 151 | ,0x1c,0x0f,0x00,0x00,0x00,0xe0,0x01,0x80 152 | ,0x1c,0x0f,0x00,0x00,0x00,0xe0,0x07,0x80 153 | ,0x1c,0x0e,0x00,0x00,0x00,0xe0,0xc7,0x80 154 | ,0x1c,0x0e,0x00,0x00,0x00,0x60,0x03,0x80 155 | ,0x1c,0x0e,0x00,0x00,0x00,0x60,0x01,0x80 156 | ,0x1c,0x0e,0x00,0x00,0x00,0x60,0x01,0x80 157 | ,0x1c,0x0e,0x00,0x00,0x00,0x78,0x01,0x80 158 | ,0x1c,0x0e,0x00,0x00,0x00,0x7f,0x81,0x80 159 | ,0x1c,0x0e,0x00,0x00,0x00,0x3f,0xff,0x80 160 | ,0x1c,0x0e,0x00,0x00,0x00,0x20,0x03,0x80 161 | ,0x1c,0x0e,0x00,0x00,0x00,0x20,0x01,0x80 162 | ,0x1c,0x0e,0x03,0xff,0xe0,0x20,0x01,0x80 163 | ,0x1c,0x0e,0x07,0xff,0xf0,0x20,0x01,0x80 164 | ,0x1c,0x0e,0x07,0xff,0xf0,0x20,0x01,0x80 165 | ,0x1c,0x0f,0x07,0xff,0xf0,0x3f,0xff,0x80 166 | ,0x1c,0x0f,0x07,0xff,0xe0,0x3f,0xf3,0x80 167 | ,0x1c,0x0f,0x81,0xf0,0x00,0x3f,0xf1,0x80 168 | ,0x1c,0x00,0x18,0xe0,0x00,0x3f,0xf1,0x80 169 | ,0x1f,0xe0,0xd6,0xe0,0x00,0x60,0x01,0x80 170 | ,0x1f,0xfc,0xf8,0xe0,0x00,0x60,0x01,0x80 171 | ,0x1f,0xfe,0x78,0xe0,0x00,0x60,0x01,0x80 172 | ,0x1f,0xff,0x5e,0xe0,0x00,0x60,0x01,0x80 173 | ,0x1d,0xff,0x31,0xe0,0x00,0x60,0x01,0x80 174 | ,0x1c,0xff,0x83,0xe0,0x00,0x7f,0xff,0x80 175 | ,0x1c,0x7f,0xfe,0xe0,0x00,0xff,0xff,0x80 176 | ,0x1c,0x1f,0xff,0xe0,0x00,0xe0,0x03,0x80 177 | ,0x1c,0x00,0xff,0xe0,0x01,0xe0,0x01,0x80 178 | ,0x1c,0x00,0xff,0xe0,0x01,0xe0,0x01,0x80 179 | ,0x1c,0x00,0xff,0xf0,0x03,0xe0,0x01,0x80 180 | ,0x1c,0x00,0x7f,0xf8,0x07,0xe0,0x01,0x80 181 | ,0x1c,0x00,0x77,0xfe,0x0f,0xff,0xff,0x80 182 | ,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0x80 183 | ,0x1f,0xff,0xff,0xff,0xdf,0xe0,0x01,0x80 184 | ,0x1f,0xff,0xff,0xff,0xc3,0xe0,0x01,0x80 185 | ,0x1f,0xe3,0x8f,0x1f,0xe1,0xe0,0x01,0x80 186 | ,0x1f,0xdf,0x86,0x0f,0xe1,0xe0,0x01,0x80 187 | ,0x1f,0x8a,0x66,0x03,0xe0,0xe0,0x03,0x80 188 | ,0x1f,0x07,0x06,0x3f,0xf1,0xe0,0x07,0x80 189 | ,0x1e,0x00,0x00,0x7f,0xff,0xf8,0x01,0x80 190 | ,0x1e,0x00,0x00,0x27,0xff,0xff,0x41,0x80 191 | ,0x1e,0x00,0x03,0x21,0xfc,0x75,0x41,0x80 192 | ,0x1c,0x00,0x00,0xf0,0x78,0x65,0xb3,0x80 193 | ,0x1c,0x00,0x01,0xf0,0x38,0x67,0xff,0x80 194 | ,0x1c,0x00,0x0c,0x58,0x18,0x63,0xc1,0x80 195 | ,0x1c,0x00,0x00,0x48,0x18,0x60,0x31,0x80 196 | ,0x1c,0x00,0x00,0xc0,0x1c,0x61,0x01,0x80 197 | ,0x1c,0x00,0x00,0x00,0x0c,0x61,0x01,0x80 198 | ,0x1c,0x00,0x00,0x00,0x0c,0x7f,0xff,0x80 199 | ,0x1c,0x07,0xc0,0x3f,0x8c,0x7f,0xf1,0x80 200 | ,0x1c,0x07,0xe0,0x3f,0xcc,0x7f,0x01,0x80 201 | ,0x1c,0x0f,0xe0,0x3f,0xcc,0x70,0x01,0x80 202 | ,0x1c,0x0f,0xe0,0x7f,0xec,0x60,0x01,0x80 203 | ,0x1c,0x0f,0xe0,0x7f,0xcc,0x60,0x01,0x80 204 | ,0x1c,0x00,0x00,0x00,0x0c,0x60,0x07,0x80 205 | ,0x1c,0x00,0x00,0x00,0x08,0x60,0xc7,0x80 206 | ,0x1c,0x00,0x00,0x00,0x08,0x60,0x03,0x80 207 | ,0x1c,0x00,0x00,0x00,0x08,0x60,0x01,0x80 208 | ,0x1c,0x00,0x00,0x00,0x0c,0x60,0x01,0x80 209 | ,0x1c,0x00,0x00,0x00,0x04,0x78,0x01,0x80 210 | ,0x1c,0x00,0x00,0x00,0x06,0x7f,0x81,0x80 211 | ,0x1c,0x00,0x00,0x00,0x03,0x62,0x3f,0x80 212 | ,0x1c,0x00,0x00,0x00,0x01,0xe2,0x3f,0x80 213 | ,0x1c,0x00,0x00,0x00,0x00,0xe2,0x3f,0x80 214 | ,0x1c,0x00,0x00,0x00,0x00,0x60,0x03,0x80 215 | ,0x1c,0x00,0x00,0x00,0x00,0x70,0x01,0x80 216 | ,0x1c,0x00,0x00,0x00,0x00,0x78,0x01,0x80 217 | ,0x1c,0x00,0x00,0x00,0x00,0x68,0x01,0x80 218 | ,0x1c,0x00,0x00,0x00,0x00,0x6c,0x01,0x80 219 | ,0x1c,0x00,0x00,0x00,0x00,0x6c,0x03,0x80 220 | ,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0x80 221 | ,0x00,0x00,0x00,0x00,0x00,0x0c,0x00,0x00 222 | ,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00 223 | ,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00 224 | ,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00 225 | ,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00 226 | ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 227 | ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 228 | 229 | }; 230 | 231 | uint8_t Q[520]{ 232 | 0x00,0x00,0x00,0x7f,0xfe,0x00,0x00,0x00 233 | ,0x00,0x00,0x07,0xff,0xff,0xc0,0x00,0x00 234 | ,0x00,0x00,0x3f,0xff,0xff,0xfc,0x00,0x00 235 | ,0x00,0x00,0x7f,0xff,0xff,0xfc,0x00,0x00 236 | ,0x00,0x01,0xff,0xff,0xff,0xff,0x00,0x00 237 | ,0x00,0x07,0xff,0xff,0xff,0xff,0xc0,0x00 238 | ,0x00,0x0f,0xff,0xff,0xff,0xff,0xe0,0x00 239 | ,0x00,0x3f,0xff,0xff,0xff,0xff,0xf0,0x00 240 | ,0x00,0x7f,0xff,0xff,0xff,0xff,0xf8,0x00 241 | ,0x00,0xff,0xff,0xff,0xff,0xff,0xfe,0x00 242 | ,0x01,0xff,0xff,0xff,0xff,0xff,0xfe,0x00 243 | ,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0x00 244 | ,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0x80 245 | ,0x07,0xff,0xff,0xfc,0x3f,0xff,0xff,0xc0 246 | ,0x07,0xff,0xff,0xc0,0x00,0xff,0xff,0xe0 247 | ,0x0f,0xff,0xfe,0x00,0x00,0x3f,0xff,0xf0 248 | ,0x1f,0xff,0xf8,0x00,0x00,0x1f,0xff,0xf0 249 | ,0x1f,0xff,0xf0,0x00,0x00,0x0f,0xff,0xf0 250 | ,0x3f,0xff,0xe0,0x00,0x00,0x07,0xff,0xf8 251 | ,0x3f,0xff,0xc0,0x00,0x00,0x03,0xff,0xf8 252 | ,0x3f,0xff,0x80,0x00,0x00,0x01,0xff,0xfc 253 | ,0x7f,0xff,0x00,0x00,0x00,0x00,0xff,0xfc 254 | ,0x7f,0xff,0x00,0x00,0x00,0x00,0xff,0xfc 255 | ,0x7f,0xfe,0x00,0x00,0x00,0x00,0x7f,0xfe 256 | ,0xff,0xfe,0x00,0x00,0x00,0x00,0x7f,0xfe 257 | ,0xff,0xfe,0x00,0x00,0x00,0x00,0x3f,0xfe 258 | ,0xff,0xfc,0x00,0x00,0x00,0x00,0x3f,0xfe 259 | ,0xff,0xfc,0x00,0x00,0x00,0x00,0x3f,0xff 260 | ,0xff,0xfc,0x00,0x00,0x00,0x00,0x3f,0xff 261 | ,0xff,0xf8,0x00,0x00,0x00,0x00,0x1f,0xff 262 | ,0xff,0xf8,0x00,0x00,0x00,0x00,0x1f,0xff 263 | ,0xff,0xf8,0x00,0x00,0x00,0x00,0x1f,0xff 264 | ,0xff,0xf8,0x00,0x00,0x00,0x00,0x1f,0xff 265 | ,0xff,0xfc,0x00,0x00,0x00,0x00,0x1f,0xff 266 | ,0xff,0xfc,0x00,0x00,0x00,0x00,0x1f,0xff 267 | ,0xff,0xfc,0x00,0x00,0x00,0x00,0x3f,0xff 268 | ,0xff,0xfc,0x00,0x00,0x00,0x00,0x3f,0xfe 269 | ,0xff,0xfe,0x00,0x00,0x00,0x00,0x3f,0xfe 270 | ,0x7f,0xfe,0x00,0x00,0x00,0x00,0x7f,0xfe 271 | ,0x7f,0xff,0x00,0x00,0x00,0x00,0x7f,0xfe 272 | ,0x7f,0xff,0x00,0x00,0x00,0x00,0xff,0xfc 273 | ,0x3f,0xff,0x00,0x00,0x00,0x00,0xff,0xfc 274 | ,0x3f,0xff,0x80,0x00,0x00,0x01,0xff,0xfc 275 | ,0x3f,0xff,0xc0,0x00,0x00,0x03,0xff,0xf8 276 | ,0x1f,0xff,0xe0,0x00,0x00,0x07,0xff,0xf8 277 | ,0x1f,0xff,0xf0,0x00,0x00,0x0f,0xff,0xf8 278 | ,0x0f,0xff,0xf8,0x00,0x00,0x1f,0xff,0xf0 279 | ,0x07,0xff,0xfe,0x00,0x00,0x7f,0xff,0xf0 280 | ,0x07,0xff,0xff,0x80,0x00,0xff,0xff,0xe0 281 | ,0x03,0xff,0xff,0xe0,0x03,0xff,0xff,0xc0 282 | ,0x01,0xff,0xff,0xfe,0x0f,0xff,0xff,0xc0 283 | ,0x00,0xff,0xff,0xff,0xc3,0xff,0xff,0x80 284 | ,0x00,0x7f,0xff,0xff,0xe0,0x7f,0xff,0x00 285 | ,0x00,0x3f,0xff,0xff,0xfe,0x07,0xfe,0x00 286 | ,0x00,0x1f,0xff,0xff,0xff,0xc0,0x7c,0x00 287 | ,0x00,0x07,0xff,0xff,0xff,0xfc,0x00,0x00 288 | ,0x00,0x03,0xff,0xff,0xff,0xff,0xc0,0x00 289 | ,0x00,0x00,0xff,0xff,0xff,0xff,0xfc,0x00 290 | ,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,0x00 291 | ,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xf8 292 | ,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xfe 293 | ,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xfe 294 | ,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xfc 295 | ,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xf0 296 | ,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xe0 297 | }; 298 | 299 | uint8_t QBSW[128]{ 300 | 0x07,0xe0,0x1f,0xc0,0x3e,0x38,0x0c,0x07 301 | ,0x1f,0xf8,0x1f,0xf0,0x7f,0xbc,0x1e,0x0f 302 | ,0x3f,0xfc,0x1f,0xf8,0xff,0x9c,0x1e,0x0e 303 | ,0x7c,0x1e,0x1c,0x3d,0xe1,0x1c,0x3e,0x1e 304 | ,0x78,0x0f,0x1c,0x1d,0xc0,0x1c,0x3e,0x1c 305 | ,0xf0,0x07,0x1c,0x3d,0xe0,0x1c,0x7e,0x3c 306 | ,0xe0,0x07,0x9c,0x78,0xf8,0x1c,0x76,0x38 307 | ,0xe0,0x07,0x9f,0xf0,0xfe,0x1c,0xe7,0x78 308 | ,0xe0,0x07,0x9f,0xf8,0x3f,0x9c,0xe7,0x70 309 | ,0xe0,0x07,0x1c,0x3c,0x07,0x9d,0xc7,0x70 310 | ,0xf0,0x07,0x1c,0x1c,0x03,0xdf,0x87,0xe0 311 | ,0x78,0x0f,0x1c,0x1c,0x01,0xdf,0x87,0xe0 312 | ,0x7c,0x3e,0x1c,0x3c,0x83,0xcf,0x07,0xc0 313 | ,0x3f,0xff,0xdf,0xfd,0xff,0x8f,0x07,0xc0 314 | ,0x0f,0xff,0xdf,0xf9,0xff,0x0e,0x03,0x80 315 | ,0x01,0xff,0x9f,0xc0,0x7e,0x0e,0x03,0x80 316 | }; 317 | 318 | -------------------------------------------------------------------------------- /VWFIS/README.md: -------------------------------------------------------------------------------- 1 | obsolete code here! 2 | 3 | check libraries for reading and writing: 4 | 5 | https://github.com/tomaskovacik/VAGFISReader 6 | https://github.com/tomaskovacik/VAGFISWriter 7 | 8 | 9 | section dedicated to 3wire comunication betwen radio and cluster (FIS) on vw group vehicles in years to 1999 maybe laters (I have 1999 audi), more: http://kovo-blog.blogspot.sk/2013/11/audi-fis-3-line-protocol.html 10 | 11 | - `dumps` contains logic analyzer dumps 12 | - `FIS_protocol_emulator` writes to a real FIS cluster. It reads lines over a 13 | serial port (9600 bps, lines terminated by `\n`) and writes the lines to a 14 | real FIS cluster over 3 line bus. 15 | - `read_cluster` emulates an FIS cluster. It listens on the 3 line bus like 16 | a real FIS cluster would and writes what it receives to a 2x16 character LCD. 17 | 18 | all of this is tested in setup on bench: writing to display: 19 | 20 | https://www.youtube.com/watch?v=8igXlCWadeE 21 | 22 | reading display: 23 | https://www.youtube.com/watch?v=ANw7_7F3OmM 24 | 25 | 26 | -------------------------------------------------------------------------------- /VWFIS/emulated_comunication_with_ack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaskovacik/arduino/f05afbf2832779639f7acf65efefe63748cfe9e0/VWFIS/emulated_comunication_with_ack.png -------------------------------------------------------------------------------- /VWFIS/read_cluster/read_cluster.ino: -------------------------------------------------------------------------------- 1 | // do not forget to put pull down resistor on enable line 2 | // pull up on data/clk line is made usng internal pullup 3 | 4 | 5 | #define FIS_READ_intCLK 1 //interupt on FIS_READ_CLK line 6 | #define FIS_READ_CLK 3 //clk pin 3 - int1 7 | #define FIS_READ_DATA 11 //data pin 11 8 | #define FIS_READ_ENA 2 //enable pin 2 int0 9 | #define FIS_READ_intENA 0 //interupt on FIS_READ_ENA line 10 | 11 | #include 12 | 13 | LiquidCrystal lcd(8, 9, 4, 5, 6, 7); 14 | 15 | volatile uint8_t FIS_READ_adr=0; 16 | volatile uint64_t FIS_READ_msg1=0; 17 | volatile uint64_t FIS_READ_msg2=0; 18 | volatile uint8_t FIS_READ_cksum=0; 19 | volatile uint8_t FIS_READ_msgbit=0; 20 | volatile uint8_t FIS_READ_newmsg1=0; 21 | volatile uint8_t FIS_READ_newmsg2=0; 22 | volatile uint8_t FIS_READ_adrok=0; 23 | volatile uint8_t FIS_READ_cksumok=0; 24 | volatile uint8_t FIS_READ_tmp_cksum=0; 25 | volatile uint8_t FIS_READ_lcd_ack=1; //tell everyone on bus, we are here! 26 | 27 | volatile uint64_t prev_update = 0; 28 | 29 | void FIS_READ_read_data_line(){ //fired on falling edge 30 | if(!FIS_READ_adrok){ 31 | FIS_READ_read_adr(); 32 | } 33 | else if (!FIS_READ_newmsg1){ 34 | FIS_READ_read_msg1(); 35 | } 36 | else if (!FIS_READ_newmsg2){ 37 | FIS_READ_read_msg2(); 38 | } 39 | else if (!FIS_READ_cksumok){ 40 | FIS_READ_read_cksum(); 41 | } 42 | } 43 | 44 | void FIS_READ_read_cksum(){ 45 | if(digitalRead(FIS_READ_DATA)){ 46 | FIS_READ_cksum = (FIS_READ_cksum<<1) | 0x00000001; 47 | FIS_READ_msgbit++; 48 | } 49 | else 50 | { 51 | FIS_READ_cksum = (FIS_READ_cksum<<1); 52 | FIS_READ_msgbit++; 53 | } 54 | if (FIS_READ_msgbit==8) 55 | { 56 | FIS_READ_newmsg1=0; 57 | FIS_READ_newmsg2=0; 58 | FIS_READ_adrok=0; 59 | FIS_READ_tmp_cksum=(0xFF^FIS_READ_adr); 60 | for (int i=56;i>=0;i=i-8){ 61 | FIS_READ_tmp_cksum=FIS_READ_tmp_cksum+(0xFF^((FIS_READ_msg1>>i) & 0xFF)) 62 | +(0xFF^((FIS_READ_msg2>>i) & 0xFF)); 63 | } 64 | if (!FIS_READ_cksumok){//d we display what we reveived last time? 65 | if((FIS_READ_tmp_cksum%256)==FIS_READ_cksum){ 66 | FIS_READ_cksumok=1; 67 | } else { 68 | FIS_READ_msg1 = 0x00000000; 69 | FIS_READ_msg2 = 0x00000000; 70 | FIS_READ_cksumok=0; 71 | } 72 | FIS_READ_msgbit=0; 73 | } 74 | } 75 | 76 | } 77 | 78 | void FIS_READ_read_msg1(){ 79 | if(digitalRead(FIS_READ_DATA)){ 80 | FIS_READ_msg1 = (FIS_READ_msg1<<1) | 0x00000001; 81 | FIS_READ_msgbit++; 82 | } 83 | else 84 | { 85 | FIS_READ_msg1 = (FIS_READ_msg1<<1); 86 | FIS_READ_msgbit++; 87 | } 88 | if (FIS_READ_msgbit==64) 89 | { 90 | FIS_READ_newmsg1=1; 91 | FIS_READ_msgbit=0; 92 | } 93 | } 94 | 95 | void FIS_READ_read_msg2(){ 96 | if(digitalRead(FIS_READ_DATA)){ 97 | FIS_READ_msg2 = (FIS_READ_msg2<<1) | 0x00000001; 98 | FIS_READ_msgbit++; 99 | } 100 | else 101 | { 102 | FIS_READ_msg2 = (FIS_READ_msg2<<1); 103 | FIS_READ_msgbit++; 104 | } 105 | if (FIS_READ_msgbit==64) 106 | { 107 | FIS_READ_newmsg2=1; 108 | FIS_READ_msgbit=0; 109 | } 110 | } 111 | 112 | void FIS_READ_read_adr(){ 113 | if(digitalRead(FIS_READ_DATA)){ 114 | FIS_READ_adr = (FIS_READ_adr<<1) | 0x00000001; 115 | FIS_READ_msgbit++; 116 | } 117 | else 118 | { 119 | FIS_READ_adr = (FIS_READ_adr<<1); 120 | FIS_READ_msgbit++; 121 | } 122 | if (FIS_READ_msgbit==8) 123 | { 124 | FIS_READ_adrok=1; 125 | FIS_READ_msgbit=0; 126 | } 127 | } 128 | 129 | 130 | 131 | void FIS_READ_detect_ena_line_rising(){ 132 | //init all again 133 | FIS_READ_msgbit=0; 134 | FIS_READ_newmsg1=0; 135 | FIS_READ_newmsg2=0; 136 | FIS_READ_adrok=0; 137 | FIS_READ_cksumok=0; 138 | FIS_READ_tmp_cksum=0; 139 | attachInterrupt(FIS_READ_intCLK,FIS_READ_read_data_line,FALLING);//data are valid on falling edge of CLK 140 | attachInterrupt(FIS_READ_intENA,FIS_READ_detect_ena_line_falling,FALLING); //if enable changed to low, data on data line are no more valid 141 | } 142 | 143 | void FIS_READ_detect_ena_line_falling(){ 144 | detachInterrupt(FIS_READ_intCLK);//enable is low, data on data line are no more valid 145 | detachInterrupt(FIS_READ_intENA); 146 | attachInterrupt(FIS_READ_intENA,FIS_READ_detect_ena_line_rising,RISING); 147 | } 148 | 149 | void setup() { 150 | lcd.begin(16,2); 151 | lcd.home(); 152 | lcd.print("FIS cluster"); 153 | lcd.setCursor(0,1); 154 | lcd.print("reader"); 155 | delay (2000); 156 | lcd.clear(); 157 | Serial.begin(9600); 158 | pinMode(FIS_READ_CLK,INPUT_PULLUP); 159 | pinMode(FIS_READ_DATA,INPUT_PULLUP); 160 | pinMode(FIS_READ_ENA,INPUT);//no pull up! this is inactive state low, active is high 161 | digitalWrite(FIS_READ_ENA,LOW);//disable pullup 162 | attachInterrupt(FIS_READ_intENA,FIS_READ_detect_ena_line_rising,RISING); 163 | } 164 | 165 | void loop() { 166 | if(FIS_READ_cksumok){ //whole packet received and checksum is ok 167 | lcd.home(); 168 | Serial.write("\n"); 169 | // lcd.clear(); 170 | for(int i=56;i>=0;i=i-8){ 171 | int c = (0xFF^((FIS_READ_msg1>>i) & 0xFF)); 172 | if (c == 102 ) c=95; 173 | lcd.write(c); 174 | Serial.write(c); 175 | } 176 | lcd.setCursor(0,1); 177 | Serial.write("\n"); 178 | for(int i=56;i>=0;i=i-8){ 179 | int c = (0xFF^((FIS_READ_msg2>>i) & 0xFF)); 180 | if (c == 102 ) c=95; 181 | lcd.write(c); 182 | Serial.write(c); 183 | } 184 | FIS_READ_cksumok=0; 185 | prev_update=millis(); 186 | FIS_READ_lcd_ack=1; 187 | } else { 188 | if ((millis() - prev_update) > 500 ){ //leave text for 1000ms 189 | lcd.clear(); 190 | FIS_READ_lcd_ack=1; 191 | prev_update=millis(); 192 | } 193 | } 194 | if (FIS_READ_lcd_ack){ 195 | detachInterrupt(FIS_READ_intENA); 196 | detachInterrupt(FIS_READ_intCLK); 197 | pinMode(FIS_READ_ENA,INPUT); 198 | digitalWrite(FIS_READ_ENA,LOW);//disable pullup 199 | if (!digitalRead(FIS_READ_ENA)){ 200 | pinMode(FIS_READ_ENA,OUTPUT); 201 | delay(1); 202 | digitalWrite(FIS_READ_ENA,HIGH); 203 | delay(3); 204 | digitalWrite(FIS_READ_ENA,LOW); 205 | FIS_READ_lcd_ack=0; 206 | } 207 | pinMode(FIS_READ_ENA,INPUT); 208 | digitalWrite(FIS_READ_ENA,LOW);//disable pullup 209 | //delay(50); 210 | attachInterrupt(FIS_READ_intENA,FIS_READ_detect_ena_line_rising,RISING); 211 | } 212 | } 213 | 214 | 215 | 216 | -------------------------------------------------------------------------------- /VW_radio_remote_control/README.md: -------------------------------------------------------------------------------- 1 | # VW Radio Remote Control 2 | 3 | ## arduino library 4 | 5 | Repository with arduino library(send support only for now): https://github.com/tomaskovacik/VAGRadioRemote 6 | 7 | 8 | Arduino (1.0 and up) stuff related to Audi radios (probably also for VW, Skoda, Seat) 9 | remote control protocol. This information is for vehicles where the radio 10 | does not use CAN bus. 11 | 12 | - code_finder is sketchup for finding all codes understended by my audi concert/chorus 1 radios 13 | - emulator is sketchup emulating audi MFSW 14 | - dumps of audi steering wheel controls to HU(radio) made by https://github.com/gillham/logic_analyzer 15 | - audi_MFSW_eletric_connection_schematics.pdf is how and where is what connected in car ... 16 | - remote_control_codes_control_unit_to_radio.ods and steering_wheel_to_control_unit.ods analyzis of OLS ouput in opendocument format 17 | 18 | using ebay LCD shield(2x16) with 5 buttons on A0 19 | 20 | output to radio (remote signal `REM`) is on pin 2 21 | 22 | more info: 23 | http://kovo-blog.blogspot.sk/2013/10/remote-control-audi-radio.html 24 | 25 | ## Protocol 26 | 27 | On vehicles where the radio does not use CAN bus, the MFSW (Multifunction 28 | Steering Wheel) controller talks to the radio using only 1 wire, which is 29 | called `REM` (remote). 30 | 31 | `REM` line is 5V logic, idle state is HIGH (5V) 32 | 33 | - start bit: 9ms LOW 4.55ms HIGH 34 | - logic 0: ~600us LOW ~1700us HIGH 35 | - logic 1: ~600us LOW ~600us HIGH 36 | - stop bit: ~600us LOW 37 | 38 | The MFSW controller always sends a packet of 4 bytes to the radio. It 39 | consists of 2 unknown header bytes, followed by a code byte, and finally 40 | a checksum byte: 41 | 42 | 0x41 0xE8 43 | 44 | The checksum is `0xFF - code`. Example: 45 | 46 | 0x41 0xE8 0xD0 0x2F 47 | 48 | Code byte: `0xD0`, Checksum: `0xFF - 0xD0 = 0x2F`. 49 | 50 | ## MFSW 51 | 52 | Using a logic analyzer, these codes were captured from an MFSW without 53 | telephone option: 54 | 55 | | Steering Wheel Button | Code | Complete Packet | 56 | | --------------------- | --------- | --------------------- | 57 | | UP | `0xD0` | `0x41 0xE8 0xD0 0x2F` | 58 | | DOWN | `0x50` | `0x41 0xE8 0x50 0xAF` | 59 | | LEFT | `0x40` | `0x41 0xE8 0x40 0xBF` | 60 | | RIGHT | `0xC0` | `0x41 0xE8 0xC0 0x3F` | 61 | | VOL+ | `0x80` | `0x41 0xE8 0x80 0x7F` | 62 | | VOL- | `0x00` | `0x41 0xE8 0x00 0xFF` | 63 | 64 | ## Audi Concert I Radio 65 | 66 | Using the `code_finder` program above, an Audi Concert I radio responded to 67 | these codes: 68 | 69 | | Code | Function | 70 | | --------- | ------------------------------------------------------------ | 71 | | `0x00` | Volume down | 72 | | `0x01` | mem/cd1 | 73 | | `0x03` | mem/cd3 | 74 | | `0x05` | mem/cd5 | 75 | | `0x07` | search up | 76 | | `0x09` | reg on/off | 77 | | `0x0B` | tp | 78 | | `0x11` | AM | 79 | | `0x15` | AS-STORE | 80 | | `0x17` | FM | 81 | | `0x1D` | search down | 82 | | `0x20` | AM->AM+AS->FM1->FM2->FM1+AS->FM2->AS/in CD mode “RD” | 83 | | `0x22` | AM->AM+AS->FM1->FM2->FM1+AS->FM2->AS/in CD mode “RD” | 84 | | `0x24` | AM->AM+AS->FM1->FM2->FM1+AS->FM2->AS/in CD mode “RD” | 85 | | `0x26` | AM->AM+AS->FM1->FM2->FM1+AS->FM2->AS/in CD mode “RD” | 86 | | `0x29` | TP | 87 | | `0x2B` | search up | 88 | | `0x3C` | seek up | 89 | | `0x40` | LEFT FM1 6-5-4-3-2-1-FM2 6-5-4-3-2-1 | 90 | | `0x42` | LEFT FM1 6-5-4-3-2-1-FM2 6-5-4-3-2-1 | 91 | | `0x44` | LEFT FM1 6-5-4-3-2-1-FM2 6-5-4-3-2-1 | 92 | | `0x46` | LEFT FM1 6-5-4-3-2-1-FM2 6-5-4-3-2-1 | 93 | | `0x50` | Seek down/FR | 94 | | `0x52` | Seek down/FR | 95 | | `0x54` | Seek down/FR | 96 | | `0x56` | Seek down/FR | 97 | | `0x60` | Seek down/FR | 98 | | `0x62` | seek down | 99 | | `0x64` | seek down | 100 | | `0x80` | Volume up | 101 | | `0x81` | Volume up | 102 | | `0x82` | Volume up | 103 | | `0x83` | Volume up | 104 | | `0x84` | Volume up | 105 | | `0x85` | Volume up | 106 | | `0x86` | Volume up | 107 | | `0x89` | -2 Volume down bas/treble down/fade rear/bal left | 108 | | `0x8B` | -4 Volume down bas/treble down/fade rear/bal left | 109 | | `0x8D` | -6 Volume down bas/treble down/fade rear/bal left | 110 | | `0x8F` | -8 Volume down/fade rear/bal left | 111 | | `0x97` | TP | 112 | | `0x9B` | SCAN | 113 | | `0xA0` | MODE | 114 | | `0xA2` | MODE | 115 | | `0xA4` | MODE | 116 | | `0xA6` | MODE | 117 | | `0xC0` | RIGHT FM1 6-5-4-3-2-1-FM2 6-5-4-3-2-1 | 118 | | `0xC2` | RIGHT FM1 6-5-4-3-2-1-FM2 6-5-4-3-2-1 | 119 | | `0xC4` | RIGHT FM1 6-5-4-3-2-1-FM2 6-5-4-3-2-1 | 120 | | `0xC6` | RIGHT FM1 6-5-4-3-2-1-FM2 6-5-4-3-2-1 | 121 | | `0xD0` | Seek up/FF | 122 | | `0xD2` | Seek up/FF | 123 | | `0xD4` | Seek up/FF | 124 | | `0xD6` | Seek up/FF | 125 | | `0xE0` | seek up | 126 | | `0xE2` | seek up | 127 | | `0xE4` | seek up | 128 | | `0xE6` | seek up | 129 | -------------------------------------------------------------------------------- /VW_radio_remote_control/audi_MFSW_eletric_connection_schematics.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaskovacik/arduino/f05afbf2832779639f7acf65efefe63748cfe9e0/VW_radio_remote_control/audi_MFSW_eletric_connection_schematics.pdf -------------------------------------------------------------------------------- /VW_radio_remote_control/code_finder/code_finder.ino: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | license: GPL 4 | 5 | code finder for audi radios (probably also for vw, skoda, seat) 6 | using ebay LCD shield(2x16) with 5 buttons on A0 7 | output (remote signal) is on pin 2 8 | 9 | more info: 10 | http://kovo-blog.blogspot.sk/2013/10/remote-control-audi-radio.html 11 | 12 | 5V logic 13 | start bit: 14 | 9ms LOW 15 | 4.55ms HIGH 16 | 17 | logic 0: 18 | ~600us LOW ~1700us HIGH 19 | 20 | logic 1: 21 | ~600us LOW ~600us HIGH 22 | 23 | stop bit: 24 | ~600us LOW 25 | 26 | I have MFSW without telephone option, so I read codes just for radio: 27 | 28 | UP: 0x41E8D02F 29 | DOWN: 0x41E850AF 30 | LEFT: 0x41E840BF 31 | RIGHT: 0x41E8C03F 32 | VOL+: 0x41E8807F 33 | VOL-: 0x41E800FF 34 | 35 | code is always 0x41 0xE8 X 0xFF-X 36 | 37 | */ 38 | 39 | 40 | //UP: 0xD0 41 | #define UP 0xD0 42 | //0,1,0,0,0,0,0,1,1,1,1,0,1,0,0,0,1,1,0,1,0,0,0,0,0,0,1,0,1,1,1,1 43 | //DOWN: 0x50 44 | #define DOWN 0x50 45 | //0,1,0,0,0,0,0,1,1,1,1,0,1,0,0,0,0,1,0,1,0,0,0,0,1,0,1,0,1,1,1,1 46 | //LEFT: 0x40 47 | #define LEFT 0x40 48 | //0,1,0,0,0,0,0,1,1,1,1,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0,1,1,1,1,1,1 49 | //RIGHT: 0xC0 50 | #define RIGHT 0xC0 51 | //0,1,0,0,0,0,0,1,1,1,1,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1 52 | //VOL+: 0x80 53 | //0,1,0,0,0,0,0,1,1,1,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1 54 | //VOL-: 0x00 55 | //0,1,0,0,0,0,0,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1 56 | #include 57 | 58 | //lcd pins 59 | LiquidCrystal lcd(8, 9, 4, 5, 6, 7); 60 | 61 | 62 | int adc_key_val[5] ={ 63 | 30, 150, 360, 535, 760 }; 64 | int NUM_KEYS = 5; 65 | int adc_key_in; 66 | int key=-1; 67 | int oldkey=-1; 68 | 69 | int h=0x00; 70 | 71 | void setup() { 72 | pinMode(2,OUTPUT); 73 | digitalWrite(2,HIGH); 74 | lcd.begin(16,2); 75 | lcd.home(); 76 | lcd.clear(); 77 | Serial.begin(9600); 78 | } 79 | 80 | void loop() { 81 | 82 | adc_key_in = analogRead(0); // read the value from the sensor 83 | key = get_key(adc_key_in); // convert into key press 84 | if (key != oldkey) // if keypress is detected 85 | { 86 | delay(50); // wait for debounce time 87 | adc_key_in = analogRead(0); // read the value from the sensor 88 | key = get_key(adc_key_in); // convert into key press 89 | if (key != oldkey) 90 | { 91 | oldkey = key; 92 | switch (key) 93 | { 94 | case 0: 95 | // righ - increment and send 96 | h++; 97 | sendByte(h); 98 | break; 99 | case 1: 100 | // up - increment but dont send 101 | h++; 102 | lcd.clear(); 103 | lcd.home(); 104 | lcd.print(h,HEX); 105 | break; 106 | case 2: 107 | // down - decrement bu dont send 108 | h--; 109 | lcd.clear(); 110 | lcd.home(); 111 | lcd.print(h,HEX); 112 | break; 113 | case 3: 114 | // left - decrement and send 115 | if(h>0) 116 | h--; 117 | sendByte(h); 118 | break; 119 | case 4: 120 | // select - repeat sending of last number 121 | sendByte(h); 122 | break; 123 | } 124 | 125 | } 126 | } 127 | } 128 | 129 | void sendByte(int cislo) { 130 | lcd.clear(); 131 | lcd.home(); 132 | lcd.print(cislo,HEX); 133 | int c_cislo=0xFF-cislo; 134 | int cmdStart[32]={0,1,0,0,0,0,0,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; 135 | for (int i = 23;i>=16;i-- ){ 136 | if (cislo%2 != 0) cmdStart[i]=1; 137 | cislo = cislo/2; 138 | } 139 | 140 | for (int i = 31;i>=24;i-- ){ 141 | if (c_cislo%2 != 0) cmdStart[i]=1; 142 | c_cislo = c_cislo/2; 143 | } 144 | digitalWrite(2,LOW); 145 | delay(9); 146 | digitalWrite(2,HIGH); 147 | delayMicroseconds(4500); 148 | for (int i=0;i<32;i++){ 149 | Serial.print(cmdStart[i]); 150 | Serial.print(","); 151 | digitalWrite(2,LOW); 152 | delayMicroseconds(600); 153 | digitalWrite(2,HIGH); 154 | if (cmdStart[i]==0) 155 | delayMicroseconds(600); 156 | if (cmdStart[i]==1) 157 | delayMicroseconds(1700); 158 | } 159 | Serial.println(""); 160 | digitalWrite(2,LOW); 161 | delayMicroseconds(600); 162 | digitalWrite(2,HIGH); 163 | 164 | } 165 | // Convert ADC value to key number 166 | int get_key(unsigned int input) 167 | { 168 | int k; 169 | for (k = 0; k < NUM_KEYS; k++) 170 | { 171 | if (input < adc_key_val[k]) 172 | { 173 | return k; 174 | } 175 | } 176 | if (k >= NUM_KEYS) 177 | k = -1; // No valid key pressed 178 | return k; 179 | } 180 | -------------------------------------------------------------------------------- /VW_radio_remote_control/emulator/emulator.ino: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | license: GPL 4 | 5 | emulator for audi radios (probably also for vw, skoda, seat) 6 | using ebay LCD shield(2x16) with 5 buttons on A0 7 | output (remote signal) is on pin 2 8 | 9 | more info: 10 | http://kovo-blog.blogspot.sk/2013/10/remote-control-audi-radio.html 11 | 12 | 5V logic 13 | start bit: 14 | 9ms LOW 15 | 4.55ms HIGH 16 | 17 | logic 0: 18 | ~600us LOW ~1700us HIGH 19 | 20 | logic 1: 21 | ~600us LOW ~600us HIGH 22 | 23 | stop bit: 24 | ~600us LOW 25 | 26 | I have MFSW without telephone option, so I read codes just for radio: 27 | 28 | UP: 0x41E8D02F 29 | DOWN: 0x41E850AF 30 | LEFT: 0x41E840BF 31 | RIGHT: 0x41E8C03F 32 | VOL+: 0x41E8807F 33 | VOL-: 0x41E800FF 34 | 35 | code is always 0x41 0xE8 X 0xFF-X 36 | 37 | discovered codes on my audi concert I unit: 38 | 39 | 0x00 Volume down 40 | 0x01 mem/cd1 41 | 0x03 mem/cd3 42 | 0x05 mem/cd5 43 | 0x07 search up 44 | 0x09 reg on/off 45 | 0x0B tp 46 | 0x11 AM 47 | 0x15 AS-STORE 48 | 0x17 FM 49 | 0x1D search down 50 | 0x20 AM->AM+AS->FM1->FM2->FM1+AS->FM2->AS/in CD mode “RD” 51 | 0x22 AM->AM+AS->FM1->FM2->FM1+AS->FM2->AS/in CD mode “RD” 52 | 0x24 AM->AM+AS->FM1->FM2->FM1+AS->FM2->AS/in CD mode “RD” 53 | 0x26 AM->AM+AS->FM1->FM2->FM1+AS->FM2->AS/in CD mode “RD” 54 | 0x29 TP 55 | 0x2B search up 56 | 0x3C seek up 57 | 0x40 LEFT FM1 6-5-4-3-2-1-FM2 6-5-4-3-2-1 58 | 0x42 LEFT FM1 6-5-4-3-2-1-FM2 6-5-4-3-2-1 59 | 0x44 LEFT FM1 6-5-4-3-2-1-FM2 6-5-4-3-2-1 60 | 0x46 LEFT FM1 6-5-4-3-2-1-FM2 6-5-4-3-2-1 61 | 0x50 Seek down/FR 62 | 0x52 Seek down/FR 63 | 0x54 Seek down/FR 64 | 0x56 Seek down/FR 65 | 0x60 Seek down/FR 66 | 0x62 seek down 67 | 0x64 seek down 68 | 0x80 Volume up 69 | 0x81 Volume up 70 | 0x82 Volume up 71 | 0x83 Volume up 72 | 0x84 Volume up 73 | 0x85 Volume up 74 | 0x86 Volume up 75 | 0x89 -2 Volume down bas/treble down/fade rear/bal left 76 | 0x8B -4 Volume down bas/treble down/fade rear/bal left 77 | 0x8D -6 Volume down bas/treble down/fade rear/bal left 78 | 0x8F -8 Volume down/fade rear/bal left 79 | 0x97 TP 80 | 0x9B SCAN 81 | 0xA0 MODE 82 | 0xA2 MODE 83 | 0xA4 MODE 84 | 0xA6 MODE 85 | 0xC0 RIGHT FM1 6-5-4-3-2-1-FM2 6-5-4-3-2-1 86 | 0xC2 RIGHT FM1 6-5-4-3-2-1-FM2 6-5-4-3-2-1 87 | 0xC4 RIGHT FM1 6-5-4-3-2-1-FM2 6-5-4-3-2-1 88 | 0xC6 RIGHT FM1 6-5-4-3-2-1-FM2 6-5-4-3-2-1 89 | 0xD0 Seek up/FF 90 | 0xD2 Seek up/FF 91 | 0xD4 Seek up/FF 92 | 0xD6 Seek up/FF 93 | 0xE0 seek up 94 | 0xE2 seek up 95 | 0xE4 seek up 96 | 0xE6 seek up 97 | */ 98 | 99 | 100 | //UP: 0xD0 101 | #define UP 0xD0 102 | //0,1,0,0,0,0,0,1,1,1,1,0,1,0,0,0,1,1,0,1,0,0,0,0,0,0,1,0,1,1,1,1 103 | //DOWN: 0x50 104 | #define DOWN 0x50 105 | //0,1,0,0,0,0,0,1,1,1,1,0,1,0,0,0,0,1,0,1,0,0,0,0,1,0,1,0,1,1,1,1 106 | //LEFT: 0x40 107 | #define LEFT 0x40 108 | //0,1,0,0,0,0,0,1,1,1,1,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0,1,1,1,1,1,1 109 | //RIGHT: 0xC0 110 | #define RIGHT 0xC0 111 | //0,1,0,0,0,0,0,1,1,1,1,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1 112 | //VOL+: 0x80 113 | //0,1,0,0,0,0,0,1,1,1,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1 114 | //VOL-: 0x00 115 | //0,1,0,0,0,0,0,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1 116 | #define MODE 0xA0 117 | 118 | #include 119 | 120 | //lcd pins 121 | LiquidCrystal lcd(8, 9, 4, 5, 6, 7); 122 | 123 | 124 | int adc_key_val[5] ={ 125 | 30, 150, 360, 535, 760 }; 126 | int NUM_KEYS = 5; 127 | int adc_key_in; 128 | int key=-1; 129 | int oldkey=-1; 130 | 131 | int h=0x00; 132 | 133 | void setup() { 134 | pinMode(2,OUTPUT); 135 | digitalWrite(2,HIGH); 136 | lcd.begin(16,2); 137 | lcd.home(); 138 | lcd.clear(); 139 | Serial.begin(9600); 140 | } 141 | 142 | void loop() { 143 | 144 | adc_key_in = analogRead(0); // read the value from the sensor 145 | key = get_key(adc_key_in); // convert into key press 146 | if (key != oldkey) // if keypress is detected 147 | { 148 | delay(50); // wait for debounce time 149 | adc_key_in = analogRead(0); // read the value from the sensor 150 | key = get_key(adc_key_in); // convert into key press 151 | if (key != oldkey) 152 | { 153 | oldkey = key; 154 | switch (key) 155 | { 156 | case 0: 157 | // righ 158 | sendByte(RIGHT); 159 | lcd.clear(); 160 | lcd.home(); 161 | lcd.print("NEXT CD/station"); 162 | break; 163 | case 1: 164 | // up 165 | lcd.clear(); 166 | lcd.home(); 167 | lcd.print("NEXT track/FF"); 168 | sendByte(UP); 169 | break; 170 | case 2: 171 | // down 172 | lcd.clear(); 173 | lcd.home(); 174 | lcd.print("PREV track/FR"); 175 | sendByte(DOWN); 176 | break; 177 | case 3: 178 | // left 179 | lcd.clear(); 180 | lcd.home(); 181 | lcd.print("PREV CD/station"); 182 | sendByte(LEFT); 183 | break; 184 | case 4: 185 | // select 186 | lcd.clear(); 187 | lcd.home(); 188 | lcd.print("MODE"); 189 | sendByte(MODE); 190 | break; 191 | } 192 | 193 | } 194 | } 195 | } 196 | 197 | void sendByte(int cislo) { 198 | lcd.clear(); 199 | lcd.setCursor(0, 1); 200 | lcd.print(cislo,HEX); 201 | int c_cislo=0xFF-cislo; 202 | int cmdStart[32]={0,1,0,0,0,0,0,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; 203 | for (int i = 23;i>=16;i-- ){ 204 | if (cislo%2 != 0) cmdStart[i]=1; 205 | cislo = cislo/2; 206 | } 207 | 208 | for (int i = 31;i>=24;i-- ){ 209 | if (c_cislo%2 != 0) cmdStart[i]=1; 210 | c_cislo = c_cislo/2; 211 | } 212 | digitalWrite(2,LOW); 213 | delay(9); 214 | digitalWrite(2,HIGH); 215 | delayMicroseconds(4500); 216 | for (int i=0;i<32;i++){ 217 | Serial.print(cmdStart[i]); 218 | Serial.print(","); 219 | digitalWrite(2,LOW); 220 | delayMicroseconds(600); 221 | digitalWrite(2,HIGH); 222 | if (cmdStart[i]==0) 223 | delayMicroseconds(600); 224 | if (cmdStart[i]==1) 225 | delayMicroseconds(1700); 226 | } 227 | Serial.println(); 228 | digitalWrite(2,LOW); 229 | delayMicroseconds(600); 230 | digitalWrite(2,HIGH); 231 | 232 | } 233 | // Convert ADC value to key number 234 | int get_key(unsigned int input) 235 | { 236 | int k; 237 | for (k = 0; k < NUM_KEYS; k++) 238 | { 239 | if (input < adc_key_val[k]) 240 | { 241 | return k; 242 | } 243 | } 244 | if (k >= NUM_KEYS) 245 | k = -1; // No valid key pressed 246 | return k; 247 | } 248 | 249 | 250 | -------------------------------------------------------------------------------- /VW_radio_remote_control/remote_control_codes_control_unit_to_radio.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaskovacik/arduino/f05afbf2832779639f7acf65efefe63748cfe9e0/VW_radio_remote_control/remote_control_codes_control_unit_to_radio.ods -------------------------------------------------------------------------------- /audi_concert_RDS/rs232c_dump9600_8N1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tomaskovacik/arduino/f05afbf2832779639f7acf65efefe63748cfe9e0/audi_concert_RDS/rs232c_dump9600_8N1 -------------------------------------------------------------------------------- /audi_volume_fix/AM2FM.txt: -------------------------------------------------------------------------------- 1 | FM 2 | volume -56.25dB ( F4 ) 3 | volume -59.68dB ( FF ) 4 | Bass: 0dB, Trebble: 0dB 5 | Mute: Soft Mute with fast slope (I = Imax) 6 | Zero Crossing Mute Off 7 | 160mV ZC Window Threshold (WIN = 00) 8 | Symmetrical Bass Cut 9 | button release 10 | Mute: Zero Crossing Mute Off 11 | 160mV ZC Window Threshold (WIN = 00) 12 | Symmetrical Bass Cut 13 | Bass: 6dB, Trebble: 12dB 14 | volume -59.68dB ( FF ) 15 | volume -59.68dB ( FF ) 16 | volume -59.68dB ( FF ) 17 | volume -59.68dB ( FF ) 18 | volume -59.06dB ( FD ) 19 | volume -58.43dB ( FB ) 20 | volume -57.81dB ( F9 ) 21 | volume -57.18dB ( F7 ) 22 | volume -56.56dB ( F5 ) 23 | volume -55.93dB ( F3 ) 24 | volume -55.31dB ( F1 ) 25 | volume -54.68dB ( EF ) 26 | volume -53.75dB ( EC ) 27 | -------------------------------------------------------------------------------- /audi_volume_fix/CD2FM.txt: -------------------------------------------------------------------------------- 1 | MODE 2 | button release 3 | volume -56.25dB ( F4 ) 4 | volume -59.68dB ( FF ) 5 | Bass: 0dB, Trebble: 0dB 6 | Mute: Soft Mute with fast slope (I = Imax) 7 | Zero Crossing Mute Off 8 | 160mV ZC Window Threshold (WIN = 00) 9 | Symmetrical Bass Cut 10 | Input selector: FM / AM selected (IN1) 11 | Mute: Zero Crossing Mute Off 12 | 160mV ZC Window Threshold (WIN = 00) 13 | Symmetrical Bass Cut 14 | Bass: 6dB, Trebble: 12dB 15 | volume -59.68dB ( FF ) 16 | volume -59.68dB ( FF ) 17 | volume -59.68dB ( FF ) 18 | volume -59.68dB ( FF ) 19 | volume -59.06dB ( FD ) 20 | volume -58.43dB ( FB ) 21 | volume -57.81dB ( F9 ) 22 | volume -57.18dB ( F7 ) 23 | volume -56.56dB ( F5 ) 24 | volume -55.93dB ( F3 ) 25 | volume -55.31dB ( F1 ) 26 | volume -54.68dB ( EF ) 27 | volume -53.75dB ( EC ) 28 | -------------------------------------------------------------------------------- /audi_volume_fix/CD2TP.txt: -------------------------------------------------------------------------------- 1 | TP 2 | button release 3 | TP 4 | button release 5 | 2 6 | button release 7 | 3 8 | button release 9 | >> 10 | button release 11 | volume -56.25dB ( F4 ) 12 | volume -59.68dB ( FF ) 13 | Bass: 0dB, Trebble: 0dB 14 | Mute: Soft Mute with fast slope (I = Imax) 15 | Zero Crossing Mute Off 16 | 160mV ZC Window Threshold (WIN = 00) 17 | Symmetrical Bass Cut 18 | Mute: Zero Crossing Mute Off 19 | 160mV ZC Window Threshold (WIN = 00) 20 | Symmetrical Bass Cut 21 | Bass: 6dB, Trebble: 12dB 22 | volume -59.68dB ( FF ) 23 | volume -59.68dB ( FF ) 24 | volume -59.68dB ( FF ) 25 | volume -59.68dB ( FF ) 26 | volume -59.06dB ( FD ) 27 | volume -58.43dB ( FB ) 28 | volume -57.81dB ( F9 ) 29 | volume -57.18dB ( F7 ) 30 | volume -56.56dB ( F5 ) 31 | volume -55.93dB ( F3 ) 32 | volume -55.31dB ( F1 ) 33 | volume -54.68dB ( EF ) 34 | volume -53.75dB ( EC ) 35 | -------------------------------------------------------------------------------- /audi_volume_fix/CD_next_track.txt: -------------------------------------------------------------------------------- 1 | >> 2 | button release 3 | volume -56.25dB ( F4 ) 4 | volume -59.68dB ( FF ) 5 | volume -59.68dB ( FF ) 6 | volume -59.68dB ( FF ) 7 | volume -59.68dB ( FF ) 8 | volume -59.68dB ( FF ) 9 | volume -59.06dB ( FD ) 10 | volume -58.43dB ( FB ) 11 | volume -57.81dB ( F9 ) 12 | volume -57.18dB ( F7 ) 13 | volume -56.56dB ( F5 ) 14 | volume -55.93dB ( F3 ) 15 | volume -55.31dB ( F1 ) 16 | volume -54.68dB ( EF ) 17 | volume -53.75dB ( EC ) 18 | >> 19 | button release 20 | volume -56.25dB ( F4 ) 21 | volume -59.68dB ( FF ) 22 | Bass: 0dB, Trebble: 0dB 23 | Mute: Soft Mute with fast slope (I = Imax) 24 | Zero Crossing Mute Off 25 | 160mV ZC Window Threshold (WIN = 00) 26 | Symmetrical Bass Cut 27 | Mute: Zero Crossing Mute Off 28 | 160mV ZC Window Threshold (WIN = 00) 29 | Symmetrical Bass Cut 30 | Bass: 6dB, Trebble: 12dB 31 | volume -59.68dB ( FF ) 32 | volume -59.68dB ( FF ) 33 | volume -59.68dB ( FF ) 34 | volume -59.68dB ( FF ) 35 | volume -59.06dB ( FD ) 36 | volume -58.43dB ( FB ) 37 | volume -57.81dB ( F9 ) 38 | volume -57.18dB ( F7 ) 39 | volume -56.56dB ( F5 ) 40 | volume -55.93dB ( F3 ) 41 | volume -55.31dB ( F1 ) 42 | volume -54.68dB ( EF ) 43 | volume -53.75dB ( EC ) 44 | Knob + 45 | volume -53.12dB ( EA ) 46 | volume -52.50dB ( E8 ) 47 | Knob + 48 | volume -51.87dB ( E6 ) 49 | volume -50.62dB ( E2 ) 50 | volume -49.37dB ( DE ) 51 | volume -48.12dB ( DA ) 52 | volume -47.50dB ( D8 ) 53 | Knob + 54 | volume -46.87dB ( D6 ) 55 | volume -45.62dB ( D2 ) 56 | volume -44.37dB ( CE ) 57 | Knob + 58 | volume -43.12dB ( CA ) 59 | volume -41.87dB ( C6 ) 60 | volume -40.62dB ( C2 ) 61 | volume -39.37dB ( BE ) 62 | volume -38.12dB ( BA ) 63 | volume -36.87dB ( B6 ) 64 | volume -35.62dB ( B2 ) 65 | volume -35.00dB ( B0 ) 66 | Knob + 67 | volume -34.37dB ( AE ) 68 | volume -33.12dB ( AA ) 69 | volume -31.87dB ( A6 ) 70 | volume -30.62dB ( A2 ) 71 | volume -30.00dB ( A0 ) 72 | volume -29.37dB ( 9E ) 73 | volume -28.75dB ( 9C ) 74 | volume -28.12dB ( 9A ) 75 | volume -27.50dB ( 98 ) 76 | volume -26.87dB ( 96 ) 77 | volume -26.25dB ( 94 ) 78 | volume -25.62dB ( 92 ) 79 | volume -25.00dB ( 90 ) 80 | volume -24.37dB ( 8E ) 81 | volume -23.75dB ( 8C ) 82 | volume -23.12dB ( 8A ) 83 | volume -22.50dB ( 88 ) 84 | volume -21.87dB ( 86 ) 85 | volume -21.25dB ( 84 ) 86 | >> 87 | button release 88 | volume -26.25dB ( 94 ) 89 | volume -31.25dB ( A4 ) 90 | volume -36.25dB ( B4 ) 91 | volume -41.25dB ( C4 ) 92 | volume -46.25dB ( D4 ) 93 | volume -45.00dB ( D0 ) 94 | volume -43.75dB ( CC ) 95 | volume -42.50dB ( C8 ) 96 | volume -41.25dB ( C4 ) 97 | volume -40.00dB ( C0 ) 98 | volume -38.75dB ( BC ) 99 | volume -37.50dB ( B8 ) 100 | volume -36.25dB ( B4 ) 101 | volume -35.00dB ( B0 ) 102 | volume -33.75dB ( AC ) 103 | volume -32.50dB ( A8 ) 104 | volume -31.25dB ( A4 ) 105 | volume -30.00dB ( A0 ) 106 | volume -29.37dB ( 9E ) 107 | volume -28.75dB ( 9C ) 108 | volume -28.12dB ( 9A ) 109 | volume -27.50dB ( 98 ) 110 | volume -26.87dB ( 96 ) 111 | volume -26.25dB ( 94 ) 112 | volume -25.62dB ( 92 ) 113 | volume -25.00dB ( 90 ) 114 | volume -24.37dB ( 8E ) 115 | volume -23.75dB ( 8C ) 116 | volume -23.12dB ( 8A ) 117 | volume -22.50dB ( 88 ) 118 | volume -21.87dB ( 86 ) 119 | volume -21.25dB ( 84 ) 120 | >> 121 | button release 122 | volume -26.25dB ( 94 ) 123 | volume -31.25dB ( A4 ) 124 | volume -30.00dB ( A0 ) 125 | volume -29.37dB ( 9E ) 126 | volume -28.75dB ( 9C ) 127 | volume -28.12dB ( 9A ) 128 | volume -27.50dB ( 98 ) 129 | volume -26.87dB ( 96 ) 130 | volume -26.25dB ( 94 ) 131 | volume -25.62dB ( 92 ) 132 | volume -25.00dB ( 90 ) 133 | volume -24.37dB ( 8E ) 134 | volume -23.75dB ( 8C ) 135 | volume -23.12dB ( 8A ) 136 | volume -22.50dB ( 88 ) 137 | volume -21.87dB ( 86 ) 138 | volume -21.25dB ( 84 ) 139 | << 140 | button release 141 | volume -26.25dB ( 94 ) 142 | volume -31.25dB ( A4 ) 143 | volume -36.25dB ( B4 ) 144 | volume -41.25dB ( C4 ) 145 | volume -46.25dB ( D4 ) 146 | volume -48.75dB ( DC ) 147 | volume -51.25dB ( E4 ) 148 | volume -53.75dB ( EC ) 149 | volume -56.25dB ( F4 ) 150 | volume -59.68dB ( FF ) 151 | Bass: 0dB, Trebble: 0dB 152 | Mute: Soft Mute with fast slope (I = Imax) 153 | Zero Crossing Mute Off 154 | 160mV ZC Window Threshold (WIN = 00) 155 | Symmetrical Bass Cut 156 | << 157 | button release 158 | Mute: Zero Crossing Mute Off 159 | 160mV ZC Window Threshold (WIN = 00) 160 | Symmetrical Bass Cut 161 | Bass: 6dB, Trebble: 12dB 162 | volume -59.68dB ( FF ) 163 | volume -57.18dB ( F7 ) 164 | volume -54.68dB ( EF ) 165 | volume -52.18dB ( E7 ) 166 | volume -49.68dB ( DF ) 167 | volume -48.43dB ( DB ) 168 | volume -47.18dB ( D7 ) 169 | volume -45.93dB ( D3 ) 170 | volume -44.68dB ( CF ) 171 | volume -43.43dB ( CB ) 172 | volume -42.18dB ( C7 ) 173 | volume -40.93dB ( C3 ) 174 | volume -39.68dB ( BF ) 175 | volume -38.43dB ( BB ) 176 | volume -37.18dB ( B7 ) 177 | volume -35.93dB ( B3 ) 178 | volume -34.68dB ( AF ) 179 | volume -33.43dB ( AB ) 180 | volume -32.18dB ( A7 ) 181 | volume -30.93dB ( A3 ) 182 | volume -30.31dB ( A1 ) 183 | volume -29.68dB ( 9F ) 184 | volume -29.06dB ( 9D ) 185 | volume -28.43dB ( 9B ) 186 | volume -27.81dB ( 99 ) 187 | volume -27.18dB ( 97 ) 188 | volume -26.56dB ( 95 ) 189 | volume -25.93dB ( 93 ) 190 | volume -25.31dB ( 91 ) 191 | volume -24.68dB ( 8F ) 192 | volume -24.06dB ( 8D ) 193 | volume -23.43dB ( 8B ) 194 | volume -22.81dB ( 89 ) 195 | volume -22.18dB ( 87 ) 196 | volume -21.25dB ( 84 ) 197 | << 198 | button release 199 | volume -26.25dB ( 94 ) 200 | volume -31.25dB ( A4 ) 201 | volume -36.25dB ( B4 ) 202 | volume -41.25dB ( C4 ) 203 | volume -46.25dB ( D4 ) 204 | volume -48.75dB ( DC ) 205 | volume -47.50dB ( D8 ) 206 | volume -46.25dB ( D4 ) 207 | volume -45.00dB ( D0 ) 208 | volume -43.75dB ( CC ) 209 | volume -42.50dB ( C8 ) 210 | volume -41.25dB ( C4 ) 211 | volume -40.00dB ( C0 ) 212 | volume -38.75dB ( BC ) 213 | volume -37.50dB ( B8 ) 214 | volume -36.25dB ( B4 ) 215 | volume -35.00dB ( B0 ) 216 | volume -33.75dB ( AC ) 217 | volume -32.50dB ( A8 ) 218 | volume -31.25dB ( A4 ) 219 | volume -30.00dB ( A0 ) 220 | volume -29.37dB ( 9E ) 221 | volume -28.75dB ( 9C ) 222 | volume -28.12dB ( 9A ) 223 | volume -27.50dB ( 98 ) 224 | volume -26.87dB ( 96 ) 225 | volume -26.25dB ( 94 ) 226 | volume -25.62dB ( 92 ) 227 | volume -25.00dB ( 90 ) 228 | volume -24.37dB ( 8E ) 229 | volume -23.75dB ( 8C ) 230 | volume -23.12dB ( 8A ) 231 | volume -22.50dB ( 88 ) 232 | volume -21.87dB ( 86 ) 233 | volume -21.25dB ( 84 ) 234 | seek > 235 | button release 236 | seek > 237 | button release 238 | seek > 239 | button release 240 | seek > 241 | button release 242 | -------------------------------------------------------------------------------- /audi_volume_fix/FM1-to-FM2.txt: -------------------------------------------------------------------------------- 1 | Mute: Zero Crossing Mute Off 2 | 160mV ZC Window Threshold (WIN = 00) 3 | Symmetrical Bass Cut 4 | volume -16.25dB ( 74 ) 5 | volume -59.68dB ( FF ) 6 | Bass: 0dB, Trebble: 0dB 7 | Mute: Soft Mute with fast slope (I = Imax) 8 | Zero Crossing Mute Off 9 | 160mV ZC Window Threshold (WIN = 00) 10 | Symmetrical Bass Cut 11 | Mute: Zero Crossing Mute Off 12 | 160mV ZC Window Threshold (WIN = 00) 13 | Symmetrical Bass Cut 14 | volume -15.00dB ( 70 ) 15 | volume -59.68dB ( FF ) 16 | Bass: 0dB, Trebble: 0dB 17 | Mute: Soft Mute with fast slope (I = Imax) 18 | Zero Crossing Mute Off 19 | 160mV ZC Window Threshold (WIN = 00) 20 | Symmetrical Bass Cut 21 | FM 22 | button release 23 | Input selector: FM / AM selected (IN1) 24 | Mute: Zero Crossing Mute Off 25 | 160mV ZC Window Threshold (WIN = 00) 26 | Symmetrical Bass Cut 27 | Bass: 6dB, Trebble: 12dB 28 | volume -59.68dB ( FF ) 29 | volume -59.68dB ( FF ) 30 | volume -59.68dB ( FF ) 31 | volume -59.68dB ( FF ) 32 | volume -59.06dB ( FD ) 33 | volume -58.43dB ( FB ) 34 | volume -57.81dB ( F9 ) 35 | volume -57.18dB ( F7 ) 36 | volume -56.56dB ( F5 ) 37 | volume -55.93dB ( F3 ) 38 | volume -55.31dB ( F1 ) 39 | volume -54.68dB ( EF ) 40 | volume -53.75dB ( EC ) 41 | -------------------------------------------------------------------------------- /audi_volume_fix/FM2-to-FM1.txt: -------------------------------------------------------------------------------- 1 | FM 2 | volume -56.25dB ( F4 ) 3 | volume -59.68dB ( FF ) 4 | Bass: 0dB, Trebble: 0dB 5 | Mute: Soft Mute with fast slope (I = Imax) 6 | Zero Crossing Mute Off 7 | 160mV ZC Window Threshold (WIN = 00) 8 | Symmetrical Bass Cut 9 | button release 10 | Mute: Zero Crossing Mute Off 11 | 160mV ZC Window Threshold (WIN = 00) 12 | Symmetrical Bass Cut 13 | Bass: 6dB, Trebble: 12dB 14 | volume -59.68dB ( FF ) 15 | volume -59.68dB ( FF ) 16 | volume -59.68dB ( FF ) 17 | volume -59.68dB ( FF ) 18 | volume -59.06dB ( FD ) 19 | volume -58.43dB ( FB ) 20 | volume -57.81dB ( F9 ) 21 | volume -57.18dB ( F7 ) 22 | volume -56.56dB ( F5 ) 23 | volume -55.93dB ( F3 ) 24 | volume -55.31dB ( F1 ) 25 | volume -54.68dB ( EF ) 26 | volume -53.75dB ( EC ) 27 | -------------------------------------------------------------------------------- /audi_volume_fix/FM2AM.txt: -------------------------------------------------------------------------------- 1 | AM 2 | volume -56.25dB ( F4 ) 3 | volume -59.68dB ( FF ) 4 | Bass: 0dB, Trebble: 0dB 5 | Mute: Soft Mute with fast slope (I = Imax) 6 | Zero Crossing Mute Off 7 | 160mV ZC Window Threshold (WIN = 00) 8 | Symmetrical Bass Cut 9 | button release 10 | Mute: Zero Crossing Mute Off 11 | 160mV ZC Window Threshold (WIN = 00) 12 | Symmetrical Bass Cut 13 | Bass: 6dB, Trebble: 12dB 14 | volume -59.68dB ( FF ) 15 | volume -59.68dB ( FF ) 16 | volume -59.68dB ( FF ) 17 | volume -59.68dB ( FF ) 18 | volume -59.06dB ( FD ) 19 | volume -58.43dB ( FB ) 20 | volume -57.81dB ( F9 ) 21 | volume -57.18dB ( F7 ) 22 | volume -56.56dB ( F5 ) 23 | volume -55.93dB ( F3 ) 24 | volume -55.31dB ( F1 ) 25 | volume -54.68dB ( EF ) 26 | volume -53.75dB ( EC ) 27 | -------------------------------------------------------------------------------- /audi_volume_fix/FM2TAPE.txt: -------------------------------------------------------------------------------- 1 | volume -26.25dB ( 94 ) 2 | volume -31.25dB ( A4 ) 3 | volume -36.25dB ( B4 ) 4 | volume -41.25dB ( C4 ) 5 | volume -46.25dB ( D4 ) 6 | volume -48.75dB ( DC ) 7 | volume -51.25dB ( E4 ) 8 | volume -53.75dB ( EC ) 9 | volume -56.25dB ( F4 ) 10 | volume -59.68dB ( FF ) 11 | Bass: 0dB, Trebble: 0dB 12 | Mute: Soft Mute with fast slope (I = Imax) 13 | Zero Crossing Mute Off 14 | 160mV ZC Window Threshold (WIN = 00) 15 | Symmetrical Bass Cut 16 | Input selector: TAPE selected (IN2) 17 | Mute: Zero Crossing Mute Off 18 | 160mV ZC Window Threshold (WIN = 00) 19 | Symmetrical Bass Cut 20 | Bass: 6dB, Trebble: 12dB 21 | volume -59.68dB ( FF ) 22 | volume -57.18dB ( F7 ) 23 | volume -54.68dB ( EF ) 24 | volume -52.18dB ( E7 ) 25 | volume -49.68dB ( DF ) 26 | volume -48.43dB ( DB ) 27 | volume -47.18dB ( D7 ) 28 | volume -45.93dB ( D3 ) 29 | volume -44.68dB ( CF ) 30 | volume -43.43dB ( CB ) 31 | volume -42.18dB ( C7 ) 32 | volume -40.93dB ( C3 ) 33 | volume -39.68dB ( BF ) 34 | volume -38.43dB ( BB ) 35 | volume -37.18dB ( B7 ) 36 | volume -35.93dB ( B3 ) 37 | volume -34.68dB ( AF ) 38 | volume -33.43dB ( AB ) 39 | volume -32.18dB ( A7 ) 40 | volume -30.93dB ( A3 ) 41 | volume -30.31dB ( A1 ) 42 | volume -29.68dB ( 9F ) 43 | volume -29.06dB ( 9D ) 44 | volume -28.43dB ( 9B ) 45 | volume -27.81dB ( 99 ) 46 | volume -27.18dB ( 97 ) 47 | volume -26.56dB ( 95 ) 48 | volume -25.93dB ( 93 ) 49 | volume -25.31dB ( 91 ) 50 | volume -24.68dB ( 8F ) 51 | volume -24.06dB ( 8D ) 52 | volume -23.43dB ( 8B ) 53 | volume -22.81dB ( 89 ) 54 | volume -22.18dB ( 87 ) 55 | volume -21.25dB ( 84 ) 56 | -------------------------------------------------------------------------------- /audi_volume_fix/FM2TAPE2CD.txt: -------------------------------------------------------------------------------- 1 | MODE 2 | button release 3 | volume -56.25dB ( F4 ) 4 | volume -59.68dB ( FF ) 5 | Bass: 0dB, Trebble: 0dB 6 | Mute: Soft Mute with fast slope (I = Imax) 7 | Zero Crossing Mute Off 8 | 160mV ZC Window Threshold (WIN = 00) 9 | Symmetrical Bass Cut 10 | MODE 11 | button release 12 | Input selector: CD selected (0dB diferential input gain (IN3)) 13 | Mute: Zero Crossing Mute Off 14 | 160mV ZC Window Threshold (WIN = 00) 15 | Symmetrical Bass Cut 16 | Bass: 6dB, Trebble: 12dB 17 | volume -59.68dB ( FF ) 18 | volume -59.68dB ( FF ) 19 | volume -59.68dB ( FF ) 20 | volume -59.68dB ( FF ) 21 | volume -59.06dB ( FD ) 22 | volume -58.43dB ( FB ) 23 | volume -57.81dB ( F9 ) 24 | volume -57.18dB ( F7 ) 25 | volume -56.56dB ( F5 ) 26 | volume -55.93dB ( F3 ) 27 | volume -55.31dB ( F1 ) 28 | volume -54.68dB ( EF ) 29 | volume -53.75dB ( EC ) 30 | -------------------------------------------------------------------------------- /audi_volume_fix/TAPE_CPS_DOLBY_ETC.txt: -------------------------------------------------------------------------------- 1 | Dolby 2 | button release 3 | CPS 4 | button release 5 | -------------------------------------------------------------------------------- /audi_volume_fix/TAPE_EJECT.txt: -------------------------------------------------------------------------------- 1 | eject 2 | volume -26.25dB ( 94 ) 3 | volume -31.25dB ( A4 ) 4 | volume -36.25dB ( B4 ) 5 | volume -41.25dB ( C4 ) 6 | volume -46.25dB ( D4 ) 7 | volume -48.75dB ( DC ) 8 | volume -51.25dB ( E4 ) 9 | volume -53.75dB ( EC ) 10 | volume -56.25dB ( F4 ) 11 | volume -59.68dB ( FF ) 12 | Bass: 0dB, Trebble: 0dB 13 | Mute: Soft Mute with fast slope (I = Imax) 14 | Zero Crossing Mute Off 15 | 160mV ZC Window Threshold (WIN = 00) 16 | Symmetrical Bass Cut 17 | button release 18 | Input selector: FM / AM selected (IN1) 19 | Mute: Zero Crossing Mute Off 20 | 160mV ZC Window Threshold (WIN = 00) 21 | Symmetrical Bass Cut 22 | Bass: 6dB, Trebble: 12dB 23 | volume -59.68dB ( FF ) 24 | volume -57.18dB ( F7 ) 25 | volume -54.68dB ( EF ) 26 | volume -52.18dB ( E7 ) 27 | volume -49.68dB ( DF ) 28 | volume -48.43dB ( DB ) 29 | volume -47.18dB ( D7 ) 30 | volume -45.93dB ( D3 ) 31 | volume -44.68dB ( CF ) 32 | volume -43.43dB ( CB ) 33 | volume -42.18dB ( C7 ) 34 | volume -40.93dB ( C3 ) 35 | volume -39.68dB ( BF ) 36 | volume -38.43dB ( BB ) 37 | volume -37.18dB ( B7 ) 38 | volume -35.93dB ( B3 ) 39 | volume -34.68dB ( AF ) 40 | volume -33.43dB ( AB ) 41 | volume -32.18dB ( A7 ) 42 | volume -30.93dB ( A3 ) 43 | volume -30.31dB ( A1 ) 44 | volume -29.68dB ( 9F ) 45 | volume -29.06dB ( 9D ) 46 | volume -28.43dB ( 9B ) 47 | volume -27.81dB ( 99 ) 48 | volume -27.18dB ( 97 ) 49 | volume -26.56dB ( 95 ) 50 | volume -25.93dB ( 93 ) 51 | volume -25.31dB ( 91 ) 52 | volume -24.68dB ( 8F ) 53 | volume -24.06dB ( 8D ) 54 | volume -23.43dB ( 8B ) 55 | volume -22.81dB ( 89 ) 56 | volume -22.18dB ( 87 ) 57 | volume -21.25dB ( 84 ) 58 | -------------------------------------------------------------------------------- /audi_volume_fix/TAPE_FF_FR.txt: -------------------------------------------------------------------------------- 1 | >> 2 | button release 3 | volume -26.25dB ( 94 ) 4 | volume -31.25dB ( A4 ) 5 | volume -36.25dB ( B4 ) 6 | volume -41.25dB ( C4 ) 7 | volume -46.25dB ( D4 ) 8 | volume -48.75dB ( DC ) 9 | volume -51.25dB ( E4 ) 10 | volume -53.75dB ( EC ) 11 | volume -56.25dB ( F4 ) 12 | volume -59.68dB ( FF ) 13 | Bass: 0dB, Trebble: 0dB 14 | Mute: Soft Mute with fast slope (I = Imax) 15 | Zero Crossing Mute Off 16 | 160mV ZC Window Threshold (WIN = 00) 17 | Symmetrical Bass Cut 18 | >> 19 | button release 20 | Mute: Zero Crossing Mute Off 21 | 160mV ZC Window Threshold (WIN = 00) 22 | Symmetrical Bass Cut 23 | Bass: 6dB, Trebble: 12dB 24 | volume -59.68dB ( FF ) 25 | volume -57.18dB ( F7 ) 26 | volume -54.68dB ( EF ) 27 | volume -52.18dB ( E7 ) 28 | volume -49.68dB ( DF ) 29 | volume -48.43dB ( DB ) 30 | volume -47.18dB ( D7 ) 31 | volume -45.93dB ( D3 ) 32 | volume -44.68dB ( CF ) 33 | volume -43.43dB ( CB ) 34 | volume -42.18dB ( C7 ) 35 | volume -40.93dB ( C3 ) 36 | volume -39.68dB ( BF ) 37 | volume -38.43dB ( BB ) 38 | volume -37.18dB ( B7 ) 39 | volume -35.93dB ( B3 ) 40 | volume -34.68dB ( AF ) 41 | volume -33.43dB ( AB ) 42 | volume -32.18dB ( A7 ) 43 | volume -30.93dB ( A3 ) 44 | volume -30.31dB ( A1 ) 45 | volume -29.68dB ( 9F ) 46 | volume -29.06dB ( 9D ) 47 | volume -28.43dB ( 9B ) 48 | volume -27.81dB ( 99 ) 49 | volume -27.18dB ( 97 ) 50 | volume -26.56dB ( 95 ) 51 | volume -25.93dB ( 93 ) 52 | volume -25.31dB ( 91 ) 53 | volume -24.68dB ( 8F ) 54 | volume -24.06dB ( 8D ) 55 | volume -23.43dB ( 8B ) 56 | volume -22.81dB ( 89 ) 57 | volume -22.18dB ( 87 ) 58 | volume -21.25dB ( 84 ) 59 | << 60 | button release 61 | volume -26.25dB ( 94 ) 62 | volume -31.25dB ( A4 ) 63 | volume -36.25dB ( B4 ) 64 | volume -41.25dB ( C4 ) 65 | volume -46.25dB ( D4 ) 66 | volume -48.75dB ( DC ) 67 | volume -51.25dB ( E4 ) 68 | volume -53.75dB ( EC ) 69 | volume -56.25dB ( F4 ) 70 | volume -59.68dB ( FF ) 71 | Bass: 0dB, Trebble: 0dB 72 | Mute: Soft Mute with fast slope (I = Imax) 73 | Zero Crossing Mute Off 74 | 160mV ZC Window Threshold (WIN = 00) 75 | Symmetrical Bass Cut 76 | << 77 | button release 78 | Mute: Zero Crossing Mute Off 79 | 160mV ZC Window Threshold (WIN = 00) 80 | Symmetrical Bass Cut 81 | Bass: 6dB, Trebble: 12dB 82 | volume -59.68dB ( FF ) 83 | volume -57.18dB ( F7 ) 84 | volume -54.68dB ( EF ) 85 | volume -52.18dB ( E7 ) 86 | volume -49.68dB ( DF ) 87 | volume -48.43dB ( DB ) 88 | volume -47.18dB ( D7 ) 89 | volume -45.93dB ( D3 ) 90 | volume -44.68dB ( CF ) 91 | volume -43.43dB ( CB ) 92 | volume -42.18dB ( C7 ) 93 | volume -40.93dB ( C3 ) 94 | volume -39.68dB ( BF ) 95 | volume -38.43dB ( BB ) 96 | volume -37.18dB ( B7 ) 97 | volume -35.93dB ( B3 ) 98 | volume -34.68dB ( AF ) 99 | volume -33.43dB ( AB ) 100 | volume -32.18dB ( A7 ) 101 | volume -30.93dB ( A3 ) 102 | volume -30.31dB ( A1 ) 103 | volume -29.68dB ( 9F ) 104 | volume -29.06dB ( 9D ) 105 | volume -28.43dB ( 9B ) 106 | volume -27.81dB ( 99 ) 107 | volume -27.18dB ( 97 ) 108 | volume -26.56dB ( 95 ) 109 | volume -25.93dB ( 93 ) 110 | volume -25.31dB ( 91 ) 111 | volume -24.68dB ( 8F ) 112 | volume -24.06dB ( 8D ) 113 | volume -23.43dB ( 8B ) 114 | volume -22.81dB ( 89 ) 115 | volume -22.18dB ( 87 ) 116 | volume -21.25dB ( 84 ) 117 | -------------------------------------------------------------------------------- /audi_volume_fix/TAPE_REVERSE.txt: -------------------------------------------------------------------------------- 1 | REV 2 | volume -26.25dB ( 94 ) 3 | volume -31.25dB ( A4 ) 4 | volume -36.25dB ( B4 ) 5 | volume -41.25dB ( C4 ) 6 | volume -46.25dB ( D4 ) 7 | volume -48.75dB ( DC ) 8 | volume -51.25dB ( E4 ) 9 | volume -53.75dB ( EC ) 10 | volume -56.25dB ( F4 ) 11 | volume -59.68dB ( FF ) 12 | Bass: 0dB, Trebble: 0dB 13 | Mute: Soft Mute with fast slope (I = Imax) 14 | Zero Crossing Mute Off 15 | 160mV ZC Window Threshold (WIN = 00) 16 | Symmetrical Bass Cut 17 | button release 18 | Mute: Zero Crossing Mute Off 19 | 160mV ZC Window Threshold (WIN = 00) 20 | Symmetrical Bass Cut 21 | Bass: 6dB, Trebble: 12dB 22 | volume -59.68dB ( FF ) 23 | volume -57.18dB ( F7 ) 24 | volume -54.68dB ( EF ) 25 | volume -52.18dB ( E7 ) 26 | volume -49.68dB ( DF ) 27 | volume -48.43dB ( DB ) 28 | volume -47.18dB ( D7 ) 29 | volume -45.93dB ( D3 ) 30 | volume -44.68dB ( CF ) 31 | volume -43.43dB ( CB ) 32 | volume -42.18dB ( C7 ) 33 | volume -40.93dB ( C3 ) 34 | volume -39.68dB ( BF ) 35 | volume -38.43dB ( BB ) 36 | volume -37.18dB ( B7 ) 37 | volume -35.93dB ( B3 ) 38 | volume -34.68dB ( AF ) 39 | volume -33.43dB ( AB ) 40 | volume -32.18dB ( A7 ) 41 | volume -30.93dB ( A3 ) 42 | volume -30.31dB ( A1 ) 43 | volume -29.68dB ( 9F ) 44 | volume -29.06dB ( 9D ) 45 | volume -28.43dB ( 9B ) 46 | volume -27.81dB ( 99 ) 47 | volume -27.18dB ( 97 ) 48 | volume -26.56dB ( 95 ) 49 | volume -25.93dB ( 93 ) 50 | volume -25.31dB ( 91 ) 51 | volume -24.68dB ( 8F ) 52 | volume -24.06dB ( 8D ) 53 | volume -23.43dB ( 8B ) 54 | volume -22.81dB ( 89 ) 55 | volume -22.18dB ( 87 ) 56 | volume -21.25dB ( 84 ) 57 | volume -26.25dB ( 94 ) 58 | volume -31.25dB ( A4 ) 59 | volume -36.25dB ( B4 ) 60 | volume -41.25dB ( C4 ) 61 | volume -46.25dB ( D4 ) 62 | volume -48.75dB ( DC ) 63 | volume -51.25dB ( E4 ) 64 | volume -53.75dB ( EC ) 65 | volume -56.25dB ( F4 ) 66 | volume -59.68dB ( FF ) 67 | Bass: 0dB, Trebble: 0dB 68 | Mute: Soft Mute with fast slope (I = Imax) 69 | Zero Crossing Mute Off 70 | 160mV ZC Window Threshold (WIN = 00) 71 | Symmetrical Bass Cut 72 | Input selector: FM / AM selected (IN1) 73 | Mute: Zero Crossing Mute Off 74 | 160mV ZC Window Threshold (WIN = 00) 75 | Symmetrical Bass Cut 76 | Loudness: - 17.5000000000dB 77 | Bass: 0dB, Trebble: 0dB 78 | volume -57.18dB ( F7 ) 79 | Loudness: - 16.2500000000dB 80 | volume -54.68dB ( EF ) 81 | Loudness: - 15.0000000000dB 82 | volume -52.18dB ( E7 ) 83 | Loudness: - 13.7500000000dB 84 | volume -49.68dB ( DF ) 85 | Loudness: - 12.5000000000dB 86 | volume -47.18dB ( D7 ) 87 | Loudness: - 11.2500000000dB 88 | volume -45.93dB ( D3 ) 89 | Loudness: - 10.0000000000dB 90 | volume -44.68dB ( CF ) 91 | Loudness: - 8.7500000000dB 92 | volume -43.43dB ( CB ) 93 | Loudness: - 7.5000000000dB 94 | volume -42.18dB ( C7 ) 95 | Loudness: - 6.2500000000dB 96 | volume -40.93dB ( C3 ) 97 | Loudness: - 5.0000000000dB 98 | volume -39.68dB ( BF ) 99 | Loudness: - 3.7500000000dB 100 | volume -38.43dB ( BB ) 101 | Loudness: - 2.5000000000dB 102 | volume -37.18dB ( B7 ) 103 | Loudness: - 1.2500000000dB 104 | volume -35.93dB ( B3 ) 105 | Loudness: - 0.0000000000dB 106 | volume -34.68dB ( AF ) 107 | volume -33.43dB ( AB ) 108 | volume -32.18dB ( A7 ) 109 | volume -30.93dB ( A3 ) 110 | volume -29.68dB ( 9F ) 111 | volume -28.43dB ( 9B ) 112 | volume -27.18dB ( 97 ) 113 | volume -26.56dB ( 95 ) 114 | volume -25.93dB ( 93 ) 115 | volume -25.31dB ( 91 ) 116 | volume -24.68dB ( 8F ) 117 | volume -24.06dB ( 8D ) 118 | volume -23.43dB ( 8B ) 119 | volume -22.81dB ( 89 ) 120 | volume -22.18dB ( 87 ) 121 | volume -21.56dB ( 85 ) 122 | volume -20.93dB ( 83 ) 123 | volume -20.31dB ( 81 ) 124 | volume -19.68dB ( 7F ) 125 | volume -19.06dB ( 7D ) 126 | volume -18.43dB ( 7B ) 127 | volume -17.50dB ( 78 ) 128 | volume -25.00dB ( 90 ) 129 | volume -30.00dB ( A0 ) 130 | volume -35.00dB ( B0 ) 131 | volume -40.00dB ( C0 ) 132 | volume -45.00dB ( D0 ) 133 | volume -47.50dB ( D8 ) 134 | volume -50.00dB ( E0 ) 135 | volume -52.50dB ( E8 ) 136 | volume -55.00dB ( F0 ) 137 | volume -57.50dB ( F8 ) 138 | volume -59.68dB ( FF ) 139 | Bass: 0dB, Trebble: 0dB 140 | Mute: Soft Mute with fast slope (I = Imax) 141 | Zero Crossing Mute Off 142 | 160mV ZC Window Threshold (WIN = 00) 143 | Symmetrical Bass Cut 144 | Input selector: TAPE selected (IN2) 145 | Mute: Zero Crossing Mute Off 146 | 160mV ZC Window Threshold (WIN = 00) 147 | Symmetrical Bass Cut 148 | Loudness: - 18.7500000000dB 149 | Bass: 6dB, Trebble: 12dB 150 | volume -59.68dB ( FF ) 151 | volume -57.18dB ( F7 ) 152 | volume -54.68dB ( EF ) 153 | volume -52.18dB ( E7 ) 154 | volume -49.68dB ( DF ) 155 | volume -48.43dB ( DB ) 156 | volume -47.18dB ( D7 ) 157 | volume -45.93dB ( D3 ) 158 | volume -44.68dB ( CF ) 159 | volume -43.43dB ( CB ) 160 | volume -42.18dB ( C7 ) 161 | volume -40.93dB ( C3 ) 162 | volume -39.68dB ( BF ) 163 | volume -38.43dB ( BB ) 164 | volume -37.18dB ( B7 ) 165 | volume -35.93dB ( B3 ) 166 | volume -34.68dB ( AF ) 167 | volume -33.43dB ( AB ) 168 | volume -32.18dB ( A7 ) 169 | volume -30.93dB ( A3 ) 170 | volume -30.31dB ( A1 ) 171 | volume -29.68dB ( 9F ) 172 | volume -29.06dB ( 9D ) 173 | volume -28.43dB ( 9B ) 174 | volume -27.81dB ( 99 ) 175 | volume -27.18dB ( 97 ) 176 | volume -26.56dB ( 95 ) 177 | volume -25.93dB ( 93 ) 178 | volume -25.31dB ( 91 ) 179 | volume -24.68dB ( 8F ) 180 | volume -24.06dB ( 8D ) 181 | volume -23.43dB ( 8B ) 182 | volume -22.81dB ( 89 ) 183 | volume -22.18dB ( 87 ) 184 | volume -21.25dB ( 84 ) 185 | -------------------------------------------------------------------------------- /audi_volume_fix/enable12V.txt: -------------------------------------------------------------------------------- 1 | volume -59.68dB ( FF ) 2 | Bass: 0dB, Trebble: 0dB 3 | Mute: Soft Mute with fast slope (I = Imax) 4 | Zero Crossing Mute Off 5 | 160mV ZC Window Threshold (WIN = 00) 6 | Symmetrical Bass Cut 7 | Input selector: CD selected (0dB diferential input gain (IN3)) 8 | Bass: 0dB, Trebble: 0dB 9 | Mute: Soft Mute with fast slope (I = Imax) 10 | Zero Crossing Mute Off 11 | 160mV ZC Window Threshold (WIN = 00) 12 | Symmetrical Bass Cut 13 | Bass: 6dB, Trebble: 12dB 14 | volume -59.68dB ( FF ) 15 | Speaker Attenuator left front: Muted 16 | Speaker Attenuator left rear: 0.00dB 17 | Speaker Attenuator right front: Muted 18 | Speaker Attenuator left rear: 0.00dB 19 | Bass: 0dB, Trebble: 0dB 20 | Mute: Soft Mute with fast slope (I = Imax) 21 | Zero Crossing Mute Off 22 | 160mV ZC Window Threshold (WIN = 00) 23 | Symmetrical Bass Cut 24 | Input selector: CD selected (0dB diferential input gain (IN3)) 25 | -------------------------------------------------------------------------------- /audi_volume_fix/fix_module_by_tomcad2.txt: -------------------------------------------------------------------------------- 1 | hello 2 | Input selector: FM/AM selected (IN1) 3 | Loudness: -16.2500000000dB 4 | volume -6.25dB ( 54 ) 5 | Bass: 4dB, Trebble: -2dB 6 | Speaker Attenuator left front: 0.00dB 7 | Speaker Attenuator left rear: 0.00dB 8 | Speaker Attenuator right front: 0.00dB 9 | Speaker Attenuator left rear: 0.00dB 10 | Mute: Soft Mute with slow slope (I = Imin) 11 | Zero Crossing Mute On 12 | 160mV ZC Window Threshold (WIN = 00) 13 | Nonsymmetrical Bass Cut 14 | 15 | 16 | 17 | 18 | 19 | powerup 20 | 21 | Input selector: FM/AM selected (IN1) 22 | Loudness: -16.2500000000dB 23 | volume -6.25dB ( 54 ) 24 | Bass: 4dB, Trebble: -2dB 25 | Speaker Attenuator left front: 0.00dB 26 | Speaker Attenuator left rear: 0.00dB 27 | Speaker Attenuator right front: 0.00dB 28 | Speaker Attenuator left rear: 0.00dB 29 | Mute: Soft Mute with slow slope (I = Imin) 30 | Zero Crossing Mute On 31 | 160mV ZC Window Threshold (WIN = 00) 32 | Nonsymmetrical Bass Cut 33 | 34 | 35 | mode: 36 | 37 | ->TAPE->CD nothign here.... 38 | 39 | 40 | radio selected... 41 | 42 | 43 | bass: 44 | Bass: 6dB, Trebble: -2dB 45 | Bass: 8dB, Trebble: -2dB 46 | Bass: 10dB, Trebble: -2dB 47 | Bass: 12dB, Trebble: -2dB 48 | Bass: 14dB, Trebble: -2dB 49 | Bass: 14dB, Trebble: -2dB 50 | Bass: 14dB, Trebble: -2dB 51 | Bass: 14dB, Trebble: -2dB 52 | Bass: 14dB, Trebble: -2dB 53 | Bass: 12dB, Trebble: -2dB 54 | Bass: 10dB, Trebble: -2dB 55 | Bass: 8dB, Trebble: -2dB 56 | Bass: 6dB, Trebble: -2dB 57 | Bass: 4dB, Trebble: -2dB 58 | Bass: 2dB, Trebble: -2dB 59 | Bass: 0dB, Trebble: -2dB 60 | Bass: 0dB, Trebble: 0dB 61 | Bass: 0dB, Trebble: 2dB 62 | Bass: 0dB, Trebble: 4dB 63 | Bass: 0dB, Trebble: 6dB 64 | Bass: 0dB, Trebble: 8dB 65 | Bass: 0dB, Trebble: 10dB 66 | Bass: 0dB, Trebble: 12dB 67 | 68 | 69 | 70 | 71 | 72 | 73 | Input selector: TAPE selected (IN2) 74 | Input selector: FM/AM selected (IN1) 75 | Input selector: TAPE selected (IN2) 76 | Input selector: FM/AM selected (IN1) 77 | Input selector: TAPE selected (IN2) 78 | Input selector: FM/AM selected (IN1) 79 | Input selector: TAPE selected (IN2) 80 | Input selector: FM/AM selected (IN1) 81 | 82 | 83 | still pushing just FM..... and look: 84 | 85 | Input selector: TAPE selected (IN2) 86 | Input selector: FM/AM selected (IN1) 87 | Input selector: TAPE selected (IN2) 88 | Input selector: FM/AM selected (IN1) 89 | Input selector: TAPE selected (IN2) 90 | Input selector: FM/AM selected (IN1) 91 | Input selector: TAPE selected (IN2) 92 | Input selector: FM/AM selected (IN1) 93 | Input selector: TAPE selected (IN2) 94 | Input selector: FM/AM selected (IN1) 95 | Input selector: TAPE selected (IN2) 96 | Input selector: FM/AM selected (IN1) 97 | Input selector: TAPE selected (IN2) 98 | Input selector: FM/AM selected (IN1) 99 | fucked .... 100 | 101 | grrr 102 | -------------------------------------------------------------------------------- /audi_volume_fix/fix_module_by_tomcad3.txt: -------------------------------------------------------------------------------- 1 | Input selector: FM/AM selected (IN1) 2 | Loudness: -16.2500000000dB 3 | volume -6.25dB ( 54 ) 4 | Bass: 4dB, Trebble: -2dB 5 | Speaker Attenuator left front: 0.00dB 6 | Speaker Attenuator left rear: 0.00dB 7 | Speaker Attenuator right front: 0.00dB 8 | Speaker Attenuator left rear: 0.00dB 9 | Mute: Soft Mute with slow slope (I = Imin) 10 | Zero Crossing Mute On 11 | 160mV ZC Window Threshold (WIN = 00) 12 | Nonsymmetrical Bass Cut 13 | 14 | 15 | so, TAPE DRIVE INSTALED ... just in case it will change something :D 16 | 17 | powering up: 18 | 19 | Input selector: FM/AM selected (IN1) 20 | Loudness: -16.2500000000dB 21 | volume -6.25dB ( 54 ) 22 | Bass: 4dB, Trebble: -2dB 23 | Speaker Attenuator left front: 0.00dB 24 | Speaker Attenuator left rear: 0.00dB 25 | Speaker Attenuator right front: 0.00dB 26 | Speaker Attenuator left rear: 0.00dB 27 | Mute: Soft Mute with slow slope (I = Imin) 28 | Zero Crossing Mute On 29 | 160mV ZC Window Threshold (WIN = 00) 30 | Nonsymmetrical Bass Cut 31 | 32 | MODE: 33 | cd selected ...nothing here :/ 34 | 35 | FM: again, nothing here: 36 | 37 | .... ok trying to fake pushing button for emulating inserting real tape: 38 | 39 | TAPE selected, display show: tape: ..... nothing here again... going for mode button: 40 | 41 | we are in CD and nothing here :( 42 | 43 | fm, nothing here:/ 44 | 45 | 46 | 47 | is this still working? : 48 | 49 | 50 | Loudness: -15.0000000000dB 51 | volume -5.00dB ( 50 ) 52 | Loudness: -13.7500000000dB 53 | volume -3.75dB ( 4C ) 54 | Loudness: -12.5000000000dB 55 | volume -2.50dB ( 48 ) 56 | Loudness: -11.2500000000dB 57 | volume -1.25dB ( 44 ) 58 | Loudness: -10.0000000000dB 59 | volume 0.00dB ( 40 ) 60 | Loudness: -11.2500000000dB 61 | volume -1.25dB ( 44 ) 62 | Loudness: -12.5000000000dB 63 | volume -2.50dB ( 48 ) 64 | Loudness: -13.7500000000dB 65 | volume -3.75dB ( 4C ) 66 | Loudness: -15.0000000000dB 67 | volume -5.00dB ( 50 ) 68 | Loudness: -16.2500000000dB 69 | volume -6.25dB ( 54 ) 70 | Loudness: -17.5000000000dB 71 | volume -7.50dB ( 58 ) 72 | Loudness: -18.7500000000dB 73 | volume -8.75dB ( 5C ) 74 | 75 | 76 | shure we are grabing i2c, no problem..... so input selecting is not supported.... 77 | 78 | 79 | --- exit --- 80 | 81 | -------------------------------------------------------------------------------- /audi_volume_fix/poweron.txt: -------------------------------------------------------------------------------- 1 | Bass: 0dB, Trebble: 0dB 2 | Mute: Soft Mute with fast slope (I = Imax) 3 | Zero Crossing Mute Off 4 | 160mV ZC Window Threshold (WIN = 00) 5 | Symmetrical Bass Cut 6 | uknown25 7 | volume -59.68dB ( FF ) 8 | Speaker Attenuator left front: Muted 9 | Speaker Attenuator left rear: 0.00dB 10 | Speaker Attenuator right front: Muted 11 | Speaker Attenuator left rear: 0.00dB 12 | Bass: 0dB, Trebble: 0dB 13 | Mute: Soft Mute with fast slope (I = Imax) 14 | Zero Crossing Mute Off 15 | 160mV ZC Window Threshold (WIN = 00) 16 | Symmetrical Bass Cut 17 | Input selector: CD selected (0dB diferential input gain (IN3)) 18 | Input selector: FM / AM selected (IN1) 19 | Mute: Zero Crossing Mute Off 20 | 160mV ZC Window Threshold (WIN = 00) 21 | Symmetrical Bass Cut 22 | volume -59.68dB ( FF ) 23 | Speaker Attenuator left front: Muted 24 | Speaker Attenuator left rear: 0.00dB 25 | Speaker Attenuator right front: Muted 26 | Speaker Attenuator left rear: 0.00dB 27 | Bass: 0dB, Trebble: 0dB 28 | Mute: Soft Mute with fast slope (I = Imax) 29 | Zero Crossing Mute Off 30 | 160mV ZC Window Threshold (WIN = 00) 31 | Symmetrical Bass Cut 32 | Mute: Zero Crossing Mute Off 33 | 160mV ZC Window Threshold (WIN = 00) 34 | Symmetrical Bass Cut 35 | Loudness: - 17.5000000000dB 36 | Bass: 6dB, Trebble: 12dB 37 | volume -59.68dB ( FF ) 38 | Loudness: - 18.7500000000dB 39 | volume -59.68dB ( FF ) 40 | volume -59.68dB ( FF ) 41 | volume -59.68dB ( FF ) 42 | volume -59.06dB ( FD ) 43 | volume -58.43dB ( FB ) 44 | volume -57.81dB ( F9 ) 45 | volume -57.18dB ( F7 ) 46 | volume -56.56dB ( F5 ) 47 | volume -55.93dB ( F3 ) 48 | volume -55.31dB ( F1 ) 49 | volume -54.68dB ( EF ) 50 | volume -53.75dB ( EC ) 51 | -------------------------------------------------------------------------------- /audi_volume_fix/volumeDOWM.txt: -------------------------------------------------------------------------------- 1 | Knob - 2 | volume 13.75dB ( 14 ) 3 | Knob - 4 | volume 12.50dB ( 18 ) 5 | Knob - 6 | volume 11.25dB ( 1C ) 7 | Knob - 8 | volume 10.00dB ( 20 ) 9 | Knob - 10 | volume 8.75dB ( 24 ) 11 | Knob - 12 | volume 7.50dB ( 28 ) 13 | Knob - 14 | volume 6.25dB ( 2C ) 15 | Knob - 16 | volume 5.00dB ( 30 ) 17 | Knob - 18 | volume 3.75dB ( 34 ) 19 | Knob - 20 | volume 2.50dB ( 38 ) 21 | Knob - 22 | volume 1.25dB ( 3C ) 23 | Knob - 24 | volume 0.00dB ( 40 ) 25 | Knob - 26 | Loudness: - 8.7500000000dB 27 | volume -1.25dB ( 44 ) 28 | Knob - 29 | Loudness: - 10.0000000000dB 30 | volume -2.50dB ( 48 ) 31 | Knob - 32 | Loudness: - 11.2500000000dB 33 | volume -3.75dB ( 4C ) 34 | Knob - 35 | Loudness: - 12.5000000000dB 36 | volume -5.00dB ( 50 ) 37 | Knob - 38 | Loudness: - 13.7500000000dB 39 | volume -6.25dB ( 54 ) 40 | Knob - 41 | Loudness: - 15.0000000000dB 42 | volume -7.50dB ( 58 ) 43 | Knob - 44 | Loudness: - 16.2500000000dB 45 | volume -8.75dB ( 5C ) 46 | Knob - 47 | Loudness: - 17.5000000000dB 48 | volume -10.00dB ( 60 ) 49 | Knob - 50 | Loudness: - 18.7500000000dB 51 | volume -12.50dB ( 68 ) 52 | Knob - 53 | volume -16.25dB ( 74 ) 54 | Knob - 55 | volume -21.25dB ( 84 ) 56 | Knob - 57 | volume -26.25dB ( 94 ) 58 | Knob - 59 | volume -31.25dB ( A4 ) 60 | Knob - 61 | volume -31.87dB ( A6 ) 62 | volume -32.50dB ( A8 ) 63 | volume -38.75dB ( BC ) 64 | Knob - 65 | volume -39.37dB ( BE ) 66 | volume -40.00dB ( C0 ) 67 | volume -46.25dB ( D4 ) 68 | Knob - 69 | volume -46.87dB ( D6 ) 70 | volume -47.50dB ( D8 ) 71 | volume -53.75dB ( EC ) 72 | Knob - 73 | volume -54.37dB ( EE ) 74 | volume -55.00dB ( F0 ) 75 | volume -59.68dB ( FF ) 76 | Knob - 77 | volume -59.68dB ( FF ) 78 | Bass: 0dB, Trebble: 0dB 79 | Mute: Soft Mute with fast slope (I = Imax) 80 | Zero Crossing Mute Off 81 | 160mV ZC Window Threshold (WIN = 00) 82 | Symmetrical Bass Cut 83 | Knob - 84 | Knob - 85 | Knob - 86 | Knob - 87 | Knob - 88 | -------------------------------------------------------------------------------- /audi_volume_fix/volumeUP.txt: -------------------------------------------------------------------------------- 1 | Knob + 2 | Mute: Zero Crossing Mute Off 3 | 160mV ZC Window Threshold (WIN = 00) 4 | Symmetrical Bass Cut 5 | Bass: 6dB, Trebble: 12dB 6 | volume -59.68dB ( FF ) 7 | Knob + 8 | volume -59.68dB ( FF ) 9 | volume -59.68dB ( FF ) 10 | volume -59.37dB ( FE ) 11 | volume -58.75dB ( FC ) 12 | volume -58.12dB ( FA ) 13 | volume -57.50dB ( F8 ) 14 | volume -56.87dB ( F6 ) 15 | volume -56.25dB ( F4 ) 16 | volume -55.62dB ( F2 ) 17 | volume -55.00dB ( F0 ) 18 | volume -54.37dB ( EE ) 19 | volume -53.75dB ( EC ) 20 | Knob + 21 | volume -53.12dB ( EA ) 22 | volume -52.50dB ( E8 ) 23 | volume -51.87dB ( E6 ) 24 | volume -51.25dB ( E4 ) 25 | volume -50.62dB ( E2 ) 26 | volume -50.00dB ( E0 ) 27 | volume -49.37dB ( DE ) 28 | volume -48.75dB ( DC ) 29 | volume -48.12dB ( DA ) 30 | volume -47.50dB ( D8 ) 31 | volume -46.87dB ( D6 ) 32 | volume -46.25dB ( D4 ) 33 | Knob + 34 | volume -45.62dB ( D2 ) 35 | volume -45.00dB ( D0 ) 36 | volume -44.37dB ( CE ) 37 | volume -43.75dB ( CC ) 38 | volume -43.12dB ( CA ) 39 | volume -42.50dB ( C8 ) 40 | volume -41.87dB ( C6 ) 41 | volume -41.25dB ( C4 ) 42 | volume -40.62dB ( C2 ) 43 | volume -40.00dB ( C0 ) 44 | volume -39.37dB ( BE ) 45 | volume -38.75dB ( BC ) 46 | Knob + 47 | volume -38.12dB ( BA ) 48 | volume -37.50dB ( B8 ) 49 | volume -36.87dB ( B6 ) 50 | volume -36.25dB ( B4 ) 51 | volume -35.62dB ( B2 ) 52 | volume -35.00dB ( B0 ) 53 | volume -34.37dB ( AE ) 54 | volume -33.75dB ( AC ) 55 | volume -33.12dB ( AA ) 56 | volume -32.50dB ( A8 ) 57 | volume -31.87dB ( A6 ) 58 | volume -31.25dB ( A4 ) 59 | Knob + 60 | volume -30.62dB ( A2 ) 61 | volume -30.00dB ( A0 ) 62 | volume -29.37dB ( 9E ) 63 | volume -28.75dB ( 9C ) 64 | volume -28.12dB ( 9A ) 65 | volume -27.50dB ( 98 ) 66 | volume -26.87dB ( 96 ) 67 | volume -26.25dB ( 94 ) 68 | Knob + 69 | volume -25.62dB ( 92 ) 70 | volume -25.00dB ( 90 ) 71 | volume -24.37dB ( 8E ) 72 | volume -23.75dB ( 8C ) 73 | volume -23.12dB ( 8A ) 74 | volume -22.50dB ( 88 ) 75 | volume -21.87dB ( 86 ) 76 | volume -21.25dB ( 84 ) 77 | Knob + 78 | volume -20.62dB ( 82 ) 79 | volume -20.00dB ( 80 ) 80 | volume -19.37dB ( 7E ) 81 | volume -18.75dB ( 7C ) 82 | volume -18.12dB ( 7A ) 83 | volume -17.50dB ( 78 ) 84 | volume -16.87dB ( 76 ) 85 | volume -16.25dB ( 74 ) 86 | Knob + 87 | volume -15.62dB ( 72 ) 88 | volume -15.00dB ( 70 ) 89 | volume -14.37dB ( 6E ) 90 | volume -13.75dB ( 6C ) 91 | volume -13.12dB ( 6A ) 92 | volume -12.50dB ( 68 ) 93 | Knob + 94 | Loudness: - 17.5000000000dB 95 | volume -11.87dB ( 66 ) 96 | volume -11.25dB ( 64 ) 97 | volume -10.62dB ( 62 ) 98 | volume -10.00dB ( 60 ) 99 | Knob + 100 | Loudness: - 16.2500000000dB 101 | volume -9.37dB ( 5E ) 102 | volume -8.75dB ( 5C ) 103 | Knob + 104 | Loudness: - 15.0000000000dB 105 | volume -8.12dB ( 5A ) 106 | volume -7.50dB ( 58 ) 107 | Knob + 108 | Loudness: - 13.7500000000dB 109 | volume -6.87dB ( 56 ) 110 | volume -6.25dB ( 54 ) 111 | Knob + 112 | Loudness: - 12.5000000000dB 113 | volume -5.62dB ( 52 ) 114 | volume -5.00dB ( 50 ) 115 | Knob + 116 | Loudness: - 11.2500000000dB 117 | volume -4.37dB ( 4E ) 118 | volume -3.75dB ( 4C ) 119 | Knob + 120 | Loudness: - 10.0000000000dB 121 | volume -3.12dB ( 4A ) 122 | volume -2.50dB ( 48 ) 123 | Knob + 124 | Loudness: - 8.7500000000dB 125 | volume -1.87dB ( 46 ) 126 | volume -1.25dB ( 44 ) 127 | Knob + 128 | Loudness: - 7.5000000000dB 129 | volume -0.62dB ( 42 ) 130 | volume 0.00dB ( 40 ) 131 | Knob + 132 | volume 0.63dB ( 3E ) 133 | volume 1.25dB ( 3C ) 134 | Knob + 135 | volume 1.88dB ( 3A ) 136 | volume 2.50dB ( 38 ) 137 | Knob + 138 | volume 3.13dB ( 36 ) 139 | volume 3.75dB ( 34 ) 140 | Knob + 141 | volume 4.38dB ( 32 ) 142 | volume 5.00dB ( 30 ) 143 | Knob + 144 | volume 5.63dB ( 2E ) 145 | volume 6.25dB ( 2C ) 146 | Knob + 147 | volume 6.88dB ( 2A ) 148 | volume 7.50dB ( 28 ) 149 | Knob + 150 | volume 8.13dB ( 26 ) 151 | volume 8.75dB ( 24 ) 152 | Knob + 153 | volume 9.38dB ( 22 ) 154 | volume 10.00dB ( 20 ) 155 | Knob + 156 | volume 10.63dB ( 1E ) 157 | volume 11.25dB ( 1C ) 158 | Knob + 159 | volume 11.88dB ( 1A ) 160 | volume 12.50dB ( 18 ) 161 | Knob + 162 | volume 13.13dB ( 16 ) 163 | volume 13.75dB ( 14 ) 164 | Knob + 165 | volume 14.38dB ( 12 ) 166 | volume 15.00dB ( 10 ) 167 | Knob + 168 | Knob + 169 | Knob + 170 | Knob + 171 | Knob + 172 | Knob + 173 | Knob + 174 | Knob + 175 | -------------------------------------------------------------------------------- /char_fix_radio_mode_moped/VAGFISReader.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * (C) Tomas Kovacik 3 | * https://github.com/tomaskovacik/ 4 | * GNU GPL3 5 | * 6 | * tested on stm32,atmega328 7 | */ 8 | 9 | /* info from passatworld.ru regarding 3lb: 10 | Data transmission is carried out on 3 lines (Data, Clock, Enable). Working voltage on 5V lines. 11 | Data and Clock lines are unidirectional, line management is performed by the master device. The default lines are high. 12 | The lines Data and Clock use negative logic, i.e. the logical unit corresponds to the low level on the line, the high level on the line corresponds to the logical zero. 13 | The Enable line is bi-directional, the master device initiates the transfer, the slave device confirms reception and is ready to receive the next data piece. The default line is low. 14 | The initiation of transmission and confirmation is carried out by a high level on the line. 15 | 16 | The transmission speed is up to ~ 125-130kHz. 17 | On the bus there is a master and slave device. The dashboard always acts as a slave. 18 | Transmission is carried out by packages. The size of the packet depends on the data transmitted (see part 2). 19 | 20 | The master device before the start of transmission looks at the presence of a low signal level on the Enable line. 21 | Having a high level indicates that the line is busy or the slave device can not currently receive data. 22 | 23 | The master device sets the Enable line to a high level and begins sending the first byte of the sending. 24 | The next data bit from the line is read when the clock signal goes from high to low (from logical zero to one). 25 | After transmission of the first byte, the master sets the low level on the Enable line and waits for the slave device to "raise" the Enable line, indicating that it is ready to receive the next byte. 26 | By taking another byte slave, the device "drops" the Enable line, and the master device waits for the Enable line to "rise" again to transmit the next byte. 27 | Thus, the Master controls the Enable line only when transmitting the first byte of each packet, and then only controls the presence on it of a high level of the speaker saying that the slave is ready to receive. 28 | In case the slave did not raise the Enable line to receive the next byte within ~ 150-200us, it's necessary to start sending the packet again after waiting at least 3-4ms. 29 | Do not raise the slave line Enable can also mean that the slave detected an error in the transmitted data and is not ready to continue receiving. 30 | 31 | There is one more option for data transfer in which the master raises the Enable line before starting the transfer and drops it only after the transfer of the entire packet. 32 | It is necessary to pause between bytes of approximately 80-100us. And also to pause at least 4-5ms between packets, especially if packets go on continuously. 33 | Unfortunately, in this mode, it is not possible to control the transmitted data. A slave may simply not accept the package, and the master will not know about it. 34 | */ 35 | 36 | #include "VAGFISReader.h" 37 | #include 38 | 39 | // do not forget to put pull down resistor on enable line 40 | // pull up on data/clk line is made usng internal pullup 41 | 42 | /** 43 | Constructor 44 | */ 45 | VAGFISReader::VAGFISReader(uint8_t clkPin, uint8_t dataPin, uint8_t enaPin) 46 | { 47 | FIS_READ_CLK = clkPin; 48 | FIS_READ_DATA = dataPin; 49 | FIS_READ_ENA = enaPin; 50 | } 51 | 52 | /** 53 | Destructor 54 | */ 55 | VAGFISReader::~VAGFISReader(){} 56 | 57 | void VAGFISReader::begin() 58 | { 59 | pinMode(FIS_READ_CLK,INPUT_PULLUP); 60 | pinMode(FIS_READ_DATA,INPUT_PULLUP); 61 | pinMode(FIS_READ_ENA,INPUT);//no pull up! this is inactive state low, active is high 62 | attachInterrupt(digitalPinToInterrupt(FIS_READ_ENA),&VAGFISReader::detectEnaLineRising,RISING); 63 | }; 64 | 65 | void VAGFISReader::readDataLine(){ //fired on falling edge 66 | // The lines Data and Clock use negative logic, i.e. the logical unit corresponds to the low level on the line, the high level on the line corresponds to the logical zero. 67 | newMsgFromRadio=0; 68 | if(digitalRead(FIS_READ_DATA)){ 69 | data[msgbit/8] = (data[msgbit/8]<<1); 70 | } 71 | else 72 | { 73 | data[msgbit/8] = (data[msgbit/8]<<1) | 1; 74 | } 75 | if(preNavi) { 76 | if (((msgbit+1)%8) == 0 ){ //each 8th bit we have to put ena low and back high.. 77 | digitalWrite(FIS_READ_ENA,LOW); 78 | delayMicroseconds(100); 79 | if(msgbit == 15){ //we know packet size, cose 2dn byte(data[1]) is size of packet 80 | packetSize = data[1] + 2; //+2 for id and actual packet with packet size 81 | } 82 | if ((msgbit+1) != packetSize*8){ 83 | digitalWrite(FIS_READ_ENA,HIGH); //based on data[1]+2 which is packet size +id+actual byte with packet size, we can calculate if we need another byte receive 84 | } else { 85 | detachInterrupt(digitalPinToInterrupt(FIS_READ_CLK)); 86 | digitalWrite(FIS_READ_ENA,LOW); 87 | pinMode(FIS_READ_ENA,INPUT); 88 | digitalWrite(FIS_READ_ENA,LOW); //pull down, just in case 89 | attachInterrupt(digitalPinToInterrupt(FIS_READ_ENA),&VAGFISReader::detectEnaLineRising,RISING); //standard start scenario 90 | msgbit=0; 91 | preNavi=0; 92 | if (checkData()) //check cksum... 93 | newMsgFromRadio=1; 94 | detachInterrupt(digitalPinToInterrupt(FIS_READ_CLK)); 95 | } 96 | // if (msgbit > packetSize*8){ 97 | // msgbit=0; 98 | // preNavi=0; 99 | // digitalWrite(FIS_READ_ENA,LOW); 100 | // attachInterrupt(digitalPinToInterrupt(FIS_READ_ENA),&VAGFISReader::detectEnaLineRising,RISING); //standard start scenario 101 | // detachInterrupt(digitalPinToInterrupt(FIS_READ_CLK)); 102 | // } 103 | } 104 | } 105 | msgbit++; 106 | } 107 | 108 | void VAGFISReader::detectEnaLineRising(){ 109 | if(digitalRead(FIS_READ_ENA)){ 110 | msgbit=0; 111 | newMsgFromRadio=0; 112 | navi=0; 113 | preNavi=0; 114 | 115 | attachInterrupt(digitalPinToInterrupt(FIS_READ_CLK),&VAGFISReader::readDataLine,FALLING);//data are valid on falling edge of FIS_READ_CLK 116 | attachInterrupt(digitalPinToInterrupt(FIS_READ_ENA),&VAGFISReader::detectEnaLineFalling,FALLING); //if enable changed to low, data on data line are no more valid 117 | } 118 | } 119 | 120 | void VAGFISReader::detectEnaLineFalling(){ 121 | if(!digitalRead(FIS_READ_ENA)){ 122 | detachInterrupt(digitalPinToInterrupt(FIS_READ_ENA)); 123 | detachInterrupt(digitalPinToInterrupt(FIS_READ_CLK)); 124 | packetSize=0; 125 | 126 | if(msgbit>0){ 127 | packetSize = msgbit/8; 128 | if (packetSize > 1){ //NAVI start with just 1 packet so if we have more then 1 here, we are safe to zero msbit variable 129 | if (checkData()) //check cksum... 130 | newMsgFromRadio=1; 131 | attachInterrupt(digitalPinToInterrupt(FIS_READ_ENA),&VAGFISReader::detectEnaLineRising,RISING); 132 | } 133 | else { 134 | if(!preNavi){ 135 | packetSize=0; 136 | attachInterrupt(digitalPinToInterrupt(FIS_READ_CLK),&VAGFISReader::readDataLine,FALLING);//data are valid on falling edge of FIS_READ_CLK 137 | preNavi=1; 138 | digitalWrite(FIS_READ_ENA,LOW); 139 | pinMode(FIS_READ_ENA,OUTPUT); 140 | digitalWrite(FIS_READ_ENA,LOW); 141 | delayMicroseconds(5); 142 | digitalWrite(FIS_READ_ENA,HIGH); 143 | } 144 | } 145 | } 146 | else { 147 | attachInterrupt(digitalPinToInterrupt(FIS_READ_ENA),&VAGFISReader::detectEnaLineRising,RISING); 148 | } 149 | } 150 | } 151 | 152 | bool VAGFISReader::hasNewMsg(){ 153 | return newMsgFromRadio; 154 | } 155 | 156 | void VAGFISReader::clearNewMsgFlag(){ 157 | newMsgFromRadio=0; 158 | } 159 | 160 | uint8_t VAGFISReader::readData(int8_t id){ 161 | return data[id]; 162 | } 163 | 164 | bool VAGFISReader::ACK(){ 165 | pinMode(FIS_READ_ENA,INPUT); 166 | if (!digitalRead(FIS_READ_ENA)) {//safe to ack/request another packet from radio 167 | detachInterrupt(digitalPinToInterrupt(FIS_READ_ENA)); 168 | pinMode(FIS_READ_ENA,OUTPUT); 169 | digitalWrite(FIS_READ_ENA,HIGH); 170 | delay(3); 171 | digitalWrite(FIS_READ_ENA,LOW); 172 | pinMode(FIS_READ_ENA,INPUT); 173 | attachInterrupt(digitalPinToInterrupt(FIS_READ_ENA),&VAGFISReader::detectEnaLineRising,RISING); 174 | return true; 175 | } else { 176 | attachInterrupt(digitalPinToInterrupt(FIS_READ_ENA),&VAGFISReader::detectEnaLineRising,RISING); 177 | return false; 178 | } 179 | } 180 | 181 | bool VAGFISReader::msgIsNavi(){ 182 | return navi; 183 | } 184 | 185 | 186 | bool VAGFISReader::checkData(){ 187 | if (packetSize == 18 && data[0] == 0xF0){ // radio mode 188 | navi = 0; 189 | if(calcChecksum()) return true; 190 | } else { 191 | navi=1; 192 | if (calcChecksum()) return true; 193 | } 194 | return false; 195 | } 196 | 197 | uint8_t VAGFISReader::getMsgId(){ 198 | return data[0]; 199 | } 200 | 201 | uint8_t VAGFISReader::getSize(){ 202 | return packetSize; 203 | } 204 | 205 | bool VAGFISReader::calcChecksum(){ 206 | 207 | uint8_t tmp=0; 208 | if (!navi){ 209 | for (uint8_t i=0;i<17;i++){ 210 | tmp=tmp+data[i]; 211 | } 212 | if (data[packetSize-1] == ((0xFF ^ tmp ) & 0xFF)){ 213 | return true;} 214 | } else { //navi 215 | for (uint8_t i=0;i 164 | #include 165 | volatile static uint16_t msgbit; 166 | volatile static uint8_t navi=0; 167 | volatile static uint8_t newMsgFromRadio=0; 168 | volatile static uint8_t packetSize=0; 169 | volatile static uint8_t preNavi=0; 170 | volatile static uint8_t data[64] ; 171 | static uint8_t FIS_READ_CLK; 172 | static uint8_t FIS_READ_DATA; 173 | static uint8_t FIS_READ_ENA; 174 | 175 | class VAGFISReader 176 | { 177 | public: 178 | VAGFISReader(uint8_t clkPin, uint8_t dataPin, uint8_t enaPin); 179 | ~VAGFISReader(); 180 | void begin(); 181 | uint8_t readData(int8_t id); 182 | bool hasNewMsg(); 183 | bool msgIsNavi(); 184 | void clearNewMsgFlag(); 185 | bool ACK(); //3ms pulse on ENA line by cluster to ACK received packet 186 | uint8_t getMsgId(); 187 | uint8_t getSize(); 188 | static bool checkData(); 189 | static bool calcChecksum(); 190 | static uint8_t getChecksum(); 191 | bool msgIsRadioText(); 192 | bool msgIsText(); 193 | bool msgIsGraphics(); 194 | bool msgIsInit(); 195 | bool msgIsKeepAlive(); 196 | bool _wait(); 197 | bool _continue(); 198 | 199 | private: 200 | static void readDataLine(); 201 | static void detectEnaLineRising(); 202 | static void detectEnaLineFalling(); 203 | 204 | }; 205 | #endif 206 | 207 | -------------------------------------------------------------------------------- /char_fix_radio_mode_moped/VAGFISWriter.h: -------------------------------------------------------------------------------- 1 | //enhanced version of: 2 | //credits: https://github.com/arildlangseid/vw_t4_tcu_temp_to_fis 3 | 4 | #ifndef VAGFISWriter_h 5 | #define VAGFISWriter_h 6 | 7 | #include 8 | #include 9 | 10 | // based on FIS_emulator 11 | 12 | #define FIS_WRITE_PULSEW 4 13 | 14 | #define PORT_3LB PORTB 15 | #define DATA PB3 //MOSI (Arduino Uno 11) 16 | #define CLK PB5 //SCK (Arduino 13) 17 | 18 | 19 | // Positions in Message-Array 20 | #define FIS_MSG_COMMAND 0 21 | #define FIS_MSG_LENGTH 1 22 | 23 | #define JUMBO_PACKET_SIZE 32 24 | 25 | static volatile uint8_t _sendOutData; 26 | static uint8_t _FIS_WRITE_ENA; 27 | static uint8_t _FIS_WRITE_CLK; 28 | static uint8_t _FIS_WRITE_DATA; 29 | static char _radioData[16]; 30 | static uint8_t _radioDataOK=0; 31 | 32 | class VAGFISWriter 33 | { 34 | public: 35 | VAGFISWriter(uint8_t clkPin, uint8_t dataPin, uint8_t enaPin, uint8_t forced); 36 | ~VAGFISWriter(); 37 | void begin(); 38 | 39 | uint8_t sendMsg(char msg[]); 40 | bool sendRadioMsg(char msg[16]); 41 | //bool sendRadioMsg(String msg); 42 | void sendString(String line1="", String line2="", bool center=true); 43 | void sendStringFS(int x, int y, uint8_t font, String line); 44 | void sendMsgFS(uint8_t X,uint8_t Y,uint8_t font,uint8_t size,char msg[]); 45 | void initScreen(uint8_t mode,uint8_t X,uint8_t Y,uint8_t X1,uint8_t Y1); 46 | void reset(uint8_t mode = 0x82); 47 | void initMiddleScreen(uint8_t mode = 0x82); 48 | void initFullScreen(uint8_t mode = 0x82); 49 | void initFullScreenFilled(); 50 | //void sendRawMsg(char in_msg[]); 51 | uint8_t sendRawData(char data[]); 52 | void sendKeepAliveMsg(); 53 | void radioDisplayOff(); 54 | void radioDisplayBlank(); 55 | void GraphicFromArray(uint8_t x,uint8_t y, uint8_t sizex,uint8_t sizey,uint8_t data[],uint8_t mode); 56 | void GraphicFromArray(uint8_t x,uint8_t y, uint8_t sizex,uint8_t sizey,const char * const data,uint8_t mode); 57 | void GraphicFromArray_P(uint8_t x,uint8_t y, uint8_t sizex,uint8_t sizey,const uint8_t * const data,uint8_t mode); 58 | void GraphicOut(uint8_t x,uint8_t y, uint16_t size, uint8_t data[],uint8_t mode); 59 | void GraphicOut(uint8_t x,uint8_t y, uint16_t size, const char * const data,uint8_t mode); 60 | void GraphicOut_P(uint8_t x,uint8_t y, uint16_t size, const uint8_t * const data,uint8_t mode); 61 | // void sendRadioData(void); 62 | void sendRadioData(uint8_t force = 0); 63 | static void enableGoesHigh(void); 64 | static void enableGoesLow(void); 65 | private: 66 | 67 | uint8_t sendSingleByteCommand(uint8_t txByte); 68 | void sendEnablePulse(); 69 | void sendByte(uint8_t in_byte); 70 | void startENA(); 71 | uint8_t stopENA(); 72 | void setClockHigh(); 73 | void setClockLow(); 74 | void setDataHigh(); 75 | void setDataLow(); 76 | uint8_t waitEnaHigh( uint16_t timeout_us = 1500); 77 | uint8_t waitEnaLow( uint16_t timeout_us = 1500); 78 | uint8_t checkSum( volatile uint8_t in_msg[]); 79 | uint8_t __forced=0; 80 | }; 81 | 82 | 83 | #endif 84 | -------------------------------------------------------------------------------- /char_fix_radio_mode_moped/bitmaps.h: -------------------------------------------------------------------------------- 1 | const uint8_t PROGMEM avant[138] = { 2 | 0x07,0xfe,0x00 3 | ,0x3f,0xff,0xc0 4 | ,0x78,0x01,0xe0 5 | ,0xc8,0x01,0x30 6 | ,0xb4,0x02,0xd0 7 | ,0xc4,0x02,0x30 8 | ,0x84,0x02,0x10 9 | ,0x84,0x02,0x10 10 | ,0x84,0x02,0x10 11 | ,0x84,0x02,0x10 12 | ,0x84,0x02,0x10 13 | ,0x9f,0xff,0x90 14 | ,0xb0,0x00,0xd0 15 | ,0xe0,0x00,0x70 16 | ,0x80,0x00,0x10 17 | ,0x80,0x00,0x10 18 | ,0x80,0x00,0x10 19 | ,0xe0,0x00,0x70 20 | ,0xb7,0xfe,0xd0 21 | ,0x98,0x01,0x90 22 | ,0x90,0x00,0x90 23 | ,0x90,0x00,0x90 24 | ,0x90,0x00,0x90 25 | ,0x90,0x00,0x90 26 | ,0x90,0x00,0x90 27 | ,0xf0,0x00,0xf0 28 | ,0x90,0x00,0x90 29 | ,0x90,0x00,0x90 30 | ,0x90,0x00,0x90 31 | ,0x90,0x00,0x90 32 | ,0x90,0x00,0x90 33 | ,0x90,0x00,0x90 34 | ,0x90,0x00,0x90 35 | ,0xb0,0x00,0xd0 36 | ,0xd0,0x00,0xb0 37 | ,0x90,0x00,0x90 38 | ,0x90,0x00,0x90 39 | ,0x90,0x00,0x90 40 | ,0x90,0x00,0x90 41 | ,0x98,0x01,0x90 42 | ,0x97,0xfe,0x90 43 | ,0xa0,0x00,0x50 44 | ,0xe0,0x00,0x70 45 | ,0x90,0x00,0x90 46 | ,0x7f,0xff,0xe0 47 | ,0x1f,0xff,0x80 48 | 49 | }; 50 | /* 51 | const char PROGMEM sedan[138] = { 52 | 0x07,0xfe,0x00 53 | ,0x3f,0xff,0xc0 54 | ,0x78,0x01,0xe0 55 | ,0xc8,0x01,0x30 56 | ,0xb4,0x02,0xd0 57 | ,0xc4,0x02,0x30 58 | ,0x84,0x02,0x10 59 | ,0x84,0x02,0x10 60 | ,0x84,0x02,0x10 61 | ,0x84,0x02,0x10 62 | ,0x84,0x02,0x10 63 | ,0x9f,0xff,0x90 64 | ,0xb0,0x00,0xd0 65 | ,0xe0,0x00,0x70 66 | ,0x80,0x00,0x10 67 | ,0x80,0x00,0x10 68 | ,0x80,0x00,0x10 69 | ,0xe0,0x00,0x70 70 | ,0xb7,0xfe,0xd0 71 | ,0x98,0x01,0x90 72 | ,0x90,0x00,0x90 73 | ,0x90,0x00,0x90 74 | ,0x90,0x00,0x90 75 | ,0x90,0x00,0x90 76 | ,0x90,0x00,0x90 77 | ,0xf0,0x00,0xf0 78 | ,0x90,0x00,0x90 79 | ,0x90,0x00,0x90 80 | ,0x90,0x00,0x90 81 | ,0x90,0x00,0x90 82 | ,0x90,0x00,0x90 83 | ,0x90,0x00,0x90 84 | ,0x90,0x00,0x90 85 | ,0xb8,0x01,0xd0 86 | ,0xe7,0xfe,0x70 87 | ,0x80,0x00,0x10 88 | ,0xc0,0x00,0x30 89 | ,0xa0,0x00,0x50 90 | ,0x90,0x00,0x90 91 | ,0x8c,0x03,0x10 92 | ,0x83,0xfc,0x10 93 | ,0xc0,0x00,0x30 94 | ,0x60,0x00,0x60 95 | ,0x50,0x00,0xa0 96 | ,0x3f,0xff,0xc0 97 | ,0x07,0xfe,0x00 98 | }; 99 | */ 100 | const uint8_t PROGMEM left_door[8] = { 101 | 0x02 102 | ,0x06 103 | ,0x0c 104 | ,0x18 105 | ,0x30 106 | ,0x63 107 | ,0xc5 108 | ,0x79 109 | }; 110 | 111 | const uint8_t PROGMEM right_door[8] { 112 | 0x40 113 | ,0x60 114 | ,0x30 115 | ,0x18 116 | ,0x0c 117 | ,0xc6 118 | ,0xa3 119 | ,0x9e 120 | }; 121 | 122 | const uint8_t PROGMEM avant_trunc[8]{ 123 | 0x40,0x08 124 | ,0xff,0xfc 125 | ,0xff,0xfc 126 | ,0x7f,0xf8 127 | }; 128 | 129 | const uint8_t B5familia[64*88] PROGMEM = { 130 | 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff 131 | ,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff 132 | ,0xff,0xff,0xf0,0x00,0x01,0xff,0xff,0xc3 133 | ,0xff,0xff,0xc0,0x00,0x00,0x7f,0xf8,0x03 134 | ,0xff,0xff,0x80,0x00,0x00,0x3f,0x80,0x03 135 | ,0xe0,0x3f,0x00,0x00,0x00,0x1f,0x00,0x03 136 | ,0xe0,0x3f,0x00,0x00,0x00,0x0f,0x00,0x03 137 | ,0xe0,0x3e,0x00,0x00,0x00,0x0f,0x00,0x07 138 | ,0xe0,0x3e,0x00,0x00,0x00,0x07,0x03,0x1f 139 | ,0xe0,0x3e,0x00,0x00,0x00,0x07,0x00,0x07 140 | ,0xe0,0x3e,0x00,0x00,0x00,0x07,0x00,0x03 141 | ,0xe0,0x3c,0x00,0x00,0x00,0x03,0x00,0x03 142 | ,0xe0,0x3c,0x00,0x00,0x00,0x03,0x00,0x03 143 | ,0xe0,0x3c,0x00,0x00,0x00,0x03,0xf8,0x03 144 | ,0xe0,0x3c,0x00,0x00,0x00,0x03,0xff,0xc3 145 | ,0xe0,0x3c,0x00,0x00,0x00,0x03,0xff,0xff 146 | ,0xe0,0x3c,0x00,0x00,0x00,0x03,0x00,0x03 147 | ,0xe0,0x3c,0x00,0x00,0x00,0x03,0x00,0x03 148 | ,0xe0,0x3c,0x03,0xff,0xfe,0x03,0x00,0x03 149 | ,0xe0,0x3e,0x07,0xff,0xfe,0x03,0x00,0x03 150 | ,0xe0,0x3e,0x07,0xff,0xfe,0x03,0x00,0x03 151 | ,0xe0,0x3e,0x07,0xff,0xfe,0x03,0x80,0x07 152 | ,0xe0,0x3f,0x07,0xff,0xfe,0x03,0xff,0xe7 153 | ,0xe0,0x3f,0x03,0xff,0xf8,0x03,0xff,0xe3 154 | ,0xe0,0x00,0x18,0x78,0x00,0x03,0xff,0xe3 155 | ,0xfc,0x00,0x1b,0x78,0x00,0x03,0xff,0xc3 156 | ,0xff,0xf0,0xcf,0x78,0x00,0x03,0x00,0x03 157 | ,0xff,0xfc,0x3c,0x78,0x00,0x03,0x00,0x03 158 | ,0xff,0xfe,0xfe,0x78,0x00,0x03,0x00,0x03 159 | ,0xff,0xfe,0x5b,0x78,0x00,0x07,0x00,0x03 160 | ,0xe7,0xff,0x30,0xf8,0x00,0x07,0x00,0x03 161 | ,0xe7,0xff,0x03,0xf8,0x00,0x07,0xff,0xff 162 | ,0xe1,0xff,0xff,0x78,0x00,0x07,0xff,0xff 163 | ,0xe0,0x7f,0xff,0xf8,0x00,0x0f,0x00,0x03 164 | ,0xe0,0x01,0xff,0xf8,0x00,0x0f,0x00,0x03 165 | ,0xe0,0x00,0xff,0xf8,0x00,0x1f,0x00,0x03 166 | ,0xe0,0x00,0xff,0xfc,0x00,0x3f,0x00,0x03 167 | ,0xe0,0x00,0xff,0xfe,0x00,0x7f,0x00,0x03 168 | ,0xe0,0x00,0x7f,0xff,0x80,0xff,0x00,0x07 169 | ,0xff,0xf8,0xf3,0xff,0xc7,0xff,0xff,0xff 170 | ,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x07 171 | ,0xff,0xff,0xff,0xff,0xf8,0xff,0x00,0x03 172 | ,0xff,0xff,0xff,0xdf,0xfc,0x3f,0x00,0x03 173 | ,0xff,0x87,0x8f,0x87,0xfc,0x1f,0x00,0x03 174 | ,0xff,0x3f,0x87,0x03,0xfc,0x0f,0x00,0x03 175 | ,0xfe,0x14,0x63,0x00,0xfe,0x0f,0x00,0x7f 176 | ,0xfc,0x0e,0x03,0x1f,0xff,0x3f,0x00,0x1f 177 | ,0xf8,0x00,0x02,0x1f,0xff,0xff,0xe0,0x03 178 | ,0xf8,0x00,0x00,0x19,0xff,0xff,0xfd,0x03 179 | ,0xf8,0x00,0x03,0x88,0x7f,0xdf,0xed,0x03 180 | ,0xf0,0x00,0x00,0xf8,0x1f,0x87,0x2e,0x47 181 | ,0xf0,0x00,0x00,0xfc,0x07,0x87,0x3f,0xff 182 | ,0xf0,0x00,0x07,0x3c,0x03,0x87,0x1f,0x03 183 | ,0xf0,0x00,0x06,0x13,0x03,0x87,0x0c,0xe3 184 | ,0xf0,0x00,0x00,0x70,0x01,0x83,0x08,0x43 185 | ,0xf0,0x00,0x00,0x20,0x01,0xc3,0x0c,0x03 186 | ,0xe0,0x00,0x00,0x00,0x01,0xc3,0x00,0x03 187 | ,0xe0,0x00,0x00,0x00,0x01,0xc3,0xff,0xff 188 | ,0xe0,0x0f,0xe0,0x0f,0xf9,0xc3,0xff,0xc3 189 | ,0xe0,0x1f,0xe0,0x1f,0xf9,0xc3,0xf8,0x03 190 | ,0xe0,0x1f,0xf0,0x1f,0xfd,0xc3,0x80,0x03 191 | ,0xe0,0x1f,0xf0,0x1f,0xfd,0xc3,0x00,0x03 192 | ,0xe0,0x1f,0xf0,0x1f,0xfd,0xc3,0x00,0x03 193 | ,0xe0,0x00,0x00,0x00,0x01,0x83,0x00,0x07 194 | ,0xe0,0x00,0x00,0x00,0x01,0x83,0x03,0x1f 195 | ,0xe0,0x00,0x00,0x00,0x01,0x83,0x00,0x07 196 | ,0xe0,0x00,0x00,0x00,0x01,0x83,0x00,0x03 197 | ,0xe0,0x00,0x00,0x00,0x00,0x83,0x00,0x03 198 | ,0xe0,0x00,0x00,0x00,0x00,0xc3,0x00,0x03 199 | ,0xe0,0x00,0x00,0x00,0x00,0xe3,0xf0,0x03 200 | ,0xe0,0x00,0x00,0x00,0x00,0x73,0xff,0x83 201 | ,0xe0,0x00,0x00,0x00,0x00,0x33,0x18,0xff 202 | ,0xe0,0x00,0x00,0x00,0x00,0x1f,0x18,0xff 203 | ,0xe0,0x00,0x00,0x00,0x00,0x0f,0x18,0xff 204 | ,0xe0,0x00,0x00,0x00,0x00,0x07,0x00,0x03 205 | ,0xe0,0x00,0x00,0x00,0x00,0x03,0x80,0x03 206 | ,0xe0,0x00,0x00,0x00,0x00,0x03,0xc0,0x03 207 | ,0xe0,0x00,0x00,0x00,0x00,0x03,0x60,0x03 208 | ,0xe0,0x00,0x00,0x00,0x00,0x03,0x60,0x03 209 | ,0xe0,0x00,0x00,0x00,0x00,0x07,0x30,0x03 210 | ,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff 211 | ,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff 212 | ,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00 213 | ,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00 214 | ,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00 215 | ,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00 216 | ,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00 217 | ,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 218 | }; 219 | 220 | /* 221 | const char PROGMEM sedan_trunc[21]{ 222 | 0x80,0x00,0x40 223 | ,0xc0,0x00,0xc0 224 | ,0xe0,0x01,0xc0 225 | ,0xf8,0x07,0xc0 226 | ,0x7f,0xff,0x80 227 | ,0x3f,0xff,0x00 228 | ,0x1f,0xfe,0x00 229 | }; 230 | */ 231 | /* 232 | const char PROGMEM audi_sport[272]={ 233 | 0x00,0x3f,0xff,0xff,0xf0,0xff,0xc3,0xff 234 | ,0x00,0x7f,0xff,0xff,0xf1,0xff,0xc7,0xff 235 | ,0x00,0x70,0x84,0x21,0xe1,0xff,0x87,0xfe 236 | ,0x00,0x6f,0x7b,0xde,0xe1,0xff,0x87,0xfe 237 | ,0x00,0x5e,0xb5,0xaf,0x63,0xff,0x8f,0xfe 238 | ,0x00,0xde,0xb5,0xaf,0x63,0xff,0x0f,0xfc 239 | ,0x00,0xde,0xb5,0xaf,0x43,0xff,0x0f,0xfc 240 | ,0x00,0xde,0xb5,0xaf,0x47,0xff,0x1f,0xfc 241 | ,0x01,0xef,0x7b,0xde,0xc7,0xfe,0x1f,0xf8 242 | ,0x01,0xf0,0x84,0x21,0x87,0xfe,0x1f,0xf8 243 | ,0x01,0xff,0xff,0xff,0x8f,0xfe,0x3f,0xf8 244 | ,0x01,0xff,0xff,0xff,0x8f,0xfe,0x3f,0xf0 245 | ,0x03,0xff,0xff,0xff,0x0f,0xfc,0x3f,0xf0 246 | ,0x03,0xff,0xff,0xff,0x0f,0xfc,0x7f,0xf0 247 | ,0x03,0xff,0xff,0xff,0x1f,0xfc,0x7f,0xf0 248 | ,0x03,0xff,0xff,0xfe,0x1f,0xfc,0x7f,0xe0 249 | ,0x07,0xff,0xff,0xfe,0x1f,0xf8,0x7f,0xe0 250 | ,0x07,0xff,0xff,0xfe,0x3f,0xf8,0xff,0xe0 251 | ,0x07,0xff,0xff,0xfe,0x3f,0xf0,0xff,0xc0 252 | ,0x07,0xff,0xff,0xfc,0x3f,0xf0,0xff,0xc0 253 | ,0x0f,0xff,0xff,0xfc,0x3f,0xf1,0xff,0xc0 254 | ,0x0f,0xff,0xff,0xfc,0x7f,0xf1,0xff,0xc0 255 | ,0x0f,0xff,0xff,0xfc,0x7f,0xe1,0xff,0x80 256 | ,0x1f,0xff,0xff,0xf8,0x7f,0xe3,0xff,0x80 257 | ,0x1f,0xff,0xff,0xf8,0xff,0xe3,0xff,0x00 258 | ,0x1f,0xff,0xff,0xf8,0xff,0xc3,0xff,0x00 259 | ,0x3f,0xff,0xff,0xf0,0xff,0xc3,0xff,0x00 260 | ,0x3f,0xff,0xff,0xf1,0xff,0xc7,0xff,0x00 261 | ,0x3f,0xff,0xff,0xf1,0xff,0xc7,0xfe,0x00 262 | ,0x3f,0xff,0xff,0xe1,0xff,0x87,0xfe,0x00 263 | ,0x7f,0xff,0xff,0xe1,0xff,0x8f,0xfe,0x00 264 | ,0x7f,0xff,0xff,0xe3,0xff,0x8f,0xfe,0x00 265 | ,0xff,0xff,0xff,0xc3,0xff,0x0f,0xfc,0x00 266 | ,0xff,0xff,0xff,0xc7,0xff,0x1f,0xfc,0x00 267 | }; 268 | 269 | 270 | const char PROGMEM audi_sport1[272]={ 271 | 0x00,0x7f,0xff,0xff,0xf8,0xff,0xc3,0xff 272 | ,0x00,0x40,0x00,0x00,0x09,0xff,0xc7,0xff 273 | ,0x00,0x8f,0x7b,0xde,0x11,0xff,0x87,0xfe 274 | ,0x00,0x90,0x84,0x21,0x11,0xff,0x87,0xfe 275 | ,0x00,0xa1,0x4a,0x50,0x93,0xff,0x8f,0xfe 276 | ,0x00,0xa1,0x4a,0x50,0xa3,0xff,0x0f,0xfc 277 | ,0x01,0x21,0x4a,0x50,0xa3,0xff,0x0f,0xfc 278 | ,0x01,0x21,0x4a,0x50,0xa7,0xff,0x1f,0xfc 279 | ,0x01,0x10,0x84,0x21,0x27,0xfe,0x1f,0xf8 280 | ,0x02,0x0f,0x7b,0xde,0x47,0xfe,0x1f,0xf8 281 | ,0x02,0x00,0x00,0x00,0x4f,0xfe,0x3f,0xf8 282 | ,0x02,0x00,0x00,0x00,0x4f,0xfe,0x3f,0xf0 283 | ,0x02,0x00,0x00,0x00,0x8f,0xfc,0x3f,0xf0 284 | ,0x04,0x00,0x00,0x00,0x8f,0xfc,0x7f,0xf0 285 | ,0x04,0x00,0x00,0x00,0x9f,0xfc,0x7f,0xf0 286 | ,0x04,0x00,0x00,0x01,0x1f,0xfc,0x7f,0xe0 287 | ,0x04,0x00,0x00,0x01,0x1f,0xf8,0x7f,0xe0 288 | ,0x08,0x00,0x00,0x01,0x3f,0xf8,0xff,0xe0 289 | ,0x08,0x00,0x00,0x01,0x3f,0xf0,0xff,0xc0 290 | ,0x08,0x00,0x00,0x02,0x3f,0xf0,0xff,0xc0 291 | ,0x10,0x00,0x00,0x02,0x3f,0xf1,0xff,0xc0 292 | ,0x10,0x00,0x00,0x02,0x7f,0xf1,0xff,0xc0 293 | ,0x10,0x00,0x00,0x04,0x7f,0xe1,0xff,0x80 294 | ,0x10,0x00,0x00,0x04,0x7f,0xe3,0xff,0x80 295 | ,0x20,0x00,0x00,0x04,0xff,0xe3,0xff,0x00 296 | ,0x20,0x00,0x00,0x08,0xff,0xc3,0xff,0x00 297 | ,0x20,0x00,0x00,0x08,0xff,0xc3,0xff,0x00 298 | ,0x40,0x00,0x00,0x09,0xff,0xc7,0xff,0x00 299 | ,0x40,0x00,0x00,0x09,0xff,0xc7,0xfe,0x00 300 | ,0x40,0x00,0x00,0x11,0xff,0x87,0xfe,0x00 301 | ,0x40,0x00,0x00,0x11,0xff,0x8f,0xfe,0x00 302 | ,0x80,0x00,0x00,0x13,0xff,0x8f,0xfe,0x00 303 | ,0x80,0x00,0x00,0x23,0xff,0x0f,0xfc,0x00 304 | ,0xff,0xff,0xff,0xe7,0xff,0x1f,0xfc,0x00 305 | }; 306 | 307 | const char PROGMEM audi_sport2[272]={ 308 | 0x00,0x3f,0xff,0xff,0xf0,0xff,0xc3,0xff 309 | ,0x00,0x7f,0xff,0xff,0xf1,0x00,0x44,0x01 310 | ,0x00,0x70,0x84,0x21,0xe1,0x00,0x44,0x01 311 | ,0x00,0x6f,0x7b,0xde,0xe2,0x00,0x88,0x02 312 | ,0x00,0x5e,0xb5,0xaf,0x62,0x00,0x88,0x02 313 | ,0x00,0xde,0xb5,0xaf,0x62,0x00,0x88,0x02 314 | ,0x00,0xde,0xb5,0xaf,0x44,0x01,0x10,0x02 315 | ,0x00,0xde,0xb5,0xaf,0x44,0x01,0x10,0x04 316 | ,0x01,0xef,0x7b,0xde,0xc4,0x01,0x10,0x04 317 | ,0x01,0xf0,0x84,0x21,0x84,0x01,0x10,0x04 318 | ,0x01,0xff,0xff,0xff,0x88,0x02,0x20,0x08 319 | ,0x01,0xff,0xff,0xff,0x88,0x02,0x20,0x08 320 | ,0x03,0xff,0xff,0xff,0x08,0x02,0x20,0x08 321 | ,0x03,0xff,0xff,0xff,0x10,0x04,0x40,0x10 322 | ,0x03,0xff,0xff,0xff,0x10,0x04,0x40,0x10 323 | ,0x03,0xff,0xff,0xfe,0x10,0x04,0x40,0x10 324 | ,0x07,0xff,0xff,0xfe,0x20,0x08,0x80,0x10 325 | ,0x07,0xff,0xff,0xfe,0x20,0x08,0x80,0x20 326 | ,0x07,0xff,0xff,0xfe,0x20,0x08,0x80,0x20 327 | ,0x07,0xff,0xff,0xfc,0x40,0x11,0x00,0x20 328 | ,0x0f,0xff,0xff,0xfc,0x40,0x11,0x00,0x40 329 | ,0x0f,0xff,0xff,0xfc,0x40,0x11,0x00,0x40 330 | ,0x0f,0xff,0xff,0xfc,0x80,0x22,0x00,0x40 331 | ,0x1f,0xff,0xff,0xf8,0x80,0x22,0x00,0x80 332 | ,0x1f,0xff,0xff,0xf8,0x80,0x22,0x00,0x80 333 | ,0x1f,0xff,0xff,0xf8,0x80,0x22,0x00,0x80 334 | ,0x3f,0xff,0xff,0xf1,0x00,0x44,0x00,0x80 335 | ,0x3f,0xff,0xff,0xf1,0x00,0x44,0x01,0x00 336 | ,0x3f,0xff,0xff,0xf1,0x00,0x44,0x01,0x00 337 | ,0x3f,0xff,0xff,0xe2,0x00,0x88,0x01,0x00 338 | ,0x7f,0xff,0xff,0xe2,0x00,0x88,0x02,0x00 339 | ,0x7f,0xff,0xff,0xe2,0x00,0x88,0x02,0x00 340 | ,0xff,0xff,0xff,0xc4,0x01,0x10,0x04,0x00 341 | ,0xff,0xff,0xff,0xc7,0xff,0x1f,0xfc,0x00 342 | };*/ 343 | -------------------------------------------------------------------------------- /char_fix_radio_mode_moped/char_fix_radio_mode_moped.ino: -------------------------------------------------------------------------------- 1 | #include "VAGFISReader.h" 2 | #include "VAGFISWriter.h" 3 | #include "bitmaps.h" 4 | 5 | #define RADIOIN_ENA 2 6 | #define RADIOIN_CLK 3 7 | #define RADIOIN_DATA 4 8 | 9 | #define RADIOOUT_ENA 5 10 | #define RADIOOUT_CLK 6 11 | #define RADIOOUT_DATA 7 12 | 13 | #define TOUPPER 8 14 | #define MODE A0 // 0 = radio, 1 = navi 15 | #define MODEL A1 // 0 = avant, 1 = sedan 16 | #define DOORFL A2 // 0 = opened, 1 = closed 17 | #define DOORFR A3 // 0 = opened, 1 = closed 18 | #define DOORRL A4 // 0 = opened, 1 = closed 19 | #define DOORRR A5 // 0 = opened, 1 = closed 20 | #define DOORTRUNK 9 // 0 = opened, 1 = closed 21 | 22 | #define SEDAN 0 23 | #define AVANT 1 24 | #define RADIO 0 25 | #define NAVI 1 26 | #define OPENED 0 27 | #define CLOSED 1 28 | 29 | VAGFISReader radio_read(RADIOIN_CLK, RADIOIN_DATA, RADIOIN_ENA); 30 | VAGFISWriter radio_write(RADIOOUT_CLK, RADIOOUT_DATA, RADIOOUT_ENA, 1); 31 | long last_update = 0; 32 | char radioData[16]; 33 | bool model = AVANT; 34 | bool mode = NAVI; 35 | 36 | bool displayedCAR = 0; 37 | bool displayedFL=0; 38 | bool displayedFR=0; 39 | bool displayedRL=0; 40 | bool displayedRR=0; 41 | bool displayedTRUNK=0; 42 | 43 | void draw_car(void) { 44 | if (displayedCAR) return; 45 | radio_write.reset(); 46 | delay(100); 47 | radio_write.initMiddleScreen(); 48 | delay(100); 49 | if (model == SEDAN) { 50 | //radio_write.GraphicFromArray_P(22, 1, 20, 46, sedan, 2); 51 | } else { // avant 52 | radio_write.GraphicFromArray_P(22, 1, 20, 46, avant, 2); 53 | } 54 | displayedCAR=1; 55 | delay(100); 56 | } 57 | 58 | void fl() { 59 | if(displayedFL) return; 60 | radio_write.GraphicFromArray_P(15, 19, 8,8, left_door, 1); 61 | displayedFL=1; 62 | delay(100); 63 | } 64 | 65 | void fr() { 66 | if(displayedFR) return; 67 | radio_write.GraphicFromArray_P(41, 19, 8,8, right_door, 1); 68 | displayedFR=1; 69 | delay(100); 70 | } 71 | 72 | void rl() { 73 | if(displayedRL) return; 74 | radio_write.GraphicFromArray_P(15, 27, 8,8, left_door, 1); 75 | displayedRL=1; 76 | delay(100); 77 | } 78 | 79 | void rr() { 80 | if(displayedRR) return; 81 | radio_write.GraphicFromArray_P(41, 27, 8,8, right_door, 1); 82 | displayedRR=1; 83 | delay(100); 84 | } 85 | 86 | void draw_trunk(){ 87 | if(displayedTRUNK) return; 88 | if (model == AVANT) { 89 | radio_write.GraphicFromArray_P(25, 41, 14, 4, avant_trunc, 1); 90 | } else { 91 | // radio_write.GraphicFromArray_P(23, 38, 18, 7, sedan_trunc, 1); 92 | } 93 | displayedTRUNK=1; 94 | } 95 | 96 | void setup() { 97 | radio_read.begin(); 98 | radio_write.begin(); 99 | // Serial.begin(115200); 100 | //Serial.println("grg"); 101 | pinMode(TOUPPER, INPUT_PULLUP); 102 | pinMode(MODE, INPUT_PULLUP); 103 | pinMode(MODEL, INPUT_PULLUP); 104 | pinMode(DOORFL, INPUT_PULLUP); 105 | pinMode(DOORFR, INPUT_PULLUP); 106 | pinMode(DOORRL, INPUT_PULLUP); 107 | pinMode(DOORRR, INPUT_PULLUP); 108 | pinMode(DOORTRUNK, INPUT_PULLUP); 109 | //model = digitalRead(MODEL); 110 | //mode = digitalRead(MODE); 111 | if (mode == NAVI) { 112 | //radio_write.radioDisplayOff(); 113 | //radio_write.reset(); 114 | // radio_write.sendMsg(" AUDI SPORT "); 115 | //delay(1000); 116 | //delay(1000); 117 | //radio_write.radioDisplayOff(); 118 | // radio_write.initFullScreen(); 119 | //delay(1000); 120 | radio_write.GraphicFromArray(0, 0, 64, 88, B5familia,2); 121 | //delay(2000); 122 | //radio_write.reset(); 123 | } 124 | } 125 | 126 | void loop() { 127 | 128 | if (radio_read.hasNewMsg()) { 129 | if (radio_read.msgIsNavi()) { 130 | // Navi text 131 | if (radio_read.msgIsRadioText()) { 132 | //radio msg(upper 2lines) in navi mode 133 | //Serial.println("prijate navi data:"); 134 | char tmp; 135 | for (uint8_t i = 3; i < radio_read.getSize() - 1; i++) { //1st byte is msg ID, second one is packet size,3th is second msg id (sort of) last is checksumm so we skip them 136 | tmp = radio_read.readData(i); 137 | // Serial.write(tmp);Serial.print("["+String(tmp,HEX)+"] -> "); 138 | if (!digitalRead(TOUPPER)) //DO CONVERSION TO UPPER CASE 139 | { 140 | if ( tmp > 96 && tmp < 123) // a = 97, Z = 122 , other chars are ommited 141 | tmp = tmp - 'a' + 'A'; 142 | } 143 | //Serial.write(tmp);Serial.println("["+String(tmp,HEX)+"]"); 144 | radioData[i] = tmp; 145 | } 146 | } 147 | if (mode == NAVI) { 148 | if (!radio_write.sendMsg(radioData)) Serial.println(F("seng navi msg failed!")); 149 | } else { 150 | if (!radio_write.sendRadioMsg(radioData)) Serial.println(F("seng radio msg failed!")); 151 | } 152 | // Serial.println();Serial.println(); 153 | last_update = millis(); 154 | } else { 155 | //radio mode, 16 characters which are important for us 156 | // Serial.println("prijate radio data:"); 157 | char tmp; 158 | for (uint8_t i = 0; i < 16; i++) { //1st byte is msg ID, last is checksumm 159 | tmp = radio_read.readData(1 + i); 160 | // Serial.write(tmp);Serial.print("["+String(tmp,HEX)+"] -> "); 161 | if (!digitalRead(TOUPPER)) //DO CONVERSION TO UPPER CASE 162 | { 163 | if ( tmp > 96 && tmp < 123) // a = 97, Z = 122 , other chars are ommited 164 | tmp = tmp - 'a' + 'A'; 165 | } 166 | // Serial.write(tmp);Serial.println("["+String(tmp,HEX)+"]"); 167 | radioData[i] = tmp; 168 | } 169 | if (mode == NAVI) { 170 | delay(10); 171 | //if (! 172 | radio_write.sendMsg(radioData);//) Serial.println(F("seng navi msg failed!")); 173 | } else { 174 | if (!radio_write.sendRadioMsg(radioData)) Serial.println("seng radio msg failed!"); 175 | } 176 | Serial.println();Serial.println(); 177 | last_update = millis(); 178 | } 179 | radio_read.clearNewMsgFlag(); 180 | } 181 | 182 | if (digitalRead(DOORFL) == OPENED) { 183 | draw_car(); 184 | fl(); 185 | } else { 186 | if (displayedFL){ //doors are opened, lets close them! 187 | displayedFL=0; //this will force "closing" door 188 | fl(); 189 | displayedFL=0;//make them closed permanently 190 | } 191 | } 192 | 193 | if (digitalRead(DOORFR) == OPENED) { 194 | draw_car(); 195 | fr(); 196 | radio_write.sendKeepAliveMsg(); 197 | } else { 198 | if (displayedFR){ //doors are opened, lets close them! 199 | displayedFR=0; //this will force "closing" door 200 | fr(); 201 | displayedFR=0;//make them closed permanently 202 | } 203 | } 204 | 205 | if (digitalRead(DOORRL) == OPENED) { 206 | draw_car(); 207 | rl(); 208 | radio_write.sendKeepAliveMsg(); 209 | } else { 210 | if (displayedRL){ //doors are opened, lets close them! 211 | displayedRL=0; //this will force "closing" door 212 | rl(); 213 | displayedRL=0;//make them closed permanently 214 | } 215 | } 216 | 217 | if (digitalRead(DOORRR) == OPENED) { 218 | draw_car(); 219 | rr(); 220 | radio_write.sendKeepAliveMsg(); 221 | } else { 222 | if (displayedRR){ //doors are opened, lets close them! 223 | displayedRR=0; //this will force "closing" door 224 | rr(); 225 | displayedRR=0;//make them closed permanently 226 | } 227 | } 228 | 229 | if (digitalRead(DOORTRUNK) == OPENED) { 230 | draw_car(); 231 | draw_trunk(); 232 | radio_write.sendKeepAliveMsg(); 233 | } else { 234 | if (displayedTRUNK){ //doors are opened, lets close them! 235 | displayedTRUNK=0; //this will force "closing" door 236 | draw_trunk(); 237 | displayedTRUNK=0;//make them closed permanently 238 | } 239 | } 240 | 241 | if (!displayedFL && !displayedFR && !displayedRL && !displayedRR && !displayedTRUNK) 242 | { 243 | radio_write.reset(); 244 | displayedCAR=0; 245 | } 246 | 247 | if ((millis() - last_update) > 10) { 248 | Serial.println(F("Sending keep alive and ack packet for radio")); 249 | radio_write.sendKeepAliveMsg(); 250 | radio_read.ACK(); 251 | last_update = millis(); 252 | } 253 | } 254 | -------------------------------------------------------------------------------- /fake_xenon_adjuster/README.md: -------------------------------------------------------------------------------- 1 | SW for fake headlights autoleveling 2 | 3 | HW is here: https://github.com/tomaskovacik/hw/tree/master/kicad/fake_xenon4 4 | 5 | you can buy set of 2 here: 6 | 7 | https://www.tindie.com/products/tomaskovacik/adapter-for-fxr-40-audi-a4-b5/ 8 | 9 | or here: 10 | 11 | https://www.tindie.com/products/tomaskovacik/template-for-4tl-r-bixenon-depo-audi-a4-b5-lights/ 12 | -------------------------------------------------------------------------------- /fake_xenon_adjuster/fake_xenon_adjuster.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void setup() { 4 | pinMode(4, OUTPUT); 5 | digitalWrite(4, LOW); 6 | pinMode(2, INPUT_PULLUP); 7 | } 8 | 9 | void loop() { 10 | if (digitalRead(2)) 11 | { 12 | delay(1000); 13 | digitalWrite(4, HIGH); 14 | delay(5000); 15 | digitalWrite(4, LOW); 16 | } 17 | //sleep_mode(); 18 | while (1); 19 | } 20 | -------------------------------------------------------------------------------- /gearbox_selector_protocol/gearbox_selector_protocol.ino: -------------------------------------------------------------------------------- 1 | // sketch to go over all modes of automatic transmition on audi cluster 2 | // Selector lever display 3 | // 4 | // contrl is over transistor switch, so signals in sketch are inverted (high switch transistor ON so pull down signal line) 5 | // high (low in this sketch) pusle is identification of transmition : 6 | // 7 | //type of trans. in miliseconds 8 | //5 -> PRND432 9 | //10 -> PRND321 10 | //20 -> PRNDL 11 | // 12 | // low pusle (high in this sketch) is multiply of lenght of identification pulse (5,10,20) and selected gear/mode 13 | // 14 | // for example: 15 | // [P]RND432 -> 5ms HIGH -> 5*1ms LOW 16 | // P[R]ND432 -> 5ms HIGH -> 5*2ms LOW 17 | // PR[N]D432 -> 5ms HIGH -> 5*3ms LOW 18 | // PRN[D]432 -> 5ms HIGH -> 5*4ms LOW 19 | // 20 | // pin 2 of arduino uno is connected to base of NPN transistor (2n5551 in my case) via 1k resistor 21 | // emitor of transistor to ground 22 | // collector to pin 6 of 20pin red connector of audi a4 1998 cluster (or black connector in early models) 23 | 24 | // cluster 25 | // | 26 | // | 27 | // | 28 | // ____ | 29 | // D2 ____|1k |__________|/ NPN 30 | // |____| |\e 31 | // | 32 | // | 33 | // | 34 | // _|_ GND 35 | // 36 | // video: https://www.youtube.com/watch?v=0d18H4fjk1M 37 | 38 | 39 | int tranIdent=5; 40 | int i=1; 41 | long mytime=0; 42 | 43 | void setup() { 44 | pinMode(2,OUTPUT); 45 | digitalWrite(2,LOW); 46 | Serial.begin(9600); 47 | } 48 | 49 | void loop() { 50 | 51 | //if ((millis()-mytime)>1000){ 52 | // mytime=millis(); 53 | // i++; 54 | // } 55 | 56 | digitalWrite(2,HIGH); 57 | delay(tranIdent*i); 58 | digitalWrite(2,LOW); 59 | delay(tranIdent); 60 | if (i == 20){ 61 | i=1; 62 | tranIdent=tranIdent*2; 63 | if (tranIdent==40) tranIdent=5; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /myMatrix/README.me: -------------------------------------------------------------------------------- 1 | partial support for 16x96 point displays (RGY) based on: http://openhardware.ro/mymatrix/ 2 | 3 | 4 | -------------------------------------------------------------------------------- /myMatrix/font7x11.h: -------------------------------------------------------------------------------- 1 | static const uint8_t font7x11[96][16] PROGMEM = 2 | { 3 | { 4 | 0B0000000, // Space [0] 5 | 0B0000000, 6 | 0B0000000, 7 | 0B0000000, 8 | 0B0000000, 9 | 0B0000000, 10 | 0B0000000, 11 | 0B0000000, 12 | 0B0000000, 13 | 0B0000000, 14 | 0B0000000, 15 | 0B0000000, 16 | 0B0000000, 17 | 0B0000000, 18 | 0B0000000, 19 | 0B0000000}, 20 | { 21 | 0B00011000, // ! [1] 22 | 0B00111100, 23 | 0B01111100, 24 | 0B01111100, 25 | 0B01111100, 26 | 0B01111100, 27 | 0B01111100, 28 | 0B00111100, 29 | 0B00011000, 30 | 0B00011000, 31 | 0B00000000, 32 | 0B00000000, 33 | 0B00011000, 34 | 0B00111100, 35 | 0B00111100, 36 | 0B00011000}, 37 | { 38 | 0B01010, // " [2] 39 | 0B01010, 40 | 0B00000, 41 | 0B00000, 42 | 0B00000, 43 | 0B00000, 44 | 0B00000}, 45 | { 46 | 0B00000, // # [3] 47 | 0B01010, 48 | 0B11111, 49 | 0B01010, 50 | 0B11111, 51 | 0B01010, 52 | 0B00000}, 53 | { 54 | 0B01110, // $ [4] 55 | 0B10101, 56 | 0B10100, 57 | 0B01110, 58 | 0B00101, 59 | 0B10101, 60 | 0B01110}, 61 | { 62 | 0B11000, // % [5] 63 | 0B11001, 64 | 0B00010, 65 | 0B00100, 66 | 0B01000, 67 | 0B10011, 68 | 0B00011}, 69 | { 70 | 0B00110, // & [6] 71 | 0B01010, 72 | 0B00100, 73 | 0B01101, 74 | 0B10010, 75 | 0B10011, 76 | 0B01110}, 77 | { 78 | 0B00100, // ' [7] 79 | 0B00100, 80 | 0B00000, 81 | 0B00000, 82 | 0B00000, 83 | 0B00000, 84 | 0B00000}, 85 | { 86 | 0B00010, // ( [8] 87 | 0B00100, 88 | 0B00100, 89 | 0B00100, 90 | 0B00100, 91 | 0B00100, 92 | 0B00010}, 93 | { 94 | 0B01000, // ) [9] 95 | 0B00100, 96 | 0B00100, 97 | 0B00100, 98 | 0B00100, 99 | 0B00100, 100 | 0B01000}, 101 | { 102 | 0B00100, // * [10] 103 | 0B10101, 104 | 0B01110, 105 | 0B01110, 106 | 0B10101, 107 | 0B00100, 108 | 0B00000}, 109 | { 110 | 0B00000, // + [11] 111 | 0B00100, 112 | 0B00100, 113 | 0B11111, 114 | 0B00100, 115 | 0B00100, 116 | 0B00000}, 117 | { 118 | 0B00000, // , [12] 119 | 0B00000, 120 | 0B00000, 121 | 0B00000, 122 | 0B00000, 123 | 0B00100, 124 | 0B00100}, 125 | { 126 | 0B00000, // - [13] 127 | 0B00000, 128 | 0B00000, 129 | 0B11111, 130 | 0B00000, 131 | 0B00000, 132 | 0B00000}, 133 | { 134 | 0B00000, // . [14] 135 | 0B00000, 136 | 0B00000, 137 | 0B00000, 138 | 0B00000, 139 | 0B00000, 140 | 0B00100}, 141 | { 142 | 0B00000, // / [15] 143 | 0B00001, 144 | 0B00010, 145 | 0B00100, 146 | 0B01000, 147 | 0B10000, 148 | 0B00000}, 149 | { 0x00, 0x1C, 0x36, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x36, 0x1C, 0x00, 0x00, 0x00, 0x00}, // 0 150 | { 0x00, 0x18, 0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x00, 0x00, 0x00, 0x00}, // 1 151 | { 0x00, 0x3E, 0x63, 0x63, 0x63, 0x06, 0x06, 0x0C, 0x18, 0x30, 0x63, 0x7F, 0x00, 0x00, 0x00, 0x00}, // 2 152 | { 0x00, 0x3E, 0x63, 0x63, 0x06, 0x1C, 0x06, 0x03, 0x03, 0x63, 0x66, 0x3C, 0x00, 0x00, 0x00, 0x00}, // 3 153 | { 0x00, 0x06, 0x0E, 0x1E, 0x36, 0x36, 0x66, 0x66, 0x7F, 0x06, 0x06, 0x1F, 0x00, 0x00, 0x00, 0x00}, // 4 154 | { 0x00, 0x7F, 0x60, 0x60, 0x60, 0x7C, 0x76, 0x03, 0x03, 0x63, 0x66, 0x3C, 0x00, 0x00, 0x00, 0x00}, // 5 155 | { 0x00, 0x1E, 0x36, 0x60, 0x60, 0x7C, 0x76, 0x63, 0x63, 0x63, 0x36, 0x1C, 0x00, 0x00, 0x00, 0x00}, // 6 156 | { 0x00, 0x7F, 0x66, 0x66, 0x0C, 0x0C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00}, // 7 157 | { 0x00, 0x3E, 0x63, 0x63, 0x63, 0x36, 0x1C, 0x36, 0x63, 0x63, 0x63, 0x3E, 0x00, 0x00, 0x00, 0x00}, // 8 158 | { 0x00, 0x1C, 0x36, 0x63, 0x63, 0x63, 0x37, 0x1F, 0x03, 0x03, 0x36, 0x3C, 0x00, 0x00, 0x00, 0x00}, // 9 159 | { 160 | 0B00000, // ; [27] 161 | 0B00000, 162 | 0B00100, 163 | 0B00000, 164 | 0B00100, 165 | 0B01000, 166 | 0B00000}, 167 | { 168 | 0B00011, // < [28] 169 | 0B00100, 170 | 0B01000, 171 | 0B10000, 172 | 0B01000, 173 | 0B00100, 174 | 0B00011}, 175 | { 176 | 0B00000, // = [29] 177 | 0B00000, 178 | 0B11111, 179 | 0B00000, 180 | 0B11111, 181 | 0B00000, 182 | 0B00000}, 183 | { 184 | 0B11000, // > [30] 185 | 0B00100, 186 | 0B00010, 187 | 0B00001, 188 | 0B00010, 189 | 0B00100, 190 | 0B11000}, 191 | { 192 | 0B01110, // ? [31] 193 | 0B10001, 194 | 0B00001, 195 | 0B00110, 196 | 0B00100, 197 | 0B00000, 198 | 0B00100}, 199 | { 200 | 0B01110, // @ [32] 201 | 0B10001, 202 | 0B10011, 203 | 0B10011, 204 | 0B10000, 205 | 0B10001, 206 | 0B01110}, 207 | { 208 | 0B01110, // A [33] 209 | 0B10001, 210 | 0B10001, 211 | 0B11111, 212 | 0B10001, 213 | 0B10001, 214 | 0B10001}, 215 | { 216 | 0B11110, // B [34] 217 | 0B10001, 218 | 0B10001, 219 | 0B11110, 220 | 0B10001, 221 | 0B10001, 222 | 0B11110}, 223 | { 224 | 0B01110, // C [35] 225 | 0B10001, 226 | 0B10000, 227 | 0B10000, 228 | 0B10000, 229 | 0B10001, 230 | 0B01110}, 231 | { 232 | 0B11110, // D [36] 233 | 0B10001, 234 | 0B10001, 235 | 0B10001, 236 | 0B10001, 237 | 0B10001, 238 | 0B11110}, 239 | { 240 | 0B11111, // E [37] 241 | 0B10000, 242 | 0B10000, 243 | 0B11100, 244 | 0B10000, 245 | 0B10000, 246 | 0B11111}, 247 | { 248 | 0B11111, // F [38] 249 | 0B10000, 250 | 0B10000, 251 | 0B11100, 252 | 0B10000, 253 | 0B10000, 254 | 0B10000}, 255 | { 256 | 0B01110, // G [39] 257 | 0B10001, 258 | 0B10000, 259 | 0B10000, 260 | 0B10011, 261 | 0B10001, 262 | 0B01110}, 263 | { 264 | 0B10001, // H [40] 265 | 0B10001, 266 | 0B10001, 267 | 0B11111, 268 | 0B10001, 269 | 0B10001, 270 | 0B10001}, 271 | { 272 | 0B01110, // I [41] 273 | 0B00100, 274 | 0B00100, 275 | 0B00100, 276 | 0B00100, 277 | 0B00100, 278 | 0B01110}, 279 | { 280 | 0B00001, // J [42] 281 | 0B00001, 282 | 0B00001, 283 | 0B00001, 284 | 0B00001, 285 | 0B10001, 286 | 0B01110}, 287 | { 288 | 0B10001, // K [43] 289 | 0B10010, 290 | 0B10100, 291 | 0B11000, 292 | 0B10100, 293 | 0B10010, 294 | 0B10001}, 295 | { 296 | 0B10000, // L[44] 297 | 0B10000, 298 | 0B10000, 299 | 0B10000, 300 | 0B10000, 301 | 0B10000, 302 | 0B11111}, 303 | { 304 | 0B10001, // M [45] 305 | 0B11011, 306 | 0B10101, 307 | 0B10001, 308 | 0B10001, 309 | 0B10001, 310 | 0B10001}, 311 | { 312 | 0B10001, // N [46] 313 | 0B10001, 314 | 0B11001, 315 | 0B10101, 316 | 0B10011, 317 | 0B10001, 318 | 0B10001}, 319 | { 320 | 0B01110, // O [47] 321 | 0B10001, 322 | 0B10001, 323 | 0B10001, 324 | 0B10001, 325 | 0B10001, 326 | 0B01110}, 327 | { 328 | 0B11110, // P 329 | 0B10001, 330 | 0B10001, 331 | 0B11110, 332 | 0B10000, 333 | 0B10000, 334 | 0B10000}, 335 | { 336 | 0B01110, // Q 337 | 0B10001, 338 | 0B10001, 339 | 0B10001, 340 | 0B10101, 341 | 0B10011, 342 | 0B01111}, 343 | { 344 | 0B11110, // R 345 | 0B10001, 346 | 0B10001, 347 | 0B11110, 348 | 0B10100, 349 | 0B10010, 350 | 0B10001}, 351 | { 352 | 0B01110, // S 353 | 0B10001, 354 | 0B10000, 355 | 0B01110, 356 | 0B00001, 357 | 0B10001, 358 | 0B01110}, 359 | { 360 | 0B11111, // T 361 | 0B00100, 362 | 0B00100, 363 | 0B00100, 364 | 0B00100, 365 | 0B00100, 366 | 0B00100}, 367 | { 368 | 0B10001, // U 369 | 0B10001, 370 | 0B10001, 371 | 0B10001, 372 | 0B10001, 373 | 0B10001, 374 | 0B01110}, 375 | { 376 | 0B10001, // V 377 | 0B10001, 378 | 0B10001, 379 | 0B10001, 380 | 0B10001, 381 | 0B01010, 382 | 0B00100}, 383 | { 384 | 0B10001, // W 385 | 0B10001, 386 | 0B10001, 387 | 0B10001, 388 | 0B10101, 389 | 0B10101, 390 | 0B01010}, 391 | { 392 | 0B10001, // X 393 | 0B10001, 394 | 0B01010, 395 | 0B00100, 396 | 0B01010, 397 | 0B10001, 398 | 0B10001}, 399 | { 400 | 0B10001, // Y 401 | 0B01010, 402 | 0B00100, 403 | 0B00100, 404 | 0B00100, 405 | 0B00100, 406 | 0B00100}, 407 | { 408 | 0B11111, // Z 409 | 0B00001, 410 | 0B00010, 411 | 0B00100, 412 | 0B01000, 413 | 0B10000, 414 | 0B11111}, 415 | { 416 | 0B00110, // [ 417 | 0B00100, 418 | 0B00100, 419 | 0B00100, 420 | 0B00100, 421 | 0B00100, 422 | 0B00110}, 423 | { 424 | 0B00000, // \ 425 | 0B10000, 426 | 0B01000, 427 | 0B00100, 428 | 0B00010, 429 | 0B00001, 430 | 0B00000}, 431 | { 432 | 0B01100, // ] 433 | 0B00100, 434 | 0B00100, 435 | 0B00100, 436 | 0B00100, 437 | 0B00100, 438 | 0B01100}, 439 | { 440 | 0B00100, // ^ 441 | 0B01010, 442 | 0B10001, 443 | 0B00000, 444 | 0B00000, 445 | 0B00000, 446 | 0B00000}, 447 | { 448 | 0B00000, // _ 449 | 0B00000, 450 | 0B00000, 451 | 0B00000, 452 | 0B00000, 453 | 0B00000, 454 | 0B11111}, 455 | { 456 | 0B00100, // ` 457 | 0B00100, 458 | 0B00000, 459 | 0B00000, 460 | 0B00000, 461 | 0B00000, 462 | 0B00000}, 463 | { 464 | 0B00000, // a 465 | 0B00000, 466 | 0B11100, 467 | 0B00010, 468 | 0B01110, 469 | 0B10010, 470 | 0B11111}, 471 | { 472 | 0B10000, // b 473 | 0B10000, 474 | 0B10000, 475 | 0B11110, 476 | 0B10001, 477 | 0B10001, 478 | 0B11110}, 479 | { 480 | 0B00000, // c 481 | 0B00000, 482 | 0B01110, 483 | 0B10001, 484 | 0B10000, 485 | 0B10001, 486 | 0B01110}, 487 | { 488 | 0B00001, // d 489 | 0B00001, 490 | 0B00001, 491 | 0B01111, 492 | 0B10001, 493 | 0B10001, 494 | 0B01111}, 495 | { 496 | 0B00000, // e 497 | 0B00000, 498 | 0B01110, 499 | 0B10001, 500 | 0B11111, 501 | 0B10000, 502 | 0B01111}, 503 | { 504 | 0B01110, // f 505 | 0B01001, 506 | 0B01000, 507 | 0B11100, 508 | 0B01000, 509 | 0B01000, 510 | 0B01000}, 511 | { 512 | 0B00000, // g 513 | 0B00000, 514 | 0B01110, 515 | 0B10001, 516 | 0B11111, 517 | 0B00001, 518 | 0B01110}, 519 | { 520 | 0B10000, // h 521 | 0B10000, 522 | 0B10000, 523 | 0B11110, 524 | 0B10001, 525 | 0B10001, 526 | 0B10001}, 527 | { 528 | 0B00000, // i 529 | 0B00100, 530 | 0B00000, 531 | 0B01100, 532 | 0B00100, 533 | 0B00100, 534 | 0B11111}, 535 | { 536 | 0B00000, // j 537 | 0B00010, 538 | 0B00000, 539 | 0B00110, 540 | 0B00010, 541 | 0B00010, 542 | 0B11110}, 543 | { 544 | 0B11000, // k 545 | 0B01000, 546 | 0B01000, 547 | 0B01011, 548 | 0B01100, 549 | 0B01010, 550 | 0B11001}, 551 | { 552 | 0B01100, // l 553 | 0B00100, 554 | 0B00100, 555 | 0B00100, 556 | 0B00100, 557 | 0B00100, 558 | 0B11111}, 559 | { 560 | 0B00000, // m 561 | 0B00000, 562 | 0B10001, 563 | 0B11111, 564 | 0B10101, 565 | 0B10101, 566 | 0B10101}, 567 | { 568 | 0B00000, // n 569 | 0B00000, 570 | 0B10110, 571 | 0B11001, 572 | 0B10001, 573 | 0B10001, 574 | 0B10001}, 575 | { 576 | 0B00000, // o 577 | 0B00000, 578 | 0B01110, 579 | 0B10001, 580 | 0B10001, 581 | 0B10001, 582 | 0B01110}, 583 | { 584 | 0B00000, // p 585 | 0B00000, 586 | 0B11110, 587 | 0B10001, 588 | 0B11110, 589 | 0B10000, 590 | 0B10000}, 591 | { 592 | 0B00000, // q 593 | 0B00000, 594 | 0B01111, 595 | 0B10010, 596 | 0B11110, 597 | 0B00010, 598 | 0B00011}, 599 | { 600 | 0B00000, // r 601 | 0B00000, 602 | 0B10110, 603 | 0B11001, 604 | 0B10000, 605 | 0B10000, 606 | 0B10000}, 607 | { 608 | 0B00000, // s 609 | 0B00000, 610 | 0B01111, 611 | 0B10000, 612 | 0B11110, 613 | 0B00001, 614 | 0B11110}, 615 | { 616 | 0B00100, // t 617 | 0B00100, 618 | 0B11111, 619 | 0B00100, 620 | 0B00100, 621 | 0B00100, 622 | 0B00111}, 623 | { 624 | 0B00000, // u 625 | 0B00000, 626 | 0B10001, 627 | 0B10001, 628 | 0B10001, 629 | 0B10001, 630 | 0B01111}, 631 | { 632 | 0B00000, // v 633 | 0B00000, 634 | 0B10001, 635 | 0B10001, 636 | 0B10001, 637 | 0B01010, 638 | 0B00100}, 639 | { 640 | 0B00000, // w 641 | 0B00000, 642 | 0B10001, 643 | 0B10001, 644 | 0B10101, 645 | 0B11011, 646 | 0B10001}, 647 | { 648 | 0B00000, // x 649 | 0B00000, 650 | 0B10001, 651 | 0B01010, 652 | 0B00100, 653 | 0B01010, 654 | 0B10001}, 655 | { 656 | 0B00000, // y 657 | 0B00000, 658 | 0B10001, 659 | 0B10001, 660 | 0B01111, 661 | 0B00001, 662 | 0B00111}, 663 | { 664 | 0B00000, // z 665 | 0B00000, 666 | 0B11111, 667 | 0B00010, 668 | 0B00100, 669 | 0B01000, 670 | 0B11111}, 671 | { 672 | 0B00110, // { 673 | 0B00100, 674 | 0B00100, 675 | 0B01000, 676 | 0B00100, 677 | 0B00100, 678 | 0B00110}, 679 | { 680 | 0B00100, // | 681 | 0B00100, 682 | 0B00100, 683 | 0B00100, 684 | 0B00100, 685 | 0B00100, 686 | 0B00100}, 687 | { 688 | 0B01100, // } 689 | 0B00100, 690 | 0B00100, 691 | 0B00010, 692 | 0B00100, 693 | 0B00100, 694 | 0B01100}, 695 | { 696 | 0B00000, // unfinished 697 | 0B00000, 698 | 0B00000, 699 | 0B00000, 700 | 0B00000, 701 | 0B00000, 702 | 0B00000}, 703 | { 704 | 0B00000, // unfinished 705 | 0B00000, 706 | 0B00000, 707 | 0B00000, 708 | 0B00000, 709 | 0B00000, 710 | 0B00000}, 711 | }; 712 | -------------------------------------------------------------------------------- /myMatrix/myMATRIX.h: -------------------------------------------------------------------------------- 1 | /* 2 | File : myMATRIX.h 3 | Version : 1.0 4 | Date : 14.01.2015 5 | Project : myMatrix Arduino Library 6 | 7 | The MIT License (MIT) 8 | 9 | Copyright (c) 2015 Silviu - www.openhardware.ro 10 | 11 | Permission is hereby granted, free of charge, to any person obtaining a copy 12 | of this software and associated documentation files (the "Software"), to deal 13 | in the Software without restriction, including without limitation the rights 14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | copies of the Software, and to permit persons to whom the Software is 16 | furnished to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included in all 19 | copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 27 | SOFTWARE. 28 | */ 29 | 30 | #ifndef myMATRIX_h 31 | #define myMATRIX_h 32 | #include "myMATRIXClass.h" 33 | 34 | myMATRIX myMatrix; 35 | #if defined(newTimer2) 36 | ISR(TIMER2_COMPA_vect) 37 | { 38 | myMatrix.Show(); 39 | } 40 | #endif 41 | #if defined(oldTimer2) 42 | ISR(TIMER2_COMP_vect) 43 | { 44 | myMatrix.Show(); 45 | } 46 | #endif 47 | #endif 48 | -------------------------------------------------------------------------------- /myMatrix/myMATRIXClass.h: -------------------------------------------------------------------------------- 1 | /* 2 | File : myMATRIXclass.h 3 | Version : 1.0 4 | Date : 14.01.2015 5 | Project : myMatrix Arduino Library 6 | 7 | The MIT License (MIT) 8 | 9 | Copyright (c) 2015 Silviu - www.openhardware.ro 10 | 11 | Permission is hereby granted, free of charge, to any person obtaining a copy 12 | of this software and associated documentation files (the "Software"), to deal 13 | in the Software without restriction, including without limitation the rights 14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 | copies of the Software, and to permit persons to whom the Software is 16 | furnished to do so, subject to the following conditions: 17 | 18 | The above copyright notice and this permission notice shall be included in all 19 | copies or substantial portions of the Software. 20 | 21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 27 | SOFTWARE. 28 | */ 29 | 30 | // ensure this library description is only included once 31 | #ifndef myMATRIXClass_h 32 | #define myMATRIXClass_h 33 | 34 | #if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) \ 35 | || defined(__AVR_ATmega644__) || defined(__AVR_ATmega644A__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) \ 36 | || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega168P__) || defined(__AVR_ATmega88P__) || defined(__AVR_ATmega48P__) 37 | #define newTimer2 38 | #endif 39 | #if defined(__AVR_ATmega32__) || defined(__AVR_ATmega8__) || defined(__AVR_ATmega64__) 40 | #define oldTimer2 41 | #endif 42 | 43 | 44 | #include 45 | 46 | #if ARDUINO < 100 47 | #include "wiring.h" 48 | #else 49 | #include "Arduino.h" 50 | #endif 51 | 52 | #include "font5x7.h" 53 | #include "font7x11.h" 54 | #include "font6x16.h" 55 | #include "font7x16.h" 56 | #include "font8x16.h" 57 | 58 | #define black 0 59 | #define green 1 60 | #define red 2 61 | #define yellow 3 62 | 63 | 64 | // library interface description 65 | class myMATRIX 66 | { 67 | // user-accessible "public" interface 68 | public: 69 | volatile byte matrixBufferRed[192]; 70 | volatile byte matrixBufferGreen[192]; 71 | myMATRIX(); 72 | void Init(uint8_t pinRed, uint8_t pinGreen, uint8_t pinClock, 73 | uint8_t pinRowA, uint8_t pinRowB, uint8_t pinRowC, uint8_t pinRowD, 74 | uint8_t pinOE, uint8_t pinSTB); 75 | 76 | void setPixel(uint8_t x ,uint8_t y, uint8_t color); 77 | void fillRectangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint8_t color); 78 | void drawRectangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint8_t color); 79 | void clearScreen(); 80 | void printChar(uint8_t x,uint8_t y, uint8_t For_color, uint8_t Bk_color, char ch, uint8_t font); 81 | void printString(uint8_t x, uint8_t y, uint8_t For_color, uint8_t Bk_color,char *p, uint8_t font); 82 | void drawVLine(uint16_t x, uint16_t y1, uint16_t y2, uint8_t color); 83 | void drawHLine(uint16_t x1, uint16_t x2, uint16_t y, uint8_t color); 84 | void hScroll(uint8_t y, uint8_t For_color, uint8_t Bk_color,char *p); 85 | void Show(); 86 | // library-accessible "private" interface 87 | private: 88 | byte row; 89 | byte display; 90 | volatile uint8_t *outRed; 91 | volatile uint8_t *outGreen; 92 | volatile uint8_t *outClock; 93 | volatile uint8_t *outRowA; 94 | volatile uint8_t *outRowB; 95 | volatile uint8_t *outRowC; 96 | volatile uint8_t *outRowD; 97 | volatile uint8_t *outOE; 98 | volatile uint8_t *outSTB; 99 | 100 | uint8_t bitRed; 101 | uint8_t bitGreen; 102 | uint8_t bitClock; 103 | uint8_t bitRowA; 104 | uint8_t bitRowB; 105 | uint8_t bitRowC; 106 | uint8_t bitRowD; 107 | uint8_t bitOE; 108 | uint8_t bitSTB; 109 | 110 | void t_shiftOut(uint8_t dataRed,uint8_t dataGreen); 111 | void rowScan(byte row); 112 | byte getPixelChar(uint8_t x, uint8_t y1, char ch); 113 | byte getPixelHString(uint16_t x, uint16_t y, char *p); 114 | void timer2Setup(void); 115 | }; 116 | 117 | unsigned int lenString(char *p); 118 | 119 | #endif 120 | 121 | -------------------------------------------------------------------------------- /read_audi_concert_display/read_audi_concert_display.ino: -------------------------------------------------------------------------------- 1 | #define RADIO_STATUS 2 // int0 2 | #define RADIO_CLOCK 3 // int1 3 | #define RADIO_DATA 4 4 | #define DISPLAY_STATUS 18 // int2 5 | #define DISPLAY_CLOCK 19 // int3 6 | #define DISPLAY_DATA 20 7 | #define RADIO_TXBUFFER 12 8 | #define DISPLAY_TXBUFFER 12 9 | 10 | volatile byte DISPLAY_myByte = 0; 11 | volatile byte DISPLAY_myBit = 0; 12 | volatile int DISPLAY_done = 0; 13 | volatile byte RADIO_myByte = 0; 14 | volatile byte RADIO_myBit = 0; 15 | volatile int RADIO_done = 0; 16 | uint8_t RADIO_txbuffer[RADIO_TXBUFFER]; 17 | uint8_t DISPLAY_txbuffer[DISPLAY_TXBUFFER]; 18 | uint8_t RADIO_txinptr; 19 | uint8_t RADIO_txoutptr; 20 | uint8_t DISPLAY_txinptr; 21 | uint8_t DISPLAY_txoutptr; 22 | volatile uint8_t RADIO_capturing; //flag that we are receiving, so no sending muchachos 23 | volatile uint8_t DISPLAY_capturing; 24 | 25 | void DISPLAY_STATUS_line_rising() { 26 | DISPLAY_myByte = 0; 27 | DISPLAY_myBit = 0; 28 | attachInterrupt(digitalPinToInterrupt(DISPLAY_CLOCK), DISPLAY_read_data_line, RISING); //data are valid on rising edge of CLK 29 | attachInterrupt(digitalPinToInterrupt(DISPLAY_STATUS), DISPLAY_STATUS_line_falling, FALLING); //if STATUS changed to low, data on DATA line are no more valid. this will fire ISR which disable CLK ISR 30 | } 31 | 32 | void DISPLAY_STATUS_line_falling() { 33 | detachInterrupt(digitalPinToInterrupt(DISPLAY_CLOCK)); 34 | attachInterrupt(digitalPinToInterrupt(DISPLAY_STATUS), DISPLAY_STATUS_line_rising, RISING); 35 | } 36 | 37 | void DISPLAY_read_data_line() { 38 | if (digitalRead(DISPLAY_DATA)) { 39 | DISPLAY_txbuffer[RADIO_txinptr] = DISPLAY_txbuffer[RADIO_txinptr] << 1 | 0x0001; 40 | DISPLAY_myBit++; 41 | } 42 | else { 43 | DISPLAY_txbuffer[RADIO_txinptr] = DISPLAY_txbuffer[RADIO_txinptr] << 1; 44 | DISPLAY_myBit++; 45 | } 46 | if (DISPLAY_myBit == 8) { 47 | DISPLAY_txinptr++; 48 | } 49 | } 50 | 51 | void RADIO_STATUS_line_rising() { 52 | RADIO_myByte = 0; 53 | RADIO_myBit = 0; 54 | attachInterrupt(digitalPinToInterrupt(RADIO_CLOCK), RADIO_read_data_line, RISING); //data are valid on rising edge of CLK 55 | attachInterrupt(digitalPinToInterrupt(RADIO_STATUS), RADIO_STATUS_line_falling, FALLING); //if STATUS changed to low, data on DATA line are no more valid. this will fire ISR which disable CLK ISR 56 | } 57 | 58 | void RADIO_STATUS_line_falling() { 59 | detachInterrupt(digitalPinToInterrupt(RADIO_CLOCK)); 60 | attachInterrupt(digitalPinToInterrupt(RADIO_STATUS), RADIO_STATUS_line_rising, RISING); 61 | } 62 | 63 | void RADIO_read_data_line() { 64 | if (digitalRead(RADIO_DATA)) { 65 | RADIO_txbuffer[RADIO_txinptr] = RADIO_txbuffer[RADIO_txinptr] << 1 | 0x0001; 66 | RADIO_myBit++; 67 | } 68 | else { 69 | RADIO_txbuffer[RADIO_txinptr] = RADIO_txbuffer[RADIO_txinptr] << 1; 70 | RADIO_myBit++; 71 | } 72 | if (RADIO_myBit == 8) { 73 | RADIO_txinptr++; 74 | } 75 | } 76 | 77 | void RADIO_send_cmd(int cmd) { //cheking if we can send somesing is done in main loop 78 | pinMode(RADIO_STATUS, OUTPUT); 79 | pinMode(RADIO_CLOCK, OUTPUT); 80 | pinMode(RADIO_DATA, OUTPUT); 81 | 82 | digitalWrite(RADIO_DATA, LOW); 83 | digitalWrite(RADIO_CLOCK, LOW); 84 | 85 | digitalWrite(RADIO_STATUS, LOW); 86 | delayMicroseconds(200); 87 | digitalWrite(RADIO_STATUS, HIGH); 88 | // shiftOut(RADIO_DATA, RADIO_DATA, MSBFIRST, cmd); 89 | 90 | 91 | static int iResult[8]; 92 | for (int i = 0; i <= 7; i++) 93 | { 94 | iResult[i] = cmd % 2; 95 | cmd = cmd / 2; 96 | } 97 | for (int i = 7; i >= 0; i--) { 98 | switch (iResult[i]) { 99 | case 1: digitalWrite(RADIO_DATA, HIGH); 100 | break; 101 | case 0: digitalWrite(RADIO_DATA, LOW); 102 | break; 103 | } 104 | delayMicroseconds(5); 105 | digitalWrite(RADIO_CLOCK, HIGH); 106 | delayMicroseconds(5); 107 | digitalWrite(RADIO_CLOCK, LOW); 108 | delayMicroseconds(5); 109 | } 110 | 111 | delayMicroseconds(50); 112 | digitalWrite(RADIO_STATUS, LOW); 113 | delayMicroseconds(200); 114 | 115 | digitalWrite(RADIO_STATUS, HIGH); 116 | 117 | } 118 | 119 | 120 | 121 | 122 | void setup() { 123 | Serial.begin(9600); 124 | //Serial.print("hello"); 125 | 126 | RADIO_txinptr = 0; 127 | RADIO_txoutptr = 0; 128 | DISPLAY_txinptr = 0; 129 | DISPLAY_txoutptr = 0; 130 | RADIO_capturing = 0; 131 | DISPLAY_capturing = 0; 132 | 133 | // pinMode(SS, INPUT); 134 | // pinMode(SCK, INPUT); 135 | // pinMode(MISO, INPUT); 136 | // attachInterrupt(intSS_IN, SS_line_rising, RISING); 137 | } 138 | 139 | void loop() { 140 | if (done) { 141 | Serial.println(myByte, HEX);; 142 | myByte = 0; 143 | myBit = 0; 144 | done = 0; 145 | // t = millis(); 146 | } 147 | } 148 | 149 | -------------------------------------------------------------------------------- /read_symphonyII_code/read_symphonyII_code.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /****************************************************************************** 4 | ** 5 | ** read symphony II eeprom 6 | ** - extract code 7 | ** - fix lock(SAFE2) 8 | ** - set to nolock 9 | ** based on M93Cx6 Test Program 10 | ** 11 | ** Pin-Out: 12 | ** _____ 13 | ** Chip Select (cs) --|1 8|-- (pwr) Vcc 14 | ** Serial Clock (sk) --|2 7|-- 15 | ** Data In (di) --|3 6|-- (org) Organization Select 16 | ** Data Out (do) --|4 5|-- (gnd) Vss/Ground 17 | ** ----- 18 | ** 19 | ** Arduino Connection: 20 | ** Vcc - +5v (or Pin 9 as an option) 21 | ** Vss - GND 22 | ** Chip Select - Pin 10 23 | ** Serial Clock - Pin 13 24 | ** Data In - Pin 11 25 | ** Data Out - Pin 12 26 | ** Org Select - Pin 8 27 | ** 28 | *****************************************************************************/ 29 | 30 | 31 | #define PWR_PIN 7 32 | #define CS_PIN 10 33 | #define SK_PIN 13 34 | #define DO_PIN 12 35 | #define DI_PIN 11 36 | #define ORG_PIN 8 37 | #define ORG 16 38 | #define CHIP 56 39 | 40 | M93Cx6 eeprom = M93Cx6(PWR_PIN, CS_PIN, SK_PIN, DO_PIN, DI_PIN, ORG_PIN); 41 | 42 | void setup() { 43 | int i = 0; 44 | int c = 0; 45 | Serial.begin(9600); 46 | eeprom.setChip(66); // set chip 93C56 47 | eeprom.setOrg(ORG_16); // 8-bit data organization 48 | //eeprom.writeEnable(); 49 | //eeprom.write(1, 0x01); 50 | //eeprom.writeDisable(); 51 | int a = 0; 52 | 53 | Serial.print("code: "); Serial.print(highByte(eeprom.read(1)), HEX); Serial.println(lowByte(eeprom.read(1)), HEX); 54 | if (eeprom.read(2) > 1) { 55 | Serial.println("LOCKED,unlocking: "); 56 | eeprom.writeEnable(); 57 | eeprom.write(2, 1); 58 | eeprom.writeDisable(); 59 | 60 | if (eeprom.read(2) == 1) { 61 | Serial.println("SUCCESS!"); 62 | } 63 | } 64 | if (eeprom.read(2) == 1) 65 | Serial.println("UNLOCKED."); 66 | 67 | // dump whole eeprom 68 | // for (i = 0; i < 256; i++) { 69 | // c = eeprom.read(i); 70 | // Serial.print(lowByte(c), HEX); 71 | // Serial.print(" "); 72 | // Serial.print(highByte(c), HEX); 73 | // Serial.print(" "); 74 | // a++; 75 | // if (a == 8) { 76 | // a = 0; 77 | // Serial.println(); 78 | // } 79 | // } 80 | 81 | 82 | } 83 | 84 | void loop() { 85 | // put your main code here, to run repeatedly: 86 | 87 | } 88 | -------------------------------------------------------------------------------- /stm32_i2c_slave55/stm32_i2c_slave55.ino: -------------------------------------------------------------------------------- 1 | #include //wireslave for stm32, there is no single lib for slave/master 2 | 3 | #define I2C_7BITADDR 0x55 4 | const byte MY_ADDRESS = I2C_7BITADDR; 5 | 6 | void decode_slave_i2c_data(int howmany, uint8_t data[16]); 7 | uint8_t _TP = 0; 8 | uint8_t _AS = 0; 9 | uint8_t _MEM = 0; 10 | String _NAME; 11 | uint8_t _MODE = 0; //fm=0; fm1=1 fm2=2 am=3 12 | String _FREQ; 13 | 14 | void setup() { 15 | // put your setup code here, to run once:u 16 | Wire.begin (MY_ADDRESS); 17 | Wire.onReceive (receiveEvent); 18 | Serial.begin(115200); 19 | } 20 | 21 | void loop() { 22 | // put your main code here, to run repeatedly: 23 | 24 | 25 | } 26 | 27 | void receiveEvent (int howMany) 28 | { 29 | uint8_t data[16]; 30 | //Serial.print(F("grabing i2c: wdp: ")); Serial.print(wdp);// Serial.print(F(" howmany: "); Serial.println(howMany); 31 | for (uint8_t i = 0; i < howMany; i++) { 32 | data[i] = Wire.read(); 33 | } 34 | decode_slave_i2c_data(howMany, data); 35 | 36 | } // end of receiveEvent 37 | 38 | void decode_slave_i2c_data(int howmany, uint8_t data[16]) { 39 | uint8_t dump = 1; 40 | switch (data[0]) { 41 | case 0x2: 42 | switch (data[1]) { 43 | case 0x84: 44 | Serial.println("CD track down."); 45 | break; 46 | case 0x85: 47 | Serial.println("CD track up."); 48 | break; 49 | } 50 | break; 51 | case 0x8: 52 | switch (data[1]) { 53 | case 0x81: 54 | dump = 0; 55 | Serial.println("FREQ MODE"); 56 | _TP = 0; 57 | break; 58 | case 0x82: 59 | Serial.println("TEXT MODE"); 60 | _TP = 0; 61 | break; 62 | case 0x85: 63 | Serial.println("CD MODE"); 64 | _TP = 0; 65 | _MODE = 4; 66 | break; 67 | case 0x89: 68 | _TP = 1; 69 | Serial.println("FREQ MODE + TP"); 70 | break; 71 | case 0x8A: 72 | _TP = 1; 73 | Serial.println("TEXT MODE + TP"); 74 | break; 75 | case 0x8D: 76 | Serial.println("CD MODE + TP"); 77 | _TP = 1; 78 | _MODE = 4; 79 | break; 80 | case 0xF9: 81 | _TP = 0; 82 | Serial.println("SEARCH"); 83 | break; 84 | } 85 | break; 86 | case 0x82: 87 | { 88 | //freq packet 89 | //AM = Bxxxx01xx 90 | //AM (AS) = Bxxxx11xx 91 | //FM = Bxxxxx0xx (or xxxx00xx ?) 92 | //FM (AS) = Bxxxx001x 93 | if (data[2] & B00000100) { //AM MODE 94 | _MODE = 3; //AM 95 | _FREQ = String(531 + (data[1] * 9)) + "kHz"; 96 | _MEM = data[2] >> 4; 97 | _AS = (data[2] & B00001000) ? 1 : 0; 98 | } else { //FM mode 99 | _MODE = 0; 100 | _MODE = (data[2] & B00000001) ? 2 : 1; 101 | _FREQ = String((((float)data[1] + 875) / 10), 1) + "MHz"; 102 | _MEM = data[2] >> 4; 103 | _AS = (data[2] & B00000010) ? 1 : 0; 104 | } 105 | } 106 | break; 107 | case 0xA4: //text mode 108 | { 109 | dump = 0; 110 | _NAME = String((char)data[1]) + String((char)data[2]) + String((char)data[3]) + String((char)data[4]) + String((char)data[5]) + String((char)data[6]) + String((char)data[7]) + String((char)data[8]); 111 | // Serial.println(_NAME); 112 | break;/* 113 | case 0x8: 114 | break; 115 | case 0x8: 116 | break;*/ 117 | } 118 | } 119 | if (dump) 120 | { 121 | for (uint8_t i = 0; i < howmany; i++) { 122 | Serial.print(data[i], HEX); 123 | Serial.print(" "); 124 | } 125 | Serial.println(); 126 | } 127 | if (_MODE < 4) { 128 | Serial.print(_NAME); 129 | switch (_MODE) { 130 | case 0: 131 | Serial.print(" FM "); 132 | break; 133 | case 1: 134 | Serial.print(" FM1 "); 135 | break; 136 | case 2: 137 | Serial.print(" FM2 "); 138 | break; 139 | case 3: 140 | Serial.print(" AM "); 141 | break; 142 | } 143 | Serial.println(" " + _FREQ + " Memory: " + String(_MEM) + String(_AS ? " AS" : "") + String(_TP ? " TP" : "")); 144 | } 145 | } 146 | -------------------------------------------------------------------------------- /wavegen/wavegen.ino: -------------------------------------------------------------------------------- 1 | #define CALC_CONS 125000 //125000 = 16 000 000 / 64(prescaler) / 2 ;; 2 | 3 | uint16_t freq = 10; 4 | 5 | void setup() { 6 | TIMSK1 = 0; 7 | pinMode(9, OUTPUT); 8 | TCCR1A = _BV(COM1A0) | _BV(COM1B0) | _BV(WGM11) | _BV(WGM10); 9 | TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS11) | _BV(CS10); 10 | OCR1A = CALC_CONS / freq; 11 | Serial.begin(115200); 12 | Serial.println("Output is on pin 9 (OC1A)"); 13 | Serial.println("w/s control freq up/down"); 14 | Serial.println("a/d directly in/decrement changes OCR1A register"); 15 | } 16 | 17 | void loop() { 18 | if (Serial.available()) { 19 | switch (Serial.read()) 20 | { 21 | case 'w': 22 | if (freq == 350)freq = 10; 23 | else freq++; 24 | OCR1A = CALC_CONS / freq; 25 | break; 26 | case 's': 27 | if (freq == 0)freq = 300; 28 | else freq--; 29 | OCR1A = CALC_CONS / freq; 30 | break; 31 | case 'a': 32 | OCR1A++; 33 | break; 34 | case 'd': 35 | OCR1A--; 36 | break; 37 | } 38 | Serial.println(OCR1A, HEX); 39 | Serial.println(freq); 40 | } 41 | } 42 | --------------------------------------------------------------------------------