void main()
{
unsigned long int voltage;
unsigned char v1,v2,v3;
TRISA=0xFF;
TRISC=0;
Lcd_Init(&PORTC);
Lcd_Cmd(LCD_CURSOR_OFF);
Lcd_Cmd(LCD_CLEAR);
while(1)
{
Lcd_Cmd(LCD_CLEAR);
voltage=Adc_Read(3);
voltage=voltage*489/1000;
v1=voltage/100;
v2=(voltage%100)/10;
v3=voltage%10;
Lcd_Chr(1,1,v1+48);
Lcd_Chr(1,2,'.');
Lcd_Chr(1,3,v2+48);
Lcd_Chr(1,4,v3+48);
Lcd_Chr(1,5,' ');
Lcd_Chr(1,6,'v');
delay_ms(500);
}
}
Sunday, January 6, 2019
Subscribe to:
Post Comments (Atom)
สรุปงานที่ 5 Internet of Things (IoT)
Internet of Things (IoT) คืออะไร Internet of Things (IoT) คือ "อินเตอร์เน็ตในทุกสิ่ง" หมายถึง การที่อุปกรณ์ต่างๆ ส...
-
Digital Speedometer and Odometer Circuit using PIC Microcontroller EMBEDDED By Aswinth Raj Jul 27, 2017 24 Digital Speedometer and...
-
How to Save Data using EEPROM in PIC16F877A Microcontroller By Aswinth Raj Aug 10, 2017 2 Saving Data using...
-
Generating PWM using PIC Microcontroller with MPLAB and XC8 EMBEDDED By Aswinth Raj Mar 15, 2017 35 Generating PWM using PIC Micr...
No comments:
Post a Comment