{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lab_Seven_Part_Three

Lab_Seven_Part_Three - start I2C_Init InitADC ClearLCD no...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
start I2C_Init() InitADC() ClearLCD() (;;) SetLcdCursor(0x00) voltage = ((ReadADC(0x00) * 5) / 1024) voltage1 = ((((ReadADC(0x00) * 5) % 1024) * 10) / 1024) voltage2 = ((((((ReadADC(0x00) * 5) % 1024) * 10) % 1024) * 10) / 1024) int millivoltage = (voltage * 1000) int millivoltage1 = (voltage1 * 100) int millivoltage2 = (voltage2 * 10) int CelciusTens = (((millivoltage + millivoltage1 + millivoltage2) - 400) / 195) int CelciusOnes = ((((((millivoltage + millivoltage1 + millivoltage2) - 400) % 195)) * 10) / 195) int CelciusDecimal = (((((((((millivoltage + millivoltage1 + millivoltage2) - 400) % 195)) * 10) % 195)) * 10) / 195) int C2FConvert = (((((millivoltage + millivoltage1 + millivoltage2) - 400) / 19.5) * 1.8) + 32) int FahrenheitTens = (C2FConvert / 10) int FahrenheitOnes = (((C2FConvert * 10) % 100) / 10) int FahrenheitDecimal = (((((millivoltage + millivoltage1 + millivoltage2) - 400) / 19.5) * 1.8) + 32) * 10 - ((FahrenheitTens * 100) + (Fahr unsigned char string[15] = {' ',FahrenheitTens+0x30,FahrenheitOnes+0x30,'.',FahrenheitDecimal+0x30,0xDF,'F',' ', ' ',CelciusTens+0x3 DataSize = sizeof (string) SendLcdData(string) SetLcdCursor(0x40) unsigned char string3[16] = {'[',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',']'} yes end no (FahrenheitTens < 8) unsigned char slendy[16] = {'[',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',']'} strcpy(string3,slendy) SetLcdCursor(0x40) DataSize = sizeof (string3) SendLcdData(string3) yes
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}