mirror of
https://github.com/Seeed-Studio/Seeed_Arduino_CAN.git
synced 2026-07-28 04:06:45 +00:00
Add sleep and gpio support + examples
Added sleep support for MCP2515 + MCP2551. This way, you can reduce the power consumption of a complete node down to around 240uA! Changes: - Reintroduced gpio support from commits 43521de/bac66d1 (adlerweb, 15/01/2018) and corrected the errors - Introduced advanced sleep support based on https://github.com/coryjfowler/MCP_CAN_lib/pull/10/files - added example code (receive_sleep and send_sleep) - tested everything
This commit is contained in:
@@ -19,7 +19,7 @@ void setup()
|
||||
}
|
||||
Serial.println("CAN init ok");
|
||||
|
||||
if(CAN.pinMode(MCP_TX2RTS, MCP_PIN_IN))
|
||||
if(CAN.mcpPinMode(MCP_TX2RTS, MCP_PIN_IN))
|
||||
{
|
||||
Serial.println("TX2RTS is now an input");
|
||||
}
|
||||
@@ -32,7 +32,7 @@ void setup()
|
||||
void loop()
|
||||
{
|
||||
Serial.print("TX2RTS is currently ");
|
||||
Serial.println(CAN.digitalRead(MCP_TX2RTS));
|
||||
Serial.println(CAN.mcpDigitalRead(MCP_TX2RTS));
|
||||
delay(500);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user