Application of PIC microcontroller and 18b20

Publisher:532829319hmkLatest update time:2019-10-29 Source: 51heiKeywords:18b20 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

 

#include "1602.h"

#include "18b20.h"

#include "main.h"

__CONFIG(0X0B31);

main()

{

        char msg[2][16] = {"  Temperature:  ","              .C"};

        delay_us2 (40, 40);

        delay_us2 (100, 200);

        initial();

        while(1) {

                start_convert();

                change_to_ascii (get_temp (), &msg[1][3]);        

                display2(&msg[0][0],&msg[1][0]);

        }

        

}



//------------------------us level delay----------------------------//

void delay_us2 (char x, char y)

{

char z;

to { from=y; 

         do {;} while(--z);

} while(--x);

}


//------------------------1 second delay--------------------------------//

void delay_1s(unsigned int x)

{

        unsigned a,b;

                for(a=x;a>0;a--)

                        for(b=110;b>0;b--);

}


//-----------------------------------------------------------------------//

void delay_us1 (char d)

{

        while(--d) ;

}



Keywords:18b20 Reference address:Application of PIC microcontroller and 18b20

Previous article:PIC microcontroller electronic clock program + simulation circuit
Next article:PIC16F877_adc usage

Recommended ReadingLatest update time:2024-11-16 14:32

pic16f877 dual machine communication lcd1602 liquid crystal display
/*************************************************************************************************  * File name: 485c.c  * Function: 485 slave communication module  * Hardware conditions: 1.CPU model: P IC 16F877 * 2. Crystal oscillator : 2M  ***************************************************************************
[Microcontroller]
A Brief Discussion on Displaying Chinese Characters in 1602
The built-in fonts of 1602 are just some characters, but there are no Chinese characters. In fact, 1602 can display some simple Chinese characters such as year, month, day, etc., as well as some relatively simple special symbols. Let's talk about its practical principle. In fact, the most basic is a self-built font, a
[Microcontroller]
ATmega16 Development Board Tutorial (7) - LCD1602
8. LCD1602 LCD1602 is the most basic character LCD display, which can display 16x02=32 characters. So the operation of timing - reading and writing is the most important content. Today, I will take you to read the timing. Before looking at the timing diagram, you need to understand the pin functions of the LCD to be
[Microcontroller]
ATmega16 Development Board Tutorial (7) - LCD1602
LCD 1602 stable display
1LCD 1602 Introduction Notes LCD1602 can display two lines, 16 characters per line, but cannot display Chinese characters. The 16-pin LCD 1602 has a backlight, while the 14-pin does not.   2LCD1602 Port Pinout I won't record how the manual describes LCD 1602. I'll record the operation process. The following figu
[Microcontroller]
LCD 1602 stable display
LCD1602 four data line driver based on 51
/This program has been debugged  //The following is a calling example  ////////////////////////////////////// //LCD1602 read-write header file //Four-line drive mode //////////////////////////////////// #include   #include "LCD1602.h"  /*-----------  Pin definition in the LCD header file  -----------*/  void main(void
[Microcontroller]
LCD1602 liquid crystal display (51 single chip microcomputer C language)
Effect diagram: Circuit diagram: #include #include //Header file containing _nop_() function definition #define uchar unsigned char #define uint unsigned int sbit RS=P2^5; //Register selection bit sbit RW=P2^6; //Read/write selection bit sbit E=P2^7; //Enable signal bit //sbit BF=P0^7; //Busy flag const uchar
[Microcontroller]
LCD1602 liquid crystal display (51 single chip microcomputer C language)
Temperature measurement DSB1820 lcd1602 liquid crystal display
The LCD1602display.h header file used in the program can be obtained from my other article: http://www.51hei.com/mcu/3292.html is the same file #include #include #include "LCD1602display.h" sbit DQ=P2^0; //ds18b20 uint wendu=0; uchar num,num1; uint temperature=0; uchar code range ="===TEMPERTURE==="; uchar c
[Microcontroller]
DS1302 chip + 1602 LCD display
Many programs for DS1302 and 1602 on the Internet have big problems. I wrote a complete and detailed one for everyone to understand. You can modify the port yourself. #include reg51.h #include intrins.h /*************************************Port definition**********************************/ sbit sclk = P3^4; sbit
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号