Lab_Seven_Part_Three

Lab_Seven_Part_Three - start I2C_Init() InitADC()...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 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...
View Full Document

This note was uploaded on 11/21/2011 for the course ECE 3411 taught by Professor Park during the Fall '11 term at UConn.

Page1 / 8

Lab_Seven_Part_Three - start I2C_Init() InitADC()...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online