シリアル通信に挑戦
mbedとパソコンをusbケーブルで繋いでおく。
パソコンにドライバをインストールする。
http://mbed.org/handbook/Windows-serial-configuration
http://mbed.org/media/downloads/drivers/mbedWinSerial_16466.exe
ソースコードを書く
include the mbed library with this snippet
#include "mbed.h"
Serial pc(USBTX, USBRX); // tx, rx
int main() {
pc.printf("hello mbed!\r\n");
}
コンパイルして書き込む、
確認する。
このプログラムを実行すると、パソコンにシリアル通信で文字を送信する。
パソコンで、Tera Term をベクターからダウンロードして、インストールする。
mbedのリセットボタンを押して新しいプログラムを実行させる。
プログラムを変更して3秒毎に文字を送信するようにする。
include the mbed library with this snippet
#include "mbed.h"
Serial pc(USBTX, USBRX); // tx, rx
int main() {
while (1) {
pc.printf("hello mbed!\r\n");
wait(3.0f);
}
}
1 comment on シリアル通信に挑戦:
Please log in to post comments.

mbedシリアル通信のドライバをインストールしようとすると"unable to initialise setup task."と出てインストールできないのですが、どうすればよいでしょうか・・・? OSはWin8.1です。