- 博客(0)
- 资源 (25)
- 收藏
- 关注
各种算法大全
进制转换 CRC校验 字母排序 解析字符串 拆分字符串 时间格式化处理 将毫秒转化为日期 文本的倒序输出 35 选7 彩票程序 中文乱码转换 小标签 Big5 字与Unicode 的互换 取得服务器当前的各种具体时间 用半角的特殊符号代替全角的特殊符号 数组和数组之间的转换代码 从资源文件里读取值的类 将数组转成字符串在调试或记录日志时用到 多线程的世界时钟,显示巴黎,罗马,上海时间, AWT 界面 判断字符是否属于中文 ……
2013-08-14
UART-WIF与电脑通信
UART-WIF与电脑通信.1、电脑无线连接无线路由器,点击“连接”,成功后如图1
图1
2、打开串口调试工具,发送“+++”,成功后接收到“OK”,退出透明化传输模式。如图二
图2
3、打开UART-WIF管理工具“UART-WIFI2.0.exe”点击“搜索模块”按钮,如下图会显示搜索结果,工作模式选择“基础网络—STA”网络名字为所连接无线路由器的名字“123”,启用“DHCP”,启用“自动工作模式”,协议类型“TCP”如图三
2013-03-15
C#串口通信
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO.Ports;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
SerialPort port1 = new SerialPort();
string InputData = String.Empty;
delegate void SetTextCallback(string text);
private void Port_Select()
{//获取机器中的串口地址
string[] ports = SerialPort.GetPortNames();
foreach (string port in ports)
{
comboBox1.Items.Add(port);
}
}
private void Form1_Load_1(object sender, EventArgs e)
{
Port_Select();
this.comboBox1.SelectedIndex = 0;
this.comboBox2.SelectedIndex = 0;
}
private void button1_Click(object sender, EventArgs e)
{
if (button1.Text == "关闭串口") //当要关闭串口的时候
{
port1.DiscardOutBuffer();
port1.DiscardInBuffer();
port1.Close();
button1.Text = "打开串口";
label3.Text = "串口当前状况:未打开";
comboBox1.Enabled = true;
comboBox2.Enabled = true;
}
else if (button1.Text == "打开串口") //当要打开串口的时候
{
try
{
port1.PortName = comboBox1.SelectedItem.ToString();
port1.BaudRate = Convert.ToInt32(comboBox2.SelectedItem);
port1.DataBits = 8;
port1.RtsEnable = true;
port1.Open();
port1.DiscardOutBuffer();
port1.DiscardInBuffer();
button1.Text = "关闭串口";
comboBox1.Enabled = false;
comboBox2.Enabled = false;
label3.Text = "串口:" + comboBox1.SelectedItem.ToString() + " 波特率:" + comboBox2.SelectedItem.ToString() + " 数据位:8 ";
}
catch
{
button1.Text = "打开串口";
label3.Text = "串口:" + comboBox1.SelectedItem.ToString() + "打开失败";
MessageBox.Show("该串口无法打开");
}
}
}
2012-12-07
基于ARM的电子钟设计
LCD1602,ARM包括文档
#include "config.h"
#define rs (1<<8)
#define rw (1<<9)
#define en (1<<10)
#define busy (1<<7)
#define FPCLK 2764800L
uint8 change;
uint8 txt[]={"ALM: "};
uint8 MESSAGE[]={"RTC: "};
/**********************************外部中断*************************************/
void __irq eint0(void) //向量中断开始,说明有外部中断
{
switch(change)
{
case 1:{ while(EXTINT&(1<<0))EXTINT=1<<0;VICVectAddr=0;ALSEC++;if(ALSEC>59)ALSEC=0;break;}
2012-12-07
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人