本篇是一個概念,並沒有程式碼內容,也許日後會再補上相關的範例說明。

Pololu wheel encoder常用來做DC motor的編碼器,請參考網址:https://www.pololu.com/product/1217,

其建議使用的輪胎為;https://www.pololu.com/product/1090,

當然還需要DC motor:https://www.pololu.com/category/60/micro-metal-gearmotors,

DC motor與encoder的Arduino控制程式網路上都有人有提供一些 版本,

但當要把資料傳到LabVIEW時,LabVIEW for Arduino並沒有提供相關的VI,

我們可以進一步看LabVIEW for Arduino提供的firmware-->LIFA_Base.ino,以及LabVIEWInterface.ino,

裡面寫的都是LaVIEW與Arduino溝通的程式碼,基本上也都是用serial port溝通,

所以基本上,只要把DC motor與encoder的Arduino code加到LIFA_Base.ino以及LabVIEWInterface.ino中,

然後再將想傳遞的參數用serial.write()功能傳到LabVIEW,這樣就可以擴充LabVIEW for Arduino的功能,增加自己想要的模組。

以上是基本的原則,實際上寫的話要先去看LIFA_Base.ino以及LabVIEWInterface.ino,

了解LabVIEW for Arduino這套程式在LabVIEW端與Arduino程式端的邏輯想法,

這會對自己要加入新的模組很有幫助,如果想同時使用LabVIEW與Arduino的人,不妨花一些時間去看一下這些程式碼的內容。

 

 

 

 

 

arrow
arrow

    fishark 發表在 痞客邦 留言(0) 人氣()