|
@@ -4,84 +4,21 @@ if(!digitalRead(CAN_INTpin)) // If pin 2 is low, read receive
|
|
|
Serial.print("#4444 read ID: ");
|
|
Serial.print("#4444 read ID: ");
|
|
|
Serial.print(CANrxId, HEX);
|
|
Serial.print(CANrxId, HEX);
|
|
|
Serial.print(" Data: ");
|
|
Serial.print(" Data: ");
|
|
|
- /* #if defined(HAS_LCD1602)
|
|
|
|
|
- lcd.setCursor(0,0);
|
|
|
|
|
- lcd.print("ID: ");
|
|
|
|
|
- lcd.print(CANrxId, HEX);
|
|
|
|
|
- lcd.setCursor(0,1);
|
|
|
|
|
- lcd.print(" Data: ");
|
|
|
|
|
- #endif
|
|
|
|
|
- */
|
|
|
|
|
- /* #if defined(HAS_TFT_ILI9163C)
|
|
|
|
|
- DISPLAY_DEV.setCursor(0,40);
|
|
|
|
|
- DISPLAY_DEV.print("ID: ");
|
|
|
|
|
- DISPLAY_DEV.print(CANrxId, HEX);
|
|
|
|
|
- DISPLAY_DEV.setCursor(0,50);
|
|
|
|
|
- DISPLAY_DEV.print(" Data: ");
|
|
|
|
|
- #endif
|
|
|
|
|
- */
|
|
|
|
|
|
|
+
|
|
|
for(int i = 0; i<CANlen; i++) // Print each byte of the data
|
|
for(int i = 0; i<CANlen; i++) // Print each byte of the data
|
|
|
{
|
|
{
|
|
|
if(CANrxBuf[i] < 0x10) // If data byte is less than 0x10, add a leading zero
|
|
if(CANrxBuf[i] < 0x10) // If data byte is less than 0x10, add a leading zero
|
|
|
{
|
|
{
|
|
|
Serial.print("0");
|
|
Serial.print("0");
|
|
|
- // #if defined(HAS_LCD1602)
|
|
|
|
|
- // lcd.print("0");
|
|
|
|
|
- // #endif
|
|
|
|
|
- // #if defined(HAS_TFT_ILI9163C)
|
|
|
|
|
- // DISPLAY_DEV.print("0");
|
|
|
|
|
- // #endif
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
Serial.print(CANrxBuf[i], HEX);
|
|
Serial.print(CANrxBuf[i], HEX);
|
|
|
Serial.print(" ");
|
|
Serial.print(" ");
|
|
|
- /* #if defined(HAS_LCD1602)
|
|
|
|
|
- lcd.print(CANrxBuf[i], HEX);
|
|
|
|
|
- lcd.print(" ");
|
|
|
|
|
- #endif
|
|
|
|
|
- */
|
|
|
|
|
- // #if defined(HAS_TFT_ILI9163C)
|
|
|
|
|
- // DISPLAY_DEV.print(CANrxBuf[i], HEX);
|
|
|
|
|
- // DISPLAY_DEV.print(" ");
|
|
|
|
|
- // #endif
|
|
|
|
|
-
|
|
|
|
|
- // if(_Slave_Ports_queue_task_type_LIST[i]) {
|
|
|
|
|
- // Serial.print(" ["); Serial.print(_Slave_Ports_queue_task_type_LIST[i]); Serial.print("] ");
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
Serial.println();
|
|
Serial.println();
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- //EOF CAN
|
|
|
|
|
- /*TODO
|
|
|
|
|
- #if defined(HAS_LCD1602)
|
|
|
|
|
- // delay(LCDtim);
|
|
|
|
|
- //lcd.setCursor(0,1);
|
|
|
|
|
- lcd.print(lcdPattern);
|
|
|
|
|
- //lcd.print(lcdPos % 10);
|
|
|
|
|
- if(lcdPos == 16) {
|
|
|
|
|
- //lcd.print("N");
|
|
|
|
|
- lcd.setCursor(0,1);
|
|
|
|
|
- lcdPos = 0;
|
|
|
|
|
- if(lcdPattern==".") lcdPattern = "-" ;
|
|
|
|
|
- else lcdPattern = "." ;
|
|
|
|
|
- }
|
|
|
|
|
- lcdPos ++;
|
|
|
|
|
- #endif
|
|
|
|
|
- */
|
|
|
|
|
- // #if defined(HAS_TFT_ILI9163C)
|
|
|
|
|
- // delay(LCDtim);
|
|
|
|
|
- // display.setCursor(0,60);
|
|
|
|
|
- // display.print("loop....");
|
|
|
|
|
- // #endif
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|