当前位置:网站首页>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

边栏推荐
- Rotation in model space and rotation in world space
- 【学术相关】为什么很多国内学者的AI的论文复现不了?
- [beauty of software engineering - column notes] "one question and one answer" issue 2 | 30 common software development problem-solving strategies
- torch.Tensor.to的用法
- Tcp/ip five layer reference model and corresponding typical devices and IPv6
- Dp1332e multi protocol highly integrated contactless read-write chip
- (Video + graphic) machine learning introduction series - Chapter 5 machine learning practice
- Unity beginner 2 - tile making and world interaction (2D)
- Usage of torch.tensor.to
- 数仓分层设计及数据同步问题,,220728,,,,
猜你喜欢

Inclination sensor accuracy calibration test

How to connect VMware virtual machine to external network under physical machine win10 system

Proteus simulation based on 51 MCU ADC0808

BiSeNet v2

Unity beginner 4 - frame animation and protagonist attack (2D)

Detailed explanation of two modes of FTP

Simplefoc+platformio stepping on the path of the pit

数仓分层设计及数据同步问题,,220728,,,,

Preparation of SQL judgment statement

Mysql rownum 实现
随机推荐
Implementation of simple cubecap+fresnel shader in unity
CDM - code division multiplexing (easy to understand)
Unicode private use areas
阿里巴巴政委体系-第四章、政委建在连队上
UE4 highlight official reference value
How to connect VMware virtual machine to external network under physical machine win10 system
网络安全之安全基线
Process and concept of process
Vmstat memory consumption query
[beauty of software engineering - column notes] 27 | what is the core competitiveness of software engineers? (top)
[cryoelectron microscope | paper reading] interpretation of sub fault average m software: multi particle cryo EM refining with M
Redshift 2.6.41 for maya2018 watermark removal
An optimal buffer management scheme with dynamic thresholds paper summary
Network Security Learning chapter
Inclination sensor accuracy calibration test
Unity multiplayer online framework mirror learning record (I)
torch.Tensor.to的用法
Dp1332e multi protocol highly integrated contactless read-write chip
Arduino uno error analysis avrdude: stk500_ recv(): programmer is not responding
[note] the art of research - (tell a good story and argument)