当前位置:网站首页>基于msp430f2491的proteus仿真(实现流水灯)
基于msp430f2491的proteus仿真(实现流水灯)
2022-07-29 05:22:00 【半生烟火一世迷离】
实现P2口的流水灯
主函数
#include <msp430x24x.h>
#define LED8PORT P2OUT //P2接8个LED灯
#define LED8SEL P2SEL //P2接8个LED灯
#define LED8DIR P2DIR //P2接8个LED灯
#define uchar unsigned char
#define uint unsigned int
//IAR软件的延时函数
#define CPU_F ((double)8000000)//8M
#define delay_us(x) __delay_cycles((long)(CPU_F*(double)x/1000000.0)) //us延时
#define delay_ms(x) __delay_cycles((long)(CPU_F*(double)x/1000.0)) //ms延时
uint i;
void Port_Init()
{
LED8SEL = 0x00; //设置IO口为普通I/O模式
LED8DIR = 0xff; //设置IO口P20的方向为输出
//LED8PORT = 0x01; //P20口初始设置为高电平
}
void main()
{
WDTCTL = WDTPW + WDTHOLD;//关闭看门狗
Port_Init();
while(1)
{
for(i=0;i<8;i++)
{
LED8PORT =~(0x01<<i);//低电平点亮
delay_ms(100);
}
for(i=0;i<8;i++)
{
LED8PORT =~(0x80>>i);
delay_ms(100);
}
}
}
proteus仿真图

边栏推荐
猜你喜欢

D3.js vertical relationship diagram (with arrows and text description of connecting lines)

HR面必问问题——如何与HR斗志斗勇(收集于FPGA探索者)
![[tensorrt] convert pytorch into deployable tensorrt](/img/56/81d641b494cf8b02ff77246c2207db.png)
[tensorrt] convert pytorch into deployable tensorrt

二、OCR训练时,将txt文件和图片数据转为lmdb文件格式

入门到入魂:单片机如何利用TB6600高精度控制步进电机(42/57)

迁移学习——Low-Rank Transfer Subspace Learning

ML8自学笔记
![[semantic segmentation] full attention network for semantic segmentation](/img/5b/e5143701d60bc16a1ec620b03edbb3.png)
[semantic segmentation] full attention network for semantic segmentation

Power Bi report server custom authentication

Improve quality with intelligence financial imaging platform solution
随机推荐
Wechat applet source code acquisition (download with tools)
ML10自学笔记-SVM
AttributeError: module ‘tensorflow‘ has no attribute ‘placeholder‘
Improve quality with intelligence financial imaging platform solution
ML9自学笔记
6、 Pointer meter recognition based on deep learning key points
华为云14天鸿蒙设备开发-Day3内核开发
京微齐力:基于HMEP060的OLED字符显示(及FUXI工程建立演示)
ML自学笔记5
电力电子:单项逆变器设计(MATLAB程序+AD原理图)
D3.js vertical relationship diagram (with arrows and text description of connecting lines)
ML16-神经网络(2)
1、 Multiprocessing.pool.remotetraceback
QT学习笔记-Excel的导入导出
fastText学习——文本分类
ML11-SKlearn实现支持向量机
2022春招——禾赛科技FPGA技术岗(一、二面,收集于:数字IC打工人及FPGA探索者)
虚假新闻检测论文阅读(三):Semi-supervised Content-based Detection of Misinformation via Tensor Embeddings
[convolution kernel design] scaling up your kernels to 31x31: revising large kernel design in CNN
虚假新闻检测论文阅读(五):A Semi-supervised Learning Method for Fake News Detection in Social Media