因为是个人用途,所以选择的都是最低端的配置,这里介绍一下大致的体验,不是标准测试,仅供参考。
测试环境是Windows 2008 R2+MySQL5.5+IIS+MVC4 继续阅读“主流云主机非标准测试”
收获爱
因为是个人用途,所以选择的都是最低端的配置,这里介绍一下大致的体验,不是标准测试,仅供参考。
测试环境是Windows 2008 R2+MySQL5.5+IIS+MVC4 继续阅读“主流云主机非标准测试”
public static string Str2Hex(string s)
{
string result = string.Empty;
byte[] arrByte = System.Text.Encoding.GetEncoding(“GB2312”).GetBytes(s);
for (int i = 0; i < arrByte.Length; i++)
{
result += “0x” + System.Convert.ToString(arrByte[i], 16).ToUpper() + “,”; //Convert.ToString(byte, 16)把byte转化成十六进制string
}
return result;
}
在淘宝“高校基地”店买了一个http://item.taobao.com/item.htm?spm=a1z0k.6846101.1130973605.d4915209.SAObbz&id=36884805726,还有一种是PWM输出,这个代码比较多,就是最普遍的发送命令,然后等待信号,再计时,用声速推算距离,但是TX输出把我搞乱了。
终于在http://forum.arduino.cc/index.php?topic=88388.5;wap2找到了答案:
#include <SoftwareSerial.h>
// TX_PIN is not used by the sensor, since that the it only transmits!
#define PING_RX_PIN 6
#define PING_TX_PIN 7SoftwareSerial mySerial(PING_RX_PIN, PING_TX_PIN);
long inches = 0, mili = 0;
byte mybuffer[4] = {0};
byte bitpos = 0;void setup() {
Serial.begin(9600);mySerial.begin(9600);
}void loop() {
bitpos = 0;
while (mySerial.available()) {
// the first byte is ALWAYS 0xFF and I’m not using the checksum (last byte)
// if your print the mySerial.read() data as HEX until it is not available, you will get several measures for the distance (FF-XX-XX-XX-FF-YY-YY-YY-FF-…). I think that is some kind of internal buffer, so I’m only considering the first 4 bytes in the sequence (which I hope that are the most recent! 😀 )
if (bitpos < 4) {
mybuffer[bitpos++] = mySerial.read();
} else break;
}
mySerial.flush(); // discard older values in the next readmili = mybuffer[1]<<8 | mybuffer[2]; // 0x– : 0xb3b2 : 0xb1b0 : 0x–
inches = 0.0393700787 * mili;
Serial.print(“PING: “);
Serial.print(inches);
Serial.print(“in, “);
Serial.print(mili);
Serial.print(“mili”);delay(100);
}
说明:模块每次输出一帧,含4个8位数据,帧格式为:0XFF+H_DATA+L_DATA+SUM
1、0XFF: 为一帧开始数据,用于判断。
2、H_DARA:距离数据的高8位。
3、L_DATA:距离数据的低8位。
4、SUM: 数据和用于交验。其0XFF+H_DATA+L_DATA=SUM(仅低8位)
5、H_DATA与L_DATA合成16位数据,即以毫米为单位的距离值。
注意:模块检测最小距离为30cm,在30cm内有物体,将获得不准确信号。
以上代码中没有做SUM校验
如图,因为Yun的网线口比之前的板子挨着引脚近,所以V7插不上去,研究一番,决定加一层排母,垫高一些再插扩展板。最终选择
1.http://item.taobao.com/item.htm?id=20747855300 1个;
2.http://item.taobao.com/item.htm?id=20747511841 2个;
3.http://item.taobao.com/item.htm?id=20747903210 1个;
4.http://item.taobao.com/item.htm?id=20802935165 1个。
另外还想把这些排母焊到一层板子上,不过单买一个洞洞板运费不划算,回头想好了再说。
网站安装时只需要修改web.config中的数据库连接,其他不变,主要是<authentication mode=”Forms”>保持不变。
1. 用默认的admin账号登录,初始密码是password,界面上有说明,登录后可以在系统设置中修改;
2. 添加一个域帐号作为切换到域帐号登录模式后的管理员账号,新建用户,Admin->User Accounts->Create New User->User Name的格式为domain\username,具体如ccppg\mengfanyong,其他随便填,密码勾选Random Password; 继续阅读“BugNet Issue Tracker域帐号配置说明”