Skip to content

Some questions about the project code and the CAN bus #1

@brightproject

Description

@brightproject

Hello @ExperimentalAvionics

Made a small one refactoring your code for platformio or .pio and replaced all *ino files with *h files

I'm trying to figure out how to send altitude via the CAN bus
I can't understand why you use 3 bits to send altitude, even when the altitude is in feet,

canMsg[2] = AltitudeINT;

Three bits give a huge number gigantic figure and it is excessive.

2^{24} - 1 = 16,777,215

Even up to 10,000 feet = 3 kilometers, where small planes don't fly in principle

canMsg[4] = AltitudeINT >> 16;

always equals zero.

Made this conclusion in the serial port(in HEX):

AltitudeINT = 553
VSI = 77611

canMsg[2]29
canMsg[3]2
canMsg[4]0
canMsg[5]2B
canMsg[6]2F

Also interesting is the variable

Pressure_Int = pressure/10;

Do you use it to get raw altitude values, but this is some kind of nonsense and these are just decibars?
I'm interested in your project, I hope you clarify the above points🙂

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions