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:
kaixxx
2019-01-07 15:37:30 +01:00
parent 962660f3e8
commit 19203a365d
8 changed files with 731 additions and 23 deletions
+2 -2
View File
@@ -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);
}