Skip to content

Instantly share code, notes, and snippets.

@yamato8
Created February 12, 2014 00:12
Show Gist options
  • Save yamato8/8947253 to your computer and use it in GitHub Desktop.
Save yamato8/8947253 to your computer and use it in GitHub Desktop.
アンドロイドとmbedをUSBで繋げてみる。:android,mbed
#include "mbed.h"
Serial pc(USBTX, USBRX); // tx:送信, rx:受信
void rxCallback()
{
pc.putc(pc.getc());
}
int main()
{
pc.attach(rxCallback, Serial::RxIrq);
while (1) {
pc.printf("Hello World!\n");
wait(0.5);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment