updated the examples to reflect the removal of support for the two call-back functions: notifyDccAccState(), notifyDccSigState()
This commit is contained in:
@@ -370,24 +370,20 @@ void loop() //****************************************************************
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void notifyDccAccState( uint16_t Addr, uint16_t BoardAddr, uint8_t OutputAddr, uint8_t State) {
|
extern void notifyDccAccTurnoutOutput( uint16_t Addr, uint8_t Direction, uint8_t OutputPower ) {
|
||||||
uint16_t Current_Decoder_Addr;
|
uint16_t Current_Decoder_Addr = Dcc.getAddr();
|
||||||
uint8_t Bit_State;
|
|
||||||
Current_Decoder_Addr = Dcc.getAddr();
|
|
||||||
Bit_State = OutputAddr & 0x01;
|
|
||||||
|
|
||||||
if ( Addr >= Current_Decoder_Addr && Addr < Current_Decoder_Addr+17) { //Controls Accessory_Address+16
|
if ( Addr >= Current_Decoder_Addr && Addr < Current_Decoder_Addr+17) { //Controls Accessory_Address+16
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
Serial.print("Addr = ");
|
Serial.print("Addr = ");
|
||||||
Serial.println(Addr);
|
Serial.println(Addr);
|
||||||
Serial.print("BoardAddr = ");
|
Serial.print("Direction = ");
|
||||||
Serial.println(BoardAddr);
|
Serial.println(Direction);
|
||||||
Serial.print("Bit_State = ");
|
|
||||||
Serial.println(Bit_State);
|
|
||||||
#endif
|
#endif
|
||||||
exec_function(Addr-Current_Decoder_Addr, Bit_State );
|
exec_function(Addr-Current_Decoder_Addr, Direction );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void exec_function (int function, int FuncState) {
|
void exec_function (int function, int FuncState) {
|
||||||
byte pin;
|
byte pin;
|
||||||
int servo_temp;
|
int servo_temp;
|
||||||
|
@@ -370,24 +370,20 @@ void loop() //****************************************************************
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void notifyDccAccState( uint16_t Addr, uint16_t BoardAddr, uint8_t OutputAddr, uint8_t State) {
|
extern void notifyDccAccTurnoutOutput( uint16_t Addr, uint8_t Direction, uint8_t OutputPower ) {
|
||||||
uint16_t Current_Decoder_Addr;
|
uint16_t Current_Decoder_Addr = Dcc.getAddr();
|
||||||
uint8_t Bit_State;
|
|
||||||
Current_Decoder_Addr = Dcc.getAddr();
|
|
||||||
Bit_State = OutputAddr & 0x01;
|
|
||||||
|
|
||||||
if ( Addr >= Current_Decoder_Addr && Addr < Current_Decoder_Addr+17) { //Controls Accessory_Address+16
|
if ( Addr >= Current_Decoder_Addr && Addr < Current_Decoder_Addr+17) { //Controls Accessory_Address+16
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
Serial.print("Addr = ");
|
Serial.print("Addr = ");
|
||||||
Serial.println(Addr);
|
Serial.println(Addr);
|
||||||
Serial.print("BoardAddr = ");
|
Serial.print("Direction = ");
|
||||||
Serial.println(BoardAddr);
|
Serial.println(Direction);
|
||||||
Serial.print("Bit_State = ");
|
|
||||||
Serial.println(Bit_State);
|
|
||||||
#endif
|
#endif
|
||||||
exec_function(Addr-Current_Decoder_Addr, Bit_State );
|
exec_function(Addr-Current_Decoder_Addr, Direction );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void exec_function (int function, int FuncState) {
|
void exec_function (int function, int FuncState) {
|
||||||
byte pin;
|
byte pin;
|
||||||
int servo_temp;
|
int servo_temp;
|
||||||
|
@@ -93,9 +93,8 @@ void loop()
|
|||||||
// You MUST call the NmraDcc.process() method frequently from the Arduino loop() function for correct library operation
|
// You MUST call the NmraDcc.process() method frequently from the Arduino loop() function for correct library operation
|
||||||
Dcc.process();
|
Dcc.process();
|
||||||
}
|
}
|
||||||
extern void notifyDccAccState( uint16_t Addr, uint16_t BoardAddr, uint8_t OutputAddr, uint8_t State) {
|
extern void notifyDccAccTurnoutOutput( uint16_t Addr, uint8_t Direction, uint8_t OutputPower ) {
|
||||||
uint8_t Bit_State = OutputAddr & 0x01;
|
|
||||||
if ( Addr >= This_Decoder_Address && Addr < This_Decoder_Address+17) //Controls This_Decoder_Address+16
|
if ( Addr >= This_Decoder_Address && Addr < This_Decoder_Address+17) //Controls This_Decoder_Address+16
|
||||||
digitalWrite( ledpins[Addr-This_Decoder_Address], Bit_State );
|
digitalWrite( ledpins[Addr-This_Decoder_Address], Direction );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -370,24 +370,20 @@ void loop() //****************************************************************
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void notifyDccAccState( uint16_t Addr, uint16_t BoardAddr, uint8_t OutputAddr, uint8_t State) {
|
extern void notifyDccAccTurnoutOutput( uint16_t Addr, uint8_t Direction, uint8_t OutputPower ) {
|
||||||
uint16_t Current_Decoder_Addr;
|
uint16_t Current_Decoder_Addr = Dcc.getAddr();
|
||||||
uint8_t Bit_State;
|
|
||||||
Current_Decoder_Addr = Dcc.getAddr();
|
|
||||||
Bit_State = OutputAddr & 0x01;
|
|
||||||
|
|
||||||
if ( Addr >= Current_Decoder_Addr && Addr < Current_Decoder_Addr+17) { //Controls Accessory_Address+16
|
if ( Addr >= Current_Decoder_Addr && Addr < Current_Decoder_Addr+17) { //Controls Accessory_Address+16
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
Serial.print("Addr = ");
|
Serial.print("Addr = ");
|
||||||
Serial.println(Addr);
|
Serial.println(Addr);
|
||||||
Serial.print("BoardAddr = ");
|
Serial.print("Direction = ");
|
||||||
Serial.println(BoardAddr);
|
Serial.println(Direction);
|
||||||
Serial.print("Bit_State = ");
|
|
||||||
Serial.println(Bit_State);
|
|
||||||
#endif
|
#endif
|
||||||
exec_function(Addr-Current_Decoder_Addr, Bit_State );
|
exec_function(Addr-Current_Decoder_Addr, Direction );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void exec_function (int function, int FuncState) {
|
void exec_function (int function, int FuncState) {
|
||||||
byte pin;
|
byte pin;
|
||||||
int servo_temp;
|
int servo_temp;
|
||||||
|
@@ -352,24 +352,20 @@ void loop() //****************************************************************
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void notifyDccAccState( uint16_t Addr, uint16_t BoardAddr, uint8_t OutputAddr, uint8_t State) {
|
extern void notifyDccAccTurnoutOutput( uint16_t Addr, uint8_t Direction, uint8_t OutputPower ) {
|
||||||
uint16_t Current_Decoder_Addr;
|
uint16_t Current_Decoder_Addr = Dcc.getAddr();
|
||||||
uint8_t Bit_State;
|
|
||||||
Current_Decoder_Addr = Dcc.getAddr();
|
|
||||||
Bit_State = OutputAddr & 0x01;
|
|
||||||
|
|
||||||
if ( Addr >= Current_Decoder_Addr && Addr < Current_Decoder_Addr+17) { //Controls Accessory_Address+16
|
if ( Addr >= Current_Decoder_Addr && Addr < Current_Decoder_Addr+17) { //Controls Accessory_Address+16
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
Serial.print("Addr = ");
|
Serial.print("Addr = ");
|
||||||
Serial.println(Addr);
|
Serial.println(Addr);
|
||||||
Serial.print("BoardAddr = ");
|
Serial.print("Direction = ");
|
||||||
Serial.println(BoardAddr);
|
Serial.println(Direction);
|
||||||
Serial.print("Bit_State = ");
|
|
||||||
Serial.println(Bit_State);
|
|
||||||
#endif
|
#endif
|
||||||
exec_function(Addr-Current_Decoder_Addr, Bit_State );
|
exec_function(Addr-Current_Decoder_Addr, Direction );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void exec_function (int function, int FuncState) {
|
void exec_function (int function, int FuncState) {
|
||||||
byte pin;
|
byte pin;
|
||||||
int servo_temp;
|
int servo_temp;
|
||||||
|
@@ -370,24 +370,20 @@ void loop() //****************************************************************
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern void notifyDccAccState( uint16_t Addr, uint16_t BoardAddr, uint8_t OutputAddr, uint8_t State) {
|
extern void notifyDccAccTurnoutOutput( uint16_t Addr, uint8_t Direction, uint8_t OutputPower ) {
|
||||||
uint16_t Current_Decoder_Addr;
|
uint16_t Current_Decoder_Addr = Dcc.getAddr();
|
||||||
uint8_t Bit_State;
|
|
||||||
Current_Decoder_Addr = Dcc.getAddr();
|
|
||||||
Bit_State = OutputAddr & 0x01;
|
|
||||||
|
|
||||||
if ( Addr >= Current_Decoder_Addr && Addr < Current_Decoder_Addr+17) { //Controls Accessory_Address+16
|
if ( Addr >= Current_Decoder_Addr && Addr < Current_Decoder_Addr+17) { //Controls Accessory_Address+16
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
Serial.print("Addr = ");
|
Serial.print("Addr = ");
|
||||||
Serial.println(Addr);
|
Serial.println(Addr);
|
||||||
Serial.print("BoardAddr = ");
|
Serial.print("Direction = ");
|
||||||
Serial.println(BoardAddr);
|
Serial.println(Direction);
|
||||||
Serial.print("Bit_State = ");
|
|
||||||
Serial.println(Bit_State);
|
|
||||||
#endif
|
#endif
|
||||||
exec_function(Addr-Current_Decoder_Addr, Bit_State );
|
exec_function(Addr-Current_Decoder_Addr, Direction );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void exec_function (int function, int FuncState) {
|
void exec_function (int function, int FuncState) {
|
||||||
byte pin;
|
byte pin;
|
||||||
int servo_temp;
|
int servo_temp;
|
||||||
|
Reference in New Issue
Block a user