Skip to content

Instantly share code, notes, and snippets.

@azhaganandhan
Created January 24, 2018 04:23
Show Gist options
  • Save azhaganandhan/277be80c301cf1f6fec8cf4e9ae0b37f to your computer and use it in GitHub Desktop.
Save azhaganandhan/277be80c301cf1f6fec8cf4e9ae0b37f to your computer and use it in GitHub Desktop.
Pressure convertion code Raw
#include<stdio.h>
#define uint8_t unsigned char
#define uint16_t unsigned int
#define uint32_t unsigned int
int main() {
int x=33;
int y=125;
int z=151;
uint32_t SenAD;
float SenPDat;
SenAD = (uint32_t) ((x<<16) + (y<<8) + z);
SenPDat = (float) (SenAD-1677721) / 13421772 * 1000;
printf("SENAD= %f", SenAD);
printf("SENPDAT = %f", SenPDat);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment