In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article shows you the STM8L segment code screen driver principle and routines, the content is concise and easy to understand, absolutely can make your eyes bright, through the detailed introduction of this article, I hope you can get something.
The driving process of STM8L segment code screen is as follows:
First, check the relevant registers set by DATASHEET according to the hardware connection, that is, determine the COMx.
2. Create the following table for the RAM address of COMx in DATASHEET:
Fill in the form with the information provided by the LCD segment code screen manufacturer and operate LCD RAM.
Third, the following two examples are for reference:
1.
Void LCD_showLevel (U8 Chan, U8 Level)
{
U8 i, adr, mask
BarCH1 = Level2Bar [(Level-1) / 8+LcdFlashCh2]
BarCH2 = Level2Bar [(Level-1) / 8+LcdFlashCh3]
If (Chan = = 0)
{
For (iframe 0; iRAM [LCD _ level 1 [I * 2]] | = LCD_ level 1 [I * 2v 1])
}
For (; iRAM [LCD _ level 1 [I * 2]] & = ~ (LCD_ level 1 [I * 2])
}
} else
{
For (iframe 0; iRAM [LCD _ level 2 [I * 2]] | = (LCD_ level 2 [I * 2v 1])
}
For (; iRAM [LCD _ level 2 [I * 2]] & = ~ (LCD_ level 2 [I * 2 * 1])
}
}
two。
Void LCD_showNum (U8 Minute)
{
If (Minute = = 0)
{
DrawDigit (1Jing 10); / / Draw white space in digit 4
DrawDigit (2Jing 11); / / Draw "C" in digit 5)
}
Else if (Minute
< 10) { //for minute smaller than 10 DrawDigit(1,10); //Draw white space in digit 4 DrawDigit(2,Minute); //Draw Minute in digit 5 } else { //for minute larger than 10 DrawDigit(1,Minute/10); //Draw minute in digit 4,5 DrawDigit(2,Minute); } OFF_TIME; OFF_MIN; } void DrawDigit(u8 loc, u8 value) { u8 v, i; v = DigitSeg[value]; for (i=0;iRAM[Digits[loc][i*2]] |= Digits[loc][i*2+1]; else LCD->Ram [Digitsloc] [iTun2]] & = ~ Digits [loc] [iDiver2: 1]
V = (v > > 1)
}
}
Const U8 Digits [] [] =
{
{11,64, 8,4, 4,64, 1,4, 1,8, 8,8, 4128}
{10,32, 7,2, 3,32, 0,2, 0,1, 7,1, 3,16}
{10,128, 7,8, 3,128, 0,8, 0,4, 7,4, 3,64}
}
/ / 0 1 2 3 4 5 6 7 8 9 "C"
U8 DigitSeg [] = {0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F, 0x00, 0x39}
The odd number of array elements is the address, and the even number is the value, that is, the bit to be displayed.
The above content is the principle and routine of STM8L segment code screen driver. Have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.