Now I have installed Ray Livingston's versions of the nextion itead library.
I have the following setup and loop in the program I already loaded up:
void setup() {
// input pins
pinMode(wheelsensorPin, INPUT_PULLUP);
pinMode(hallsensor_leftPin, INPUT_PULLUP);
pinMode(hallsensor_rightPin, INPUT_PULLUP);
pinMode(speedgripPin, INPUT);
pinMode(keyswitchPin, INPUT);
pinMode(vitotalPin, INPUT);
// output pins
pinMode(activationPin, OUTPUT);
pinMode(cooling1Pin, OUTPUT);
pinMode(cooling2Pin, OUTPUT);
pinMode(foilheater1Pin, OUTPUT);
pinMode(foilheater2Pin, OUTPUT);
pinMode(cirrusheaterPin, OUTPUT);
pinMode(cirrusfanPin, OUTPUT);
pinMode(lightPin, OUTPUT);
pinMode(directionPin, OUTPUT);
pinMode(honkPin, OUTPUT);
pinMode(leftblinkerPin, OUTPUT);
pinMode(rightblinkerPin, OUTPUT);
// set outputs to low -> relays are off
digitalWrite(activationPin, HIGH);// Motor controllers are off at setup
digitalWrite(cooling1Pin, LOW);
digitalWrite(cooling2Pin, LOW);
digitalWrite(foilheater1Pin, LOW);
digitalWrite(foilheater2Pin, LOW);
digitalWrite(cirrusheaterPin, LOW);
digitalWrite(cirrusfanPin, LOW);
digitalWrite(lightPin, LOW);
digitalWrite(directionPin, HIGH);
digitalWrite(honkPin, LOW);
digitalWrite(leftblinkerPin, LOW);
digitalWrite(rightblinkerPin, LOW);
wheelsensorCounter = maxwheelsensorCounter;
trip();
Serial.begin(115200);
Serial2.begin(115200);
dac_L.begin(0x62);
dac_R.begin(0x63);
//bme.begin(0x76);
nexInit();
void loop() {
//nexLoop(nex_listen_list);
Serial.println("TEST");
/* int switchonoff = digitalRead(keyswitchPin);
if (switchonoff == HIGH && setswitch == 0){ //initially get stored values from EEPROM if keyswitch turned on
Serial.print("TEST");
setswitch = 1;
}
if (switchonoff == HIGH && setswitch == 1){
Serial.print("TEST2");
//setpoint_angular_velocities();
pageid.getValue(&pId);
if (pId == 1)
{
if (initialize == 1)
{
get_stored_values();
digitalWrite(activationPin, LOW); // motor controllers are activated by Low signal
initialize = 0;
}
btx_state_page1();
// electric_current_and_charge();
blinker();
lightonoff();
honkonoff();
autocruise();
// trip();
// actualrpm(5,1);
// actualrpm(4,2);
// electronic_differential();
// display_speed();
// if( blinkermarker == false){
pressure_temperature_humidity();
// }
}
if (pId == 2){
btx_state_page2();
}
if (pId == 3){
btx_state_page3();
}
if (pId == 4){
btx_state_page4();
}
if (pId == 5)
{
btx_state_page5();
}
}
if (switchonoff == LOW && setswitch == 1){ //store only changed values to EEPROM if keyswitch turned off
Serial.print("TEST off");
store_values();
digitalWrite(activationPin, HIGH); //Motor controllers are switched off
setswitch = 0;
initialize = 1;
}*/
}
}
If I comment out nexInit(); and start the serial monitor "TEST" is displayed at 115200 baud
If nexInit(); is executed I get nothing at 115200 baud but "TEST" at 9600 baud
Thus nexInit has somehow changed the baud rate of serial ports.
As Nextion display is set to 115200 baud as well I get a time out as communication is set to 9600 baud.
I already tried to reinstall the original Iteadlib from Nextion without success.
Where can I change the baud rate at Nextion library such that communication starts at 115200 baud?