You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'm running GD23ZUTX on a teensy and I'm using a Can Bus transceiver that is reading data off my car's ECU.
The issue I'm having is that if I set the ECU to send data at anything more than 10HZ, the data I'm seeing on the serial monitor is really laggy, like 5 seond delay. I can switch it to 10hz and it will run alright but 10HZ produces a choppiness with the gauge command. I'd like to be able to run at least 20HZ or faster.
I've narrowed down the issues to the Gameduino part of my code. If I run just the Can Bus code and output it to the serial monitor, the data is received at even 50HZ. Once I introduce a command, for example just the number command to display a reading on the screen, the lag comes back.
I added some code using millis() to determine the loop rate and I'm getting about 55 loops a second so I'm not sure where the incoming data is being backed up.
Below is a sample of my code.
`#include <GD23ZUTX.h>
#include <FlexCAN.h>
static CAN_message_t rxmsg;
FlexCAN CANbus(500000);
float CTPS, TPS;
void setup() {
CANbus.begin();
GD.begin();
}
void loop() {
if ( CANbus.read(rxmsg) ) {
switch (rxmsg.id) { // Using IDs from 1512 as Megasquirt CAN broadcast frames for Simplified Dash Broadcasting.
// EAch frame represents a data group http://www.msextra.com/doc/pdf/Megasquirt_CAN_Broadcast.pdf
case 1523:
CTPS = (float)(word(rxmsg.buf[0], rxmsg.buf[1])); //AFR...no division
break;
}
}
TPS = CTPS/10;
Serial.println(TPS);
GD.Clear();
GD.ColorRGB(0xffffff);
GD.printNfloat(390, 450, TPS, 0, 30);
GD.swap();
GD.finish();
}`
The text was updated successfully, but these errors were encountered:
Hello, I'm running GD23ZUTX on a teensy and I'm using a Can Bus transceiver that is reading data off my car's ECU.
The issue I'm having is that if I set the ECU to send data at anything more than 10HZ, the data I'm seeing on the serial monitor is really laggy, like 5 seond delay. I can switch it to 10hz and it will run alright but 10HZ produces a choppiness with the gauge command. I'd like to be able to run at least 20HZ or faster.
I've narrowed down the issues to the Gameduino part of my code. If I run just the Can Bus code and output it to the serial monitor, the data is received at even 50HZ. Once I introduce a command, for example just the number command to display a reading on the screen, the lag comes back.
I added some code using millis() to determine the loop rate and I'm getting about 55 loops a second so I'm not sure where the incoming data is being backed up.
Below is a sample of my code.
`#include <GD23ZUTX.h>
#include <FlexCAN.h>
static CAN_message_t rxmsg;
FlexCAN CANbus(500000);
float CTPS, TPS;
void setup() {
CANbus.begin();
GD.begin();
}
void loop() {
}
TPS = CTPS/10;
Serial.println(TPS);
GD.Clear();
GD.ColorRGB(0xffffff);
GD.printNfloat(390, 450, TPS, 0, 30);
GD.swap();
GD.finish();
}`
The text was updated successfully, but these errors were encountered: