📄 picusbnut.cs
字号:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace picusbnut
{
public partial class picusbnut : Form
{
PicUSBAPI usbapi = new PicUSBAPI();
public picusbnut()
{
InitializeComponent();
}
private void leds_off_Click(object sender, EventArgs e)
{
usbapi.LedPIC(0x00); //turn off leds
}
private void led1_Click(object sender, EventArgs e)
{
usbapi.LedPIC(0x01); //turn on led 1
}
private void led2_Click(object sender, EventArgs e)
{
usbapi.LedPIC(0x02); //turn on led 2
}
private void led3_Click(object sender, EventArgs e)
{
usbapi.LedPIC(0x03); //turn on led 4
}
private void led4_Click(object sender, EventArgs e)
{
usbapi.LedPIC(0x04); //turn on led 4
}
private void sendtext_Click(object sender, EventArgs e)
{
usbapi.TextPIC(texttopic1.Text); //send text string
}
private void adconv_Click(object sender, EventArgs e)
{
usbapi.ConvADPIC();
potvalue.Value = (int)(usbapi.ConvADPIC() * 100 / 254);
}
private void timer1_Tick(object sender, EventArgs e)
{
uint switchst = 0;
switchst = usbapi.SwitchPIC();
if (switchst == 1)
{
texto69.Text = "Button 1 pressed";
}
else if (switchst == 2)
{
texto69.Text = "Button 2 pressed";
}
else texto69.Text = "No Button pressed";
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -