Difference between revisions of "Arduino: Cek sambungan USB ke laptop"
Jump to navigation
Jump to search
Onnowpurbo (talk | contribs) |
Onnowpurbo (talk | contribs) |
||
Line 89: | Line 89: | ||
==cek Status USB== | ==cek Status USB== | ||
− | stty -a < /dev/ | + | stty -a < /dev/ttyACM0 |
Harusnya keluar, misalnya, | Harusnya keluar, misalnya, | ||
Line 104: | Line 104: | ||
Set serial agar sesuai | Set serial agar sesuai | ||
− | stty -F /dev/ | + | stty -F /dev/ttyACM0 115200 -parenb -parodd cs8 hupcl \ |
-cstopb cread -clocal crtscts -ignbrk -brkint -ignpar \ | -cstopb cread -clocal crtscts -ignbrk -brkint -ignpar \ | ||
-parmrk -inpck -istrip -inlcr -igncr -icrnl ixon -ixoff \ | -parmrk -inpck -istrip -inlcr -igncr -icrnl ixon -ixoff \ |
Latest revision as of 14:54, 16 November 2015
Untuk mengetahui apakah Arduino yang kita miliki tersambung dengan baik dengan USB di laptop
- Sambungkan Power Supply ke Arduino
- Pastikan lampu "ON" nyala
- Sambungkan USB ke laptop
Di laptop ketik
lsusb
Akan keluar, salah satunya
Bus 003 Device 003: ID 2341:0043 Arduino SA Uno R3 (CDC ACM)
Berarti Arduino terdeteksi
Mengajak Arduino Bicara melalui TTY
Konfigurasi USB
stty -F /dev/ttyUSB0 cs8 115200 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts
Konfigurasi /dev/ttyACM0
stty -F /dev/ttyACM0 cs8 115200 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts
Bicara dengan Arduino
echo "Hello Arduino" > /dev/ttyACM0
Membaca informasi dari Arduino
tail -f /dev/ttyACM0
Cek buffering di Arduino
echo -n "Hello" > /dev/ttyACM0
Menggunakan screen
Install
apt-get install screen
Set baud rate
stty -F /dev/ttyACM0 cs8 9600 ignbrk -brkint -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts
Masuk ke screen
screen /dev/ttyACM0 9600
Lakukan
- Press Enter
- Kirim
w d 13 1
r a
r d
Yang akan dilakukan Arduino
- Write Digital pin 13 nilai 1
- Read Analog
- Read Digital
Menggunakan cu
Instalasi
sudo apt-get install cu
Komunikasi
cu -l /dev/<device> -s <speed> cu -l /dev/ttyACM0 -s 115200
Apa saja yang di ketik di layar akan langsung dikirim Apa saja yang di terima akan langsung di tampilkan
cek Status USB
stty -a < /dev/ttyACM0
Harusnya keluar, misalnya,
speed 115200 baud; rows 0; columns 0; line = 0; intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 1; -parenb -parodd cs8 hupcl -cstopb cread -clocal crtscts -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke
Set serial agar sesuai
stty -F /dev/ttyACM0 115200 -parenb -parodd cs8 hupcl \ -cstopb cread -clocal crtscts -ignbrk -brkint -ignpar \ -parmrk -inpck -istrip -inlcr -igncr -icrnl ixon -ixoff \ -iuclc -ixany -imaxbel -iutf8 -opost -olcuc -ocrnl -onlcr \ -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 \ -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh \ -xcase -tostop -echoprt -echoctl -echoke