STM8 one-bit common anode digital tube 0 to F digital display

Publisher:幸福约定123Latest update time:2020-02-19 Source: eefocusKeywords:STM8 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Sixiu Electronics Little Prince Development Board has a common anode digital tube with digital display from 0 to F.


#define LED PC_ODR //1-digit digital tube segment code connection port group


u8 tableB[]={0xC0,0xF9,0xA4,0xB0,0x99,0x92,0x82,0xF8,0x80,0x90,0x88,0x83,0xC6,0xA1,0x86,0x8E};

//Common anode digital tube segment code 0 to F

int main(void)

{

  u8 num; //define for loop control variable "num"

  PC_DDR=0xFF; //Configure PC port to output mode

  PC_CR1=0xFF; //Configure PC port to push-pull output mode

  PC_CR2=0x00; //Configure PC port low speed output

  while(1)

  {

    for(num=0;num<=15;num++)

    {

      //LED=tableA[num];

      LED = tableB[num];

      delay(300); //Delay to facilitate observation of LED status

    }

  }

}

Keywords:STM8 Reference address:STM8 one-bit common anode digital tube 0 to F digital display

Previous article:STM8L151 series single-channel ADC digital-to-analog conversion
Next article:STM8 development story - the pinout of the buzzer BEEP (Part 1)

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

Incremental programming method for STM8 microcontroller
1 Open STVP 2 PROJECT/NEW, create a project with a random name 3 PROJECT EDITION, first select the chip in Configuration, the most important thing is to set it in SerialNumbering Check Enable Serial Number, enter the address you want to select, the starting value and the step value of the byte number 4After setting up
[Microcontroller]
Incremental programming method for STM8 microcontroller
LCD interface dot matrix font display based on STM8
The main control of this solution uses STM8S207C8T6, 1.7-inch 128*64 LCD display, LCD driver chip uses UC1701 (compatible with ST7565), and font display uses Qualcomm GT20L16S1Y font chip to realize display on the LCD interface. The following are the module circuits of STM8S207C8T6, UC1701 and GT20L16S1Y in the sche
[Microcontroller]
LCD interface dot matrix font display based on STM8
STM8 and assembly language (5)
In the last experimental program, we completed the driving of the LED indicator light, using the GPIO output method. This time, we will use the GPIO input method to input the key. The following code reads the key value. If the key is pressed, the LED is turned on, otherwise the LED is turned off. Use ST's developmen
[Microcontroller]
STM8 window watchdog
#include "stm8s.h" uint8_t u8_value; FlagStatus fs; void main(void) {   GPIO_DeInit(GPIOD);   GPIO_Init(GPIOD, GPIO_PIN_ALL, GPIO_MODE_OUT_PP_LOW_SLOW);   fs = RST_GetFlagStatus(RST_FLAG_WWDGF);   if(fs != RESET)   {     RST_ClearFlag(RST_FLAG_WWDGF);     GPIO_WriteHigh(GPIOD, GPIO_PIN_0);   }   WWDG_Ini
[Microcontroller]
STM8 voltmeter schematic and source program IAR environment
I just made a voltmeter using STM8S003. Let's share some ideas. ADC sampling and digital tube display are used.   STM8 voltmeter microcontroller source code: #include iostm8s003f3.h unsigned int ms_count; unsigned char adcflag; unsigned int ADCData; unsigned int tmpin; unsigned int ADCBuff ; /*******************
[Microcontroller]
STM8 voltmeter schematic and source program IAR environment
STM8 study notes---How to define the communication protocol in serial communication
When you first start learning about microcontrollers, serial communication is often used, but in actual products, serial communication requires a communication protocol. Many people don't understand why communication protocols are used, how to define communication protocols, and how to write programs with communicatio
[Microcontroller]
STM8——cannot open source file "xx.h"错误
When using MDK5 to compile STM32, the newly added .c file needs to be added to the include Paths, otherwise an error will be reported during compilation. When using STM8, IAR is used. The newly added .c file needs to add the header file path to options- c/c++ Compiler- Additional include directories under Preprocessor
[Microcontroller]
Data storage method based on EEPROM inside STM8S microprocessor
EEPROM (Electrically Erasable Programmable Read-Only Memory) refers to an electronically erasable read-only memory, which is a non-volatile memory. After the power is off, the stored data is still retained. To erase or rewrite the content, you only need to operate directly in the form of electronic signals. EEPROM i
[Microcontroller]
Data storage method based on EEPROM inside STM8S microprocessor
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号