// import libaries and define stuff
#include <U8g2lib.h> //libary for OLED-Displays
#include <SPI.h> //libary for SPI_Interface
#include <Adafruit_NeoPixel.h> //Neopixel libary for LED-Strips
U8G2_SSD1306_128X64_ALT0_F_HW_I2C mainDisplay(U8G2_R0, /* reset=*/ U8X8_PIN_NONE); // define OLED-Diaplay type and name it (U8G2_R0, /* cs=*/, /* dc=*/, /* reset=*/);
#define numberofPixels 16 // define number of pixels connected
Adafruit_NeoPixel strip(numberofPixels , 22, NEO_GRB + NEO_KHZ800); // define LED-Type and name it (numberofPixels connected, pin pixels are connected to, NEO_GRB + NEO_KHZ800);
//#define powerON 22 //if high
#define swo 10
#define sw1 9
//
const unsigned char startup_bitmap [] U8X8_PROGMEM =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xe0, 0x01, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7a, 0x7c, 0x0f, 0x97, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x06, 0x18, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x20, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x60, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc1, 0x00, 0xc0, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x10, 0xc2, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x09, 0xe4, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x07, 0xf8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x07, 0xf8, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x07, 0xf8, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x1f, 0xfe, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfc, 0x0f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x38, 0x07, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xf8, 0x07, 0x8e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0xf8, 0x07, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0xff, 0xff, 0xe7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x27, 0xff, 0xff, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x83, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x01, 0xe0, 0x3f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x01, 0xc0, 0x1f, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xdc, 0x00, 0xc0, 0x0c, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x9c, 0x00, 0xc0, 0x0c, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x1c, 0x01, 0xe0, 0x0c, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x1c, 0x01, 0xe0, 0x0c, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x1c, 0x03, 0xf0, 0x1c, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x1e, 0x07, 0xf8, 0x1c, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x3f, 0x1f, 0xff, 0xfe, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xbf, 0xfc, 0x0f, 0xfe, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xf8, 0x07, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0xf0, 0x03, 0xe1, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe1, 0xf0, 0x03, 0xc1, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0xf0, 0x03, 0x81, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x70, 0x03, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x38, 0x03, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x38, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x3e, 0x0f, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3f, 0xff, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x3f, 0xff, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xfe, 0x1f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xf0, 0x03, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x07, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
//
const unsigned char warning_sign [] U8X8_PROGMEM =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x09, 0x00, 0x80, 0x16, 0x00, 0xc0, 0x36, 0x00, 0x40, 0x26,
0x00, 0x60, 0x60, 0x00, 0x20, 0x42, 0x00, 0x30, 0xc0, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
// temp icon
const unsigned char temp_icon [] U8X8_PROGMEM =
{
0x00, 0x0f, 0x00, 0x00, 0x09, 0x00, 0x00, 0x09, 0x00, 0x00, 0x09, 0x00, 0x00, 0x0f, 0x00, 0x00,
0x0f, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x0f,
0x00, 0x00, 0x0f, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x0f, 0x00, 0x80, 0x1f, 0x00, 0x80, 0x1f, 0x00,
0xc0, 0x3f, 0x00, 0xc0, 0x3f, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x0f, 0x00
};
// init OBD values
int SPEED = 0; //vehicle speed in km/h
int ENGINE_RUNTIME = 666; //engine runtime in s
int COOLANT_TEMP = 0; //coolant temperature in C*
int ENGINE_LOAD = 0; //engine load in %
int ENGINE_RPM = 0; //engine rpm in rpm
//
bool ledsw = true;
bool dispsw = true;
int color = 0;
int speed = 200;
// sets threshold values for warning messages
// MAX VALUES!!!!!!!!!!!!!
unsigned char max_engine_coolant_temp = 101; // max temprature of engine coolant
unsigned char warning_temp_end = 100;
unsigned char warning_temp_start = 92;
unsigned int max_engine_rmp = 5500; // max rpm of engine
// MIN VALUES!!!!!!!!!!!!!
unsigned int min_engine_rpm = 800; // min rpm of engine
//
void setup() // setup for core 0
{
startup();
}
// loop core 0
void loop()
{
// read PIDs from OBDII adapter
SPEED = map(analogRead(A0),0,1024,0,200);
COOLANT_TEMP = map(analogRead(A1),0,1024,0,120);
ENGINE_RPM = map(analogRead(A2),0,1024,0,6000);
//Serial1.println(SPEED);
//
ledsw = digitalRead(swo);
// safety warnings
if ( COOLANT_TEMP > max_engine_coolant_temp) { tempalarm(); } // detects if engine coolant temp is over max collant temp value
if ( COOLANT_TEMP > warning_temp_start) { tempwarning(); } // detects if engine coolant temp is in warning level
if ( ENGINE_RPM < min_engine_rpm & ENGINE_RUNTIME != 0) { lowrpmalarm(); } // detects if motor is running if rpm is under low rpm value
if ( ENGINE_RPM > max_engine_rmp) { highrpmalarm(); } // detects if RPM is over max rmp value
if ( SPEED == 199) { turnoff(); } // detects if car is shut off
if ( ledsw == true ) { rpmled(); } else {fadeled(); }
//
// displaying text on Head up Display
mainDisplay.clearBuffer();
//mainDisplay.setDrawColor(1);
mainDisplay.setFont(u8g2_font_luBIS24_tf); //u8g2_font_smart_patrol_nbp_tr u8g2_font_bubble_tn
mainDisplay.setCursor(8,25);
mainDisplay.print(SPEED);
mainDisplay.setFont(u8g2_font_smart_patrol_nbp_tr); //u8g2_font_smart_patrol_nbp_tr u8g2_font_bubble_tn
mainDisplay.setCursor(80,58);
mainDisplay.print(ENGINE_RUNTIME / 60);
mainDisplay.drawXBM( 18, 38, 20, 20, temp_icon); //draw bitmap
mainDisplay.setCursor(2,58);
mainDisplay.print(COOLANT_TEMP);
mainDisplay.setFont(u8g2_font_6x13_te );
mainDisplay.setCursor(95,10);
mainDisplay.print("km/h");
//mainDisplay.setCursor(20,58);
//mainDisplay.print(" *C");
mainDisplay.setCursor(110,58);
mainDisplay.print("min");
//draw engine load in bar at bottom of screen
mainDisplay.drawBox(0, 61, map (ENGINE_LOAD, 0, 100, 0, 128), 3);
//
mainDisplay.sendBuffer();
//
}
void rpmled()
{
// light up strip according to engine rpm
//strip.clear();
strip.fill(strip.ColorHSV(map(ENGINE_RPM, 0, 5200, 32000, 65535), 255, 255));
strip.show();
//
}
void fadeled()
{
// light up strip according to engine rpm
color = color + speed;
if (color >= 65535) color = 0;
strip.fill(strip.ColorHSV(color, 255, 255));
strip.show();
//
}
void startup()
{
// light up green led on board to show setup is running
pinMode(LED_BUILTIN,OUTPUT);
digitalWrite(LED_BUILTIN, HIGH);
//pinMode(powerON,INPUT_PULLUP)
pinMode(swo, INPUT_PULLUP);
pinMode(sw1, INPUT_PULLUP);
//
// init serial connection
//Serial1.begin(115200);
//
// initialize mainDisplay
mainDisplay.begin(); //begin connection display
mainDisplay.clearBuffer(); //clear Buffer at begin
//u8g21.setDisplayRotation(U8G2_MIRROR); //Mirrors display for reflection to be straigth
//u8g21.setDisplayRotation(U8G2_R2); //rotate display 180 degrees
mainDisplay.drawXBM( 0, 0, 128, 64, startup_bitmap); //draw bitmap
mainDisplay.sendBuffer(); // send Bitmap
delay(1200); //display logo for 1.2s before further initialisation
mainDisplay.clearBuffer();
mainDisplay.setFont(u8g2_font_smart_patrol_nbp_tr); //u8g2_font_smart_patrol_nbp_tr u8g2_font_bubble_tn
mainDisplay.setCursor(1,10);
mainDisplay.print("Display init...");
mainDisplay.setCursor(100,10);
mainDisplay.print("ok");
//mainDisplay.sendBuffer();
//
// init NeoPixel-connection
//print on display that connection is being initiated
mainDisplay.setCursor(1,24);
mainDisplay.print("LED init... ");
mainDisplay.sendBuffer();
//NeoPixel strip.begin
//wait until connection is ready
strip.begin();
strip.show();
// display pixels color
for(int i=0; i<numberofPixels; i++)
{
strip.setPixelColor(i, 200,200,200);
strip.show(); // Send the updated pixel colors to the hardware.
delay(60);
}
//print that connection to OBDII adapter is sucessful
mainDisplay.setCursor(100,24);
mainDisplay.print("ok");
//mainDisplay.sendBuffer();
//
// init OBD-connection
//print on display that connection is being initiated
mainDisplay.setCursor(1,38);
mainDisplay.print("OBD init... ");
mainDisplay.sendBuffer();
delay(1000); // wait for OBD-II Adapter
//print that connection to OBDII adapter is sucessful
mainDisplay.setCursor(100,38);
mainDisplay.print("ok");
mainDisplay.sendBuffer();
mainDisplay.setCursor(1,52);
mainDisplay.print(12.2);
mainDisplay.print(" V");
mainDisplay.sendBuffer();
delay(1000);
// turn of onboard LED to show setup is complete
digitalWrite(LED_BUILTIN, LOW);
}
void turnoff()
{
digitalWrite(LED_BUILTIN, HIGH);
mainDisplay.clearBuffer();
mainDisplay.setFont(u8g2_font_smart_patrol_nbp_tr); //u8g2_font_smart_patrol_nbp_tr u8g2_font_bubble_tn
mainDisplay.setCursor(1,10);
mainDisplay.print("Shutting down.");
//obd.unint();
for(int i=numberofPixels; i!=0; i--)
{
strip.setPixelColor(i, 0,0,0);
strip.show(); // Send the updated pixel colors to the hardware.
delay(40);
}
//obd.end();
mainDisplay.clearBuffer();
mainDisplay.sendBuffer();
digitalWrite(LED_BUILTIN, LOW);
delay(20000);
}
void tempalarm() // ALARM Display for to HIGH Engine collant temperature
{
mainDisplay.clearBuffer();
// display current collant temp
mainDisplay.setFont(u8g2_font_smart_patrol_nbp_tr); //u8g2_font_smart_patrol_nbp_tr u8g2_font_bubble_tn
mainDisplay.setCursor(28,21);
mainDisplay.print("HIGH TEMP");
mainDisplay.setCursor(34,44);
mainDisplay.setFont(u8g2_font_crox5h_tr);
mainDisplay.print(COOLANT_TEMP);
mainDisplay.print("*C");
// display current speed in bottom left corner
mainDisplay.setCursor(2,60);
mainDisplay.setFont(u8g2_font_6x10_tf );
mainDisplay.print(SPEED);
mainDisplay.print(" km/h");
//mainDisplay.sendBuffer();
// set leds to red
strip.fill(strip.ColorHSV(0, 255, 255));
strip.show();
//delay(142);
mainDisplay.setFont(u8g2_font_smart_patrol_nbp_tr);
mainDisplay.setCursor(30,9);
mainDisplay.print("WARNING!!!!!");
mainDisplay.sendBuffer();
// turn off lights to become blinking red effect
strip.clear();
strip.show();
return loop();
}
void tempwarning()
{
mainDisplay.drawXBM( 32, 35, 20, 20, warning_sign); //draw bitmap
mainDisplay.sendBuffer();
}
void lowrpmalarm() // ALARM Display for to LOW RPM value
{
mainDisplay.clearBuffer();
mainDisplay.setFont(u8g2_font_smart_patrol_nbp_tr); //u8g2_font_smart_patrol_nbp_tr u8g2_font_bubble_tn
mainDisplay.setCursor(34,21);
mainDisplay.print("LOW RPM");
mainDisplay.setCursor(26,44);
mainDisplay.setFont(u8g2_font_crox5h_tr);
mainDisplay.print(ENGINE_RPM);
mainDisplay.print(" rpm");
mainDisplay.setCursor(2,60);
mainDisplay.setFont(u8g2_font_6x10_tf );
mainDisplay.print(SPEED);
mainDisplay.print(" km/h");
mainDisplay.setCursor(90,60);
mainDisplay.setFont(u8g2_font_6x10_tf );
mainDisplay.print(COOLANT_TEMP);
mainDisplay.print(" C*");
//mainDisplay.sendBuffer();
// set leds to red
strip.fill(strip.ColorHSV(0, 255, 255));
strip.show();
//delay (142);
mainDisplay.setFont(u8g2_font_smart_patrol_nbp_tr); //u8g2_font_smart_patrol_nbp_tr u8g2_font_bubble_tn
mainDisplay.setCursor(30,9);
mainDisplay.print("WARNING!!!!!");
mainDisplay.sendBuffer();
// turn off lights to become blinking red effect
strip.clear();
strip.show();
return loop();
}
void highrpmalarm() // ALARM Display for to HIGH RPM value
{
mainDisplay.clearBuffer();
mainDisplay.setFont(u8g2_font_smart_patrol_nbp_tr); //u8g2_font_smart_patrol_nbp_tr u8g2_font_bubble_tn
mainDisplay.setCursor(32,21);
mainDisplay.print("HIGH RPM");
mainDisplay.setCursor(15,44);
mainDisplay.setFont(u8g2_font_crox5h_tr);
mainDisplay.print(ENGINE_RPM);
mainDisplay.print(" rpm");
mainDisplay.setCursor(2,60);
mainDisplay.setFont(u8g2_font_6x10_tf );
mainDisplay.print(SPEED);
mainDisplay.print(" km/h");
mainDisplay.setCursor(90,60);
mainDisplay.setFont(u8g2_font_6x10_tf );
mainDisplay.print(COOLANT_TEMP);
mainDisplay.print(" C*");
//mainDisplay.sendBuffer();
// set leds to red
strip.fill(strip.ColorHSV(0, 255, 255));
strip.show();
//delay (142);
mainDisplay.setFont(u8g2_font_smart_patrol_nbp_tr); //u8g2_font_smart_patrol_nbp_tr u8g2_font_bubble_tn
mainDisplay.setCursor(30,9);
mainDisplay.print("WARNING!!!!!");
mainDisplay.sendBuffer();
// turn off lights to become blinking red effect
strip.clear();
strip.show();
return loop();
}
// CORE 01
void setup1()
{
}
void loop1()
{
}
// CORE 1 END