J'ai retrouvé le schéma qui fonctionne chez moi : (je me disais.... je garde tout ...)
Convertisseur DCC TTL Opto Fonctionne.JPG
avec celui là, si ça ne fonctionne pas, vérifier le numéro d’interruption.
je n'utilise pas d'adresse de base dans mon décodeur !
Extraits :
#define PIN_DCC 2
#define kDCC_INTERRUPT 0
.../...
void ConfigureDecoderFunctions() // The amount of accessories must be same as in line 26 above!
{
// Voies d'entrées/Sortie ( Ici, les outputPin0 et outputPin1 contiennent les numéros de vois pour la commande de pont tournant Vnn
accessory[0].address = 37; // 10.1.0 / 10.1.1 DCC address TurnTable
accessory[0].mode = 0; // Mode commande Voie init
accessory[0].outputPin0 = 1; // Voie 1 Entrée
accessory[0].outputPin1 = 2; // Voie 2 Sortie
accessory[0].onoff0 = 1000; // Initially set Green signal to Off
accessory[0].onoff1 = 1000; // Initially set Red signal to Off
accessory[1].address = 38; // 10.2.0 / 10.2.1 DCC address TurnTable
accessory[1].mode = 0; // Mode commande Voie init
accessory[1].outputPin0 = 3; // Butoir 3
accessory[1].outputPin1 = 4; // Butoir 4
accessory[1].onoff0 = 1000; // Initially set Green signal to Off
accessory[1].onoff1 = 1000; // Initially set Red signal to Off
.../...
void BasicAccDecoderPacket_Handler(int address, boolean activate, byte data)
{
Serial.print(F("Adresse DCC Brute : "));
Serial.print(address);
Serial.print(" Data : ");
Serial.print(data);
// Convert NMRA packet address format to human address
address -= 1;
address *= 4;
address += 1;
address += (data & 0x06) >> 1;
boolean enable = (data & 0x01) ? 1 : 0;
Serial.print(F(" Adresse DCC Claire : "));
Serial.print(address);
Serial.print(" Enable : ");
Serial.print(enable);
Serial.print(" Activate : ");
Serial.println(activate);
.../...