资源简介
六足机器人三维图六足机器人三维图六足机器人三维图六足机器人三维图
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using Utilities;
using System.IO.Ports;
namespace key_preview {
public partial class Form1 : Form {
globalKeyboardHook gkh = new globalKeyboardHook();
SerialPort port;
private string stringtosend; //holds the commands to be sent out
public Form1() {
InitializeComponent();
}
//This routine is triggered when the com port recieves data
private void serialPort1_DataReceived(object sender System.IO.Ports.SerialDataReceivedEventArgs e)
{
// string line = port.ReadLine();
string line = port.ReadExisting(); //works better than the above command doesn‘t seem to miss input data.
this.BeginInvoke(new LineReceivedEvent(LineReceived) line);
}
protected override void onmousemove(MouseEventArgs mouseEv) //Called when mouse moves
{
textBoxMousePosition.Text = mouseEv.X.ToString() + “ “ + mouseEv.Y.ToString();
}
private delegate void LineReceivedEvent(string line); //called when data is recieved at the port
private void LineReceived(string TextRecieved)
{
txtRecieved.Text = TextRecieved;
port.DiscardInBuffer();
}
private void Form1_Load(object sender EventArgs e) {
gkh.HookedKeys.Add(Keys.Z);
gkh.HookedKeys.Add(Keys.X);
gkh.HookedKeys.Add(Keys.NumPad1);
gkh.HookedKeys.Add(Keys.NumPad2);
gkh.HookedKeys.Add(Keys.NumPad3);
gkh.HookedKeys.Add(Keys.NumPad4);
gkh.HookedKeys.Add(Keys.NumPad5);
gkh.HookedKeys.Add(Keys.NumPad6);
gkh.HookedKeys.Add(Keys.NumPad7);
gkh.HookedKeys.Add(Keys.NumPad8);
gkh.HookedKeys.Add(Keys.NumPad9);
gkh.KeyDown += new KeyEventHandler(gkh_KeyDown);
gkh.KeyUp += new KeyEventHandler(gkh_KeyUp);
}
void gkh_KeyUp(object sender KeyEventArgs e) { //Called when a keyboard key is released
e.Handled = true;
}
void gkh_KeyDown(object sender KeyEventArgs e) {
e.Handled = true;
//send the command responding to the key that has been pressed
if (e.KeyCode == Keys.NumPad1) { LinearMove(225); } //Numpad 1 pressed - Move back - left
else if (e.KeyCode == Keys.NumPad2) { LinearMove(270); } //Numpad 2 pressed - Move back
else if (e.KeyCode == Keys.NumPad3) { LinearMove(315); } //Numpad 3 pressed - Move back - right
else if (e.KeyCode == Keys.NumPad4) { LinearMove(180); } //Numpad 4 pressed - Mo
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 362556 2012-10-06 01:28 HF08 Models and Software\Body Print Plate 1.igs
文件 341533 2012-10-06 01:31 HF08 Models and Software\Body Print Plate 1.stl
文件 496368 2012-10-06 01:29 HF08 Models and Software\Body Print Plate 2.igs
文件 511723 2012-10-06 01:31 HF08 Models and Software\Body Print Plate 2.stl
文件 167265 2012-10-06 01:29 HF08 Models and Software\Body Print Plate 3.igs
文件 339301 2012-10-06 01:30 HF08 Models and Software\Body Print Plate 3.stl
文件 37701 2012-10-06 01:43 HF08 Models and Software\GNU General Public Licence.html
目录 0 2012-10-06 01:47 HF08 Models and Software\Hexapod Controller 06\
文件 2213 2012-09-04 20:21 HF08 Models and Software\Hexapod Controller 06\0.png
文件 2388 2012-09-04 20:19 HF08 Models and Software\Hexapod Controller 06\135.png
文件 2183 2012-09-04 20:18 HF08 Models and Software\Hexapod Controller 06\180.png
文件 2346 2012-09-04 20:19 HF08 Models and Software\Hexapod Controller 06\225.png
文件 2275 2012-09-04 20:19 HF08 Models and Software\Hexapod Controller 06\270.png
文件 2320 2012-09-04 20:20 HF08 Models and Software\Hexapod Controller 06\315.png
文件 2241 2012-09-04 20:17 HF08 Models and Software\Hexapod Controller 06\45.png
文件 2222 2012-09-04 20:18 HF08 Models and Software\Hexapod Controller 06\90.png
文件 370070 2009-01-07 22:22 HF08 Models and Software\Hexapod Controller 06\frog_256.ico
文件 947 2012-10-02 18:40 HF08 Models and Software\Hexapod Controller 06\Hexapod Controller.sln
文件 27136 2012-10-06 01:48 HF08 Models and Software\Hexapod Controller 06\Hexapod Controller.suo
文件 2130 2012-09-04 21:11 HF08 Models and Software\Hexapod Controller 06\Home.png
文件 1017323 2012-09-04 20:09 HF08 Models and Software\Hexapod Controller 06\jpg1.jpg
目录 0 2012-10-06 01:45 HF08 Models and Software\Hexapod Controller 06\key preview\
目录 0 2012-10-06 01:45 HF08 Models and Software\Hexapod Controller 06\key preview\bin\
目录 0 2012-10-06 01:45 HF08 Models and Software\Hexapod Controller 06\key preview\bin\Debug\
目录 0 2012-10-06 01:45 HF08 Models and Software\Hexapod Controller 06\key preview\bin\Release\
文件 4705 2012-10-02 18:20 HF08 Models and Software\Hexapod Controller 06\key preview\bin\Release\key preview sample.zip
文件 437760 2012-10-06 01:48 HF08 Models and Software\Hexapod Controller 06\key preview\bin\Release\key preview.exe
文件 38400 2012-10-06 01:48 HF08 Models and Software\Hexapod Controller 06\key preview\bin\Release\key preview.pdb
文件 11592 2012-10-06 01:48 HF08 Models and Software\Hexapod Controller 06\key preview\bin\Release\key preview.vshost.exe
文件 490 2010-03-17 22:39 HF08 Models and Software\Hexapod Controller 06\key preview\bin\Release\key preview.vshost.exe.manifest
文件 9981 2012-10-03 20:57 HF08 Models and Software\Hexapod Controller 06\key preview\Form1.cs
............此处省略39个文件信息
评论
共有 条评论