2015年5月12日 星期二

[名詞定義]Bluetooth V.S Bluetooth Smart V.S Bluetooth Smart Ready

今天有幸得知Bluetooth的差異,就立刻來紀錄一下。


以下圖片皆來自網路,如果侵權請留言告知。


之前常見的藍芽標誌為









而在藍芽4.0後出現了二個新的LOGO














Bluetooth Smart指的是藍芽4.0的低功耗版本,是應用在「心率監控器或計步器等使用
扭扣式電池並傳輸單一資訊的裝置」。

而

Bluetooth Smart則是同時兼具傳統藍芽以及低功耗「雙模」版本。


相容性表格如下


版本
相容版本
Bluetooth Smart READY
Bluetooth Smart READY , Bluetooth Smart ,Bluetooth
Bluetooth
Bluetooth Smart READY , Bluetooth
Bluetooth Smart
Bluetooth Smart READY


資料來源

http://chinese.engadget.com/2011/10/26/bluetooth-sig-unveils-smart-marks-explains-v4-0-compatibility-w/

2015年5月5日 星期二

[VB6] 輸出資料到RS232

VB6 輸出資料到RS232


Open "COM1:9600,N,8,1,CD0,CS0,DS0,OP0,RS" For Output As #1

Print #1, Chr(27) + Chr(67) + Chr(13)

Close #1




上述的程式碼,就是對 posiflex pp2000  下全切紙命令,因此刀子會動,有聲音很明顯。

COM1後面指的是要對那一個Com 埠做傳輸


9600 為 Baud Rate , 每秒鐘多少位元bits per second (bit/s)。


傳輸的時候,一般用 n, 8, 1, 即 n parity bit, 8 data bits, 1 stop bit

所以一個 byte 傳輸時,實際是 1 start bit + 8 data bits + 1 stop bit = 10 bits


CD0 的意思為等待多少亳秒做資料俞時的檢測


cd = # of ms to wait for the time-out on data carrier detect (DCD)line



RS 抑制檢測請求發送(RTS)信號

rs = suppress detection of request to send(RTS) signal




不過這個方法有時候會遇到,找不到檔案,或是機器完全不理你的情況。

誠心建議改用

MSComm 元件

專案->設定使用元件->瀏覽



































































選擇MSComm32.Ocx ->開啟






















勾選Microsoft Comm Control 6.0 ->確定






























工具箱會出現一個像電話的圖案,把它加入到Form裡


































































'先將預設的 COM 關掉
If (MSComm1.PortOpen = True) Then MSComm1.PortOpen = False
     
MSComm1.CommPort = Right(SalePrinter, 1)
'連線速度 9600 baud、無同位檢查、資料位元 8、停止位元 1
MSComm1.Settings = "9600,N,8,1"
'告訴控制項當使用 Input 時,讀取整個暫存區
MSComm1.InputLen = 0
     
   
'開啟序列連接埠
If (MSComm1.PortOpen = False) Then MSComm1.PortOpen = True


MSComm1.Output="輸出內容"

MSComm1.PortOpen = False '關閉連接

參考資料

http://eva54185418.blogspot.tw/2013/01/arduino-serial-port.html
http://www.freebasic.net/forum/viewtopic.php?t=9336

http://wukm.blogspot.tw/2007/05/mscomm-rs232.html




[Linux]刪除/新增 roundcube的使用者


切換到root身份

刪除


1.先修改/etc/aliases 把此user的信轉給別人(非必要)

2. userdel -r 使用者帳號



新增


1. useradd -m xxx

修改使用者密碼

2. passwd xxx