-
STM32F1的SPWM逆变器源码
#include "SPWM.h"
#include "led.h"
#include "usart.h"
u16 TimerPeriod = 7200;
u16 DutyFactor = 50;
void TIM_Int_Init(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
NVIC_InitTypeDef NVIC_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB, ENABLE);
RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM4 | RCC_APB1Periph_TIM3,ENABLE); //时钟使能
/* GPIOA配置:通道PA.6和PA.7作为输出引脚*/
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
&nbs
- 2022-07-26 17:50:34下载
- 积分:1
-
Visual C# 自动识别Access数据库路径
Visual C# 自动识别Access 2000数据库路径,当然不仅限于Access2000,Access2007版本也可以,此源码仅是示例,当然打开程序后,程序会自动搜索Access路径,连接之后自动打开程序。大致的实现方法,可参考下述代码:
string strPath = Application.StartupPath + " est.mdb";//得到数据库路径
string ConStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" + strPath;//创建连接字符串
OleDbDataAdapter OleDatOleDat = new OleDbDataAdapter(//创建数据适配器对象
"select * from 帐目", ConStr);
OleDatOleDat.Fill(dt);//填充数据表
count = dt.Rows.Count;
textBox1.Text = dt.Rows[0][0].ToString();//显示数据表中数据
textBox2.Text = dt.Rows[0][1].ToString();//显示数据表中数据
textBox3.Text = dt.Rows[0][2].ToString();//显示数据表中数据
textBox4.Text = dt.Rows[0][3].ToString();//显示数据表中数据
- 2022-03-24 00:39:43下载
- 积分:1
-
NET常用源代码
包括:
web api入门用的例子程序
web api的crud操作
ajax方式实现的聊天室
cms管理员后台模板
条码扫描
winforms实现用户登录逻辑
socket通讯的例子
将gridview导出到 word excel ppt pdf等文档
将excel转换为xml
修改并且更新datatable中的数据
在两个asp.net页面间传值
在asp.net中实现搜索引擎
webforms实现在线购物车
webbrowser的例子
一个多设备实现的to do列表,用到了AngularJS
wpf的计算器
并行计算和多线程的例子
- 2022-01-25 15:09:10下载
- 积分:1
-
C# wpf 创建简单形状动画的例子
C# wpf 创建简单形状动画的例子,启动动画、停止动画、暂停动画、继续动画、加速动画。创建动画
Rectangle MyRectangle = new Rectangle();
MyRectangle.Width = 50;
MyRectangle.Height = 20;
MyRectangle.Margin = new Thickness(10, 50, 0, 0);
MyRectangle.Fill = new LinearGradientBrush(
Color.FromArgb(255, 0, 255, 255), Color.FromArgb(255, 0, 0, 255), 0);
MyRectangle.HorizontalAlignment = HorizontalAlignment.Left;
this.canvas1.Children.Add(MyRectangle);
this.RegisterName("MyRectangle", MyRectangle);
DoubleAnimation MyAnimation =
new DoubleAnimation(100, 380, new Duration(TimeSpan.FromSeconds(5)));
Storyboard.SetTargetName(MyAnimation, "MyRectangle");
Storyboard.SetTargetProperty(MyAnimation,
new PropertyPath(Rectangle.WidthProperty));
MyStoryboard = new Storyboard();
MyStoryboard.Children.Add(MyAnimation);
动画效果请参见下图所示,源代码请单击下载按钮下载。
- 2022-08-25 13:04:57下载
- 积分:1
-
C#播放wmv视频并填充到文字轮廓中
C#播放wmv视频并填充到文字轮廓中,这个应该是一个艺术字效果吧,本程序实现了两个功能:一、视频文件播放功能(wmv),二、将视频影像填充到文字轮廓中显示,这个就有意思了,最终实现了比较动感的艺术字动画效果,在视频播放方面,主要使用MediaElement();实现,文字填充方面,基于TextBlock.Foreground实现,下面是具体一些的代码:
使用视频剪辑填充文字的线条
MediaElement MyMediaElement = new MediaElement();
MyMediaElement.Source = new Uri("Bear.wmv", UriKind.Relative);
MyMediaElement.IsMuted = true;
VisualBrush MyVisualBrush = new VisualBrush();
MyVisualBrush.Visual = MyMediaElement;
TextBlock MyTextBlock = new TextBlock();
MyTextBlock.FontFamily = new FontFamily("宋体");
MyTextBlock.FontSize = 180;
MyTextBlock.Text = "编程";
MyTextBlock.FontWeight = FontWeights.Bold;
MyTextBlock.Foreground = MyVisualBrush;
this.Content = MyTextBlock;
运行截图如下,不过本站截图是静态的,看不到本示例的动画效果,请下载源码在VS中编译运行,查看效果。
- 2022-01-26 01:31:34下载
- 积分:1
-
C# winform邮件发送 可抄送、密送、发附件
C# 可抄送、密送、发附件的Winform发邮件程序,邮件主是信息的填写部分要注意格式不能错,抄送和密送时多个收件人以分号隔开,可连续发送多个附件,多个附件以分号隔开。发送邮件采用了发送邮件函数的方式,方便以模块化调用 ,发邮件还可异步发送,SMTP 服务器要求安全连接需要设置smtp.EnableSsl = Ssl属性。
请注意:发送邮件前,请先配置然后再发邮件(注:以上参数为格式示例,需自行更改为实际真实有效的信息)。
发邮件的整体用户界面如测试图所示。
- 2023-08-13 11:10:02下载
- 积分:1
-
C# TXT 文本文件操作函数集代码
Visual C# TXT 文本文件操作函数集代码,可演示以下功能:在文本中查询包含一组指定单词的句子、查找两个文本文件中的不同句子、查找两个文本文件中的相同句子、在CSV文本文件中计算单列平均值、在CSV文本文件中计算多列平均值、将两个不同文本文件联接成新文件。
- 2023-06-02 12:05:03下载
- 积分:1
-
C# 演示如何使用DataGridView更新数据
C#更新修改DataGridView数据,请直接在DataGridView表格中修改数据,C# 更新DataGridView数据的实现代码如下:
private void button1_Click(object sender, EventArgs e)
{//更新数据
var MyCount = this.sqlDataAdapter1.Update(this.dataSet1, "Customers");
var MyInfo = "成功更新" + MyCount.ToString() + "条记录!";
MessageBox.Show(MyInfo, "信息提示", MessageBoxButtons.OK);
}
private void Form1_Load(object sender, EventArgs e)
{//读取Customers数据表记录
var MySQL = "Select * From Customers ";
this.sqlConnection1.ConnectionString = "Data Source=.SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=True";
this.sqlCommand1 = new System.Data.SqlClient.SqlCommand("Select * From Employees", this.sqlConnection1);
this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter(this.sqlCommand1);
this.sqlCommandBuilder1 = new System.Data.SqlClient.SqlCommandBuilder(this.sqlDataAdapter1);
this.sqlDataAdapter1.Fill(this.dataSet1, "Customers");
this.dataGridView1.DataSource = this.dataSet1.Tables[0];
- 2022-03-24 05:10:10下载
- 积分:1
-
中国象棋源代码
中国象棋源代码,使用Visual c++编写,对喜欢象棋的朋友,可以研究一下算法,具有很好的参考价值~
- 2022-06-03 11:54:15下载
- 积分:1
-
决战NEO服务器端源码
完整得决战NEO服务器端源码,修改一下可以自己直接使用
- 2022-12-01 18:10:07下载
- 积分:1