I'm trying to call up ignition simulation to enter the hidden menu in the bmw meter to enter the timer test, but the hidden menu shows for a second and disappears
#include <SPI.h>
#include <mcp_can.h>
#define lo8(x) (uint8_t)((x) & 0xFF)
#define hi8(x) (uint8_t)(((x) >> 8) & 0xFF)
const int SPI_CS_PIN = 10;
MCP_CAN CAN(SPI_CS_PIN);
void sendIgnitionKeyOn() {
uint16_t canId = 0x130;
uint8_t len = 5;
uint8_t buf[8] = {0x45, 0x40, 0x21, 0x8F, 0xFE, 0, 0, 0};
CAN.sendMsgBuf(canId, 0, len, buf);
Serial.println("Wysłano: Zapłon ON");
}
void sendRPM(uint16_t rpm) {
uint16_t tempRpm = rpm * 4;
uint16_t canId = 0x0AA;
uint8_t len = 8;
uint8_t buf[8] = {0xFE, 0xFE, 0xFF, 0x00, 0, 0, 0xFE, 0x99};
buf[4] = lo8(tempRpm);
buf[5] = hi8(tempRpm);
CAN.sendMsgBuf(canId, 0, len, buf);
Serial.print("Wysłano: RPM = ");
Serial.println(rpm);
}
void sendLightsOn() {
uint16_t canId = 0x21A;
uint8_t len = 3;
uint8_t buf[8] = {0b00000101, 0b00010000, 0x00, 0, 0, 0, 0, 0};
CAN.sendMsgBuf(canId, 0, len, buf);
Serial.println("Wysłano: Światła ON");
}
void sendFuelLevel(uint16_t litres) {
uint16_t canId = 0x349;
uint8_t len = 5;
uint8_t buf[8] = {0};
uint16_t sensor1 = litres * 160;
buf[0] = lo8(sensor1);
buf[1] = hi8(sensor1);
buf[2] = lo8(sensor1);
buf[3] = hi8(sensor1);
CAN.sendMsgBuf(canId, 0, len, buf);
Serial.print("Wysłano: Poziom paliwa = ");
Serial.print(litres);
Serial.println(" litrów");
}
void setup() {
Serial.begin(115200);
Serial.println("Start programu");
while (CAN_OK != CAN.begin(MCP_ANY, CAN_100KBPS, MCP_8MHZ)) {
Serial.println("Inicjalizacja CAN nie powiodła się, próbuję ponownie...");
delay(1000);
}
Serial.println("CAN zainicjalizowany poprawnie");
CAN.setMode(MCP_NORMAL);
sendIgnitionKeyOn();
sendFuelLevel(24);
sendLightsOn();
sendRPM(800);
}
void loop() {
}
I would like to ask for help, in short I need to have access to the hidden menu so I can do a test of the clocks
USE:
arduino uno r3
MCP2515
bmw e90 meter
12v power supply to power the meter