added MCP_CS setting
This commit is contained in:
parent
f580385ef9
commit
5756ccb16e
|
@ -15,16 +15,17 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//----- CONFIGURATION -----//
|
//----- CONFIGURATION -----//
|
||||||
#define SERIAL_SPEED 115200 //Recommended values : 115200, 150000, 250000, 500000, 1000000, 2000000
|
#define MCP_CS 10;
|
||||||
#define MCP_FREQUENCY MCP_8MHZ //Available values : MCP_8MHZ, MCP_16MHZ, MCP_20MHZ
|
#define MCP_FREQUENCY MCP_8MHZ //Available values : MCP_8MHZ, MCP_16MHZ, MCP_20MHZ
|
||||||
|
#define SERIAL_SPEED 115200 //Recommended values : 115200, 150000, 250000, 500000, 1000000, 2000000
|
||||||
#DEFAULT_CAN_SPEED CAN_500KBPS; //Available values : CAN_10KBPS, CAN_20KBPS, CAN_50KBPS, CAN_100KBPS, CAN_125KBPS, CAN_250KBPS, CAN_500KBPS, CAN_1000KBPS
|
#DEFAULT_CAN_SPEED CAN_500KBPS; //Available values : CAN_10KBPS, CAN_20KBPS, CAN_50KBPS, CAN_100KBPS, CAN_125KBPS, CAN_250KBPS, CAN_500KBPS, CAN_1000KBPS
|
||||||
//----------//
|
//----------//
|
||||||
|
|
||||||
//Don't forget to search on mcp2515 library sources to understand how functions works
|
//Don't forget to search in mcp_can library sources to understand how functions works
|
||||||
#include <SPI.h>
|
#include <SPI.h>
|
||||||
#include "mcp_can.h"//MCP2515 library
|
#include "mcp_can.h"//MCP2515 library
|
||||||
|
|
||||||
MCP_CAN CAN(10); // Set CS pin
|
MCP_CAN CAN(MCP_CS); // Set CS pin
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(SERIAL_SPEED);
|
Serial.begin(SERIAL_SPEED);
|
||||||
|
@ -265,7 +266,7 @@ void slcanProcessRX(uint8_t rx_buffer_len, uint8_t *rx_buffer)
|
||||||
else if(rx_buffer[0] == 'N')
|
else if(rx_buffer[0] == 'N')
|
||||||
{
|
{
|
||||||
Serial.write('N');
|
Serial.write('N');
|
||||||
Serial.print("SLCA");
|
Serial.print("SLGR");
|
||||||
Serial.write(13);
|
Serial.write(13);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue