x mbed2リビジョン144
x リビジョンの変更がわかる人むけ
目的
デバッグのテスト
出力先は、 P0_7 RED
//S_SER_A_A_A_812_1
#include "mbed.h"
//仮想シリアルへの一文字出力 1000bps
DigitalOut TX(P0_7);
#define UART_DELAY 1
void pc_putc(char ch)
{
TX=1;
TX=0;//Start
wait_ms(UART_DELAY);
for(int ii=0; ii<8; ii++) { //Data x 8
TX=(ch>>ii)&1;
wait_ms(UART_DELAY);
}; //for
TX=1;//Stop
wait_ms(UART_DELAY);
} //pc_putc
//メイン関数
int main()
{
//無限ループ
while(1) {
//'A'の出力
pc_putc( 'A' );
//1秒待つ
wait_ms(1000);
}//while
}//main
-3-