Use the module software to take horizontal modules of IG! frame by frame, and store the data of each frame (8*8 dot matrix screen) in a two-dimensional array. There are 18 frames in total.
In the image[][] array, the row element represents a frame, and the column element represents each line in the current frame. Through interrupt + switch traversal control, each frame is dynamically displayed, so that it looks like IG! Continuous horizontal movement is achieved.
Note: When taking the modulus, you need to take the modulus in the reverse direction, that is, assign 0 to the bright side and 1 to the dark side.
#include sbit ADDR0=P1^0; sbit ADDR1=P1^1; sbit ADDR2=P1^2; sbit ADDR3=P1^3; sbit ENLED=P1^4; unsigned char code image[17][8]= { {0xFF,0x83,0xEF,0xEF,0xEF,0xEF,0x83,0xFF}, {0xFF,0xC1,0xF7,0xF7,0xF7,0xF7,0xC1,0xFF}, {0xFF,0xE0,0xFB,0xFB,0xFB,0xFB,0xE0,0xFF}, {0xFF,0xF0,0x7D,0x7D,0x7D,0x7D,0xF0,0xFF}, {0xFF,0x78,0xBE,0xBE,0xBE,0xBE,0x78,0xFF}, {0xFF,0x3C,0xDF,0xDF,0x5F,0xDF,0x3C,0xFF}, {0xFF,0x1E,0xEF,0xEF,0x2F,0x6F,0x1E,0xFF}, {0xFF,0x0F,0xF7,0xF7,0x17,0xB7,0x8F,0xFF}, {0xFF,0x87,0xFB,0xFB,0x0B,0x5B,0x47,0xFF}, {0xFF,0xC3,0xFD,0xFD,0x85,0xAD,0xA3,0xFF}, {0xFF,0xE1,0xFE,0xFE,0xC2,0xD6,0xD1,0xFF}, {0xFF,0xF0,0xFF,0xFF,0xE1,0xEB,0xE8,0xFF}, {0xFF,0x78,0x7F,0x7F,0x70,0xF5,0x74,0xFF}, {0xFF,0xBC,0xBF,0xBF,0xB8,0xFA,0xBA,0xFF}, {0xFF,0xDE,0xDF,0xDF,0xDC,0xFD,0xDD,0xFF}, {0xFF,0xEF,0xEF,0xEF,0xEE,0xFE,0xEE,0xFF}, {0xFF,0xF7,0xF7,0xF7,0xF7,0xFF,0xF7,0xFF} }; void main() { EA=1; ENLED=0; ADDR3=0; TMOD=0x01; TH0=0xfc; TL0=0x67; ET0=1; TR0=1; while(1); } void InterruptTimer0() interrupt 1 { static unsigned char i=0; static unsigned char tmr=0; static unsigned char index=0; TH0=0xfc; TL0=0x67; P0=0xff; switch(i) { case 0:ADDR2=0;ADDR1=0;ADDR0=0;P0=image[index][0];i++;break; case 1:ADDR2=0;ADDR1=0;ADDR0=1;P0=image[index][1];i++;break; case 2:ADDR2=0;ADDR1=1;ADDR0=0;P0=image[index][2];i++;break; case 3:ADDR2=0;ADDR1=1;ADDR0=1;P0=image[index][3];i++;break; case 4:ADDR2=1;ADDR1=0;ADDR0=0;P0=image[index][4];i++;break; case 5:ADDR2=1;ADDR1=0;ADDR0=1;P0=image[index][5];i++;break; case 6:ADDR2=1;ADDR1=1;ADDR0=0;P0=image[index][6];i++;break; case 7:ADDR2=1;ADDR1=1;ADDR0=1;P0=image[index][7];i=0;break; default:break; } tmr++; if(tmr>=250) { tmr=0; index++; if(index>=17) { index=0; } } }
Previous article:KST51 MCU: Detecting and debounce the number of matrix key presses through interrupts
Next article:KST-51: Countdown program starting from 999999, only the valid digits are displayed
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Sandia Labs develops battery failure early warning technology to detect battery failures faster
- Ranking of installed capacity of smart driving suppliers from January to September 2024: Rise of independent manufacturers and strong growth of LiDAR market
- Industry first! Xiaopeng announces P7 car chip crowdfunding is completed: upgraded to Snapdragon 8295, fluency doubled
- P22-009_Butterfly E3106 Cord Board Solution
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Please recommend a cheap io expansion chip iic spi can be used for keyboard and led indication
- Problem of stm32cube_fw_f7_v1.4.1 not being able to download
- My eSports Sharing
- Application of high-precision current source in gyroscope testing
- Young people have no moral principles and do not consider production capacity in via impedance design
- Bike modification series: button
- Introduction to cache operation interface of Allwinner V85 development board RTOS platform
- During the Chinese New Year, we can talk about job plans.
- Qorvo Online Design Conference - Improving System Performance with Low Phase Noise Amplifiers
- Smart Internet of Things Dormitory Based on STM32