Hallo.
Bitte um tips! Bei einfache Programm ist ein fehler aber ich kann ihm nicht finden!
Can Bus soll nachricht senden. Er sendet kein "stmp"
#include <Wire.h>
#include <SPI.h>
#define CAN_2515
#if defined(SEEED_WIO_TERMINAL) && defined(CAN_2518FD)
const int SPI_CS_PIN = BCM8;
const int CAN_INT_PIN = BCM25;
#else
const int SPI_CS_PIN = 10;
const int CAN_INT_PIN = 2;
#endif
#ifdef CAN_2518FD
#include "mcp2518_can.h"
mcp2518fd CAN(SPI_CS_PIN); // Set CS pin
#endif
#ifdef CAN_2515
#include "mcp2515_can.h"
mcp2515_can CAN(SPI_CS_PIN); // Set CS pin
#endif
void setup() {
SERIAL_PORT_MONITOR.begin(9600);
while(!Serial){};
while (CAN_OK != CAN.begin(CAN_500KBPS)) { // init can bus : baudrate = 500k
SERIAL_PORT_MONITOR.println("CAN init fail");
delay(100);
}
}
unsigned char stmp[8] = {0, 1, 2, 3, 4, 5, 6, 7};
void loop() {
-
stmp[0] = 0x01; // 1 = Laden ON*
-
stmp[1] = 0xE8; // 3E8 = 1000 = 100% liefern*
** stmp[2] = 0x03;**
** stmp[3] = 0x0E; //F6E = 3950 = 395V maximal**
** stmp[4] = 0xF6;**
** stmp[5] = 0x50; //50 = 80 = 8A maximal**
** stmp[6] = 0x00;**
** stmp[7] = 0x00;**
CAN.sendMsgBuf(0x2ff,0,0,0,stmp); // stmp sendet nicht!!!!
delay(950);
}

