当前位置:网站首页>Proteus simulation based on msp430f2491 (realize water lamp)
Proteus simulation based on msp430f2491 (realize water lamp)
2022-07-29 08:12:00 【Half life fireworks I blurred】
Realization P2 Water lamp at the mouth
The main function
#include <msp430x24x.h>
#define LED8PORT P2OUT //P2 Pick up 8 individual LED The lamp
#define LED8SEL P2SEL //P2 Pick up 8 individual LED The lamp
#define LED8DIR P2DIR //P2 Pick up 8 individual LED The lamp
#define uchar unsigned char
#define uint unsigned int
//IAR Software delay function
#define CPU_F ((double)8000000)//8M
#define delay_us(x) __delay_cycles((long)(CPU_F*(double)x/1000000.0)) //us Time delay
#define delay_ms(x) __delay_cycles((long)(CPU_F*(double)x/1000.0)) //ms Time delay
uint i;
void Port_Init()
{
LED8SEL = 0x00; // Set up IO The mouth is ordinary I/O Pattern
LED8DIR = 0xff; // Set up IO mouth P20 The direction of the output
//LED8PORT = 0x01; //P20 The port is initially set to high level
}
void main()
{
WDTCTL = WDTPW + WDTHOLD;// Turn off the watchdog
Port_Init();
while(1)
{
for(i=0;i<8;i++)
{
LED8PORT =~(0x01<<i);// Low level on
delay_ms(100);
}
for(i=0;i<8;i++)
{
LED8PORT =~(0x80>>i);
delay_ms(100);
}
}
}
proteus Simulation diagram

边栏推荐
- Privacy is more secure in the era of digital RMB
- 亚马逊测评自养号是什么,卖家应该怎么做?
- torch.Tensor和torch.tensor的区别
- Tle5012b+stm32f103c8t6 (bluepill) reading angle data
- An Optimal Buffer Management Scheme with Dynamic Thresholds论文总结
- STM32 printf problem summary semihosting microlib understanding
- BiSeNet v2
- [beauty of software engineering - column notes] 27 | what is the core competitiveness of software engineers? (top)
- Matrix decomposition and gradient descent
- TCP - sliding window
猜你喜欢

华为无线设备配置利用WDS技术部署WLAN业务

MySQL rownum implementation

UE4 principle and difference between skylight and reflecting sphere

Tle5012b+stm32f103c8t6 (bluepill) reading angle data
![[beauty of software engineering - column notes] 29 | automated testing: how to kill bugs in the cradle?](/img/e1/8a61f85bf93801d842e78ab4f7edc7.png)
[beauty of software engineering - column notes] 29 | automated testing: how to kill bugs in the cradle?

网络安全之安全基线

Day 014 2D array exercise

V-Ray 5 acescg workflow settings

Dynamic Thresholds Buffer Management in a Shared Buffer Packet Switch论文总结

Proteus simulation based on 51 MCU ADC0808
随机推荐
Compare three clock circuit schemes of single chip microcomputer
Some simple uses of crawler requests Library
In an SQL file, a test table and data are defined above, and you can select* from the test table below
阿里巴巴政委体系-第一章、政委建在连队上
BiSeNet v2
[beauty of software engineering - column notes] 23 | Architect: programmers who don't want to be architects are not good programmers
BiSeNet v2
Dp4301-sub-1g highly integrated wireless transceiver chip
(Video + graphic) machine learning introduction series - Chapter 5 machine learning practice
torch.Tensor.to的用法
Exercise: store department information
Nrf52832-qfaa Bluetooth wireless chip
An optimal buffer management scheme with dynamic thresholds paper summary
数字人民币时代隐私更安全
Detailed explanation of two modes of FTP
Process and concept of process
Qt/PyQt 窗口类型与窗口标志
STM32 MDK (keil5) contents mismatch error summary
Official tutorial redshift 01 basic theoretical knowledge and basic characteristics learning
分段分页以及段页结合