I have a problem. For a project I need to build a device how can read CAN-Datas. So far so good. I can already read them and I can display them on my TFT Display. But they are all unsorted at the moment.
The next step is to sort the received datas but I don’t want to use so may strings and sprintf()-functions. Because the memory is limited.
for (int i = 0; i <= message.length - 1; i++)
{
sprintf(stringcan, “%02X”, message.data*);*
myGLCD.print(stringcan, xpos, ypos);*
xpos = xpos + 20;*
}*
ypos = ypos + 12;*
xpos = 90;*
}* [/color] I attached a photo of the displayed data. Have anyone a clue? how can I sort the IDs? From small to big. Thank you for your help greetings Kev
I only want to sort them. the LSB of the CAN-ID (0...F) is the position of the Chip with the attached CAN-Data on this particular device.
the other numbers of the CAN-ID in my example 19111x and 19211x are the ID of the device. There are up to 16 of this devices, who i have to read at the same time.
And this is why I want to sort them, for a good overview
Please read the first post in any forum entitled how to use this forum. http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.
If you need to sort and store them, it may be worthwhile passing the output to a PC to do the rest.