Hi Everyone, I've been trying for several weeks now, and have been to so many pages looking for a solution but i am well and truly stuck and cant find anyone that has done this.
Ive built a very fast brushless razor electric scooter and have designed some dials to display the voltage and amps and so forth. aand maybe nav in the future.
I'm using an uno and have got the nextion display to work on softwareserial on basic sketchs with a pot just to make sure software serial was working.
I am using solid geeks libaries for the vesc and have had that working on the serial monitor but as soon as i add the nextion stuff it stops working and says faied to get data in the serial monitor.
Thanks in advanced
#include <SoftwareSerial.h>
// Master RX, TX, connect to Nextion TX, RX
SoftwareSerial HMISerial(10,11);
#include "Nextion.h"
#include <Nexnumber.h>
#include <buffer.h>
#include <crc.h>
#include <datatypes.h>
#include <VescUart.h>
#include <VescUart.h>
/** Initiate VescUart class */
VescUart UART;
void setup() {
/** Setup Serial port to display data */
HMISerial.begin(9600);
/** Setup UART port (Serial1 on Atmega32u4) */
Serial.begin(115200);
while (!Serial) {;}
/** Define which ports to use as UART */
UART.setSerialPort(&Serial);
}
void loop() {
/** Call the function getVescValues() to acquire data from VESC */
if ( UART.getVescValues() ) {
HMISerial.print("n0.val=");
HMISerial.print(UART.data.inpVoltage);
HMISerial.write(0xff);
HMISerial.write(0xff);
HMISerial.write(0xff);
}
else
{
Serial.println("Failed to get data!");
}
delay(50);
}