Difference between revisions of "Arduino: Cek sambungan USB ke laptop"
Jump to navigation
Jump to search
Onnowpurbo (talk | contribs) |
Onnowpurbo (talk | contribs) |
||
Line 37: | Line 37: | ||
echo -n "Hello" > /dev/ttyACM0 | 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 | ||
==Referensi== | ==Referensi== | ||
* http://playground.arduino.cc/Interfacing/LinuxTTY | * http://playground.arduino.cc/Interfacing/LinuxTTY |
Revision as of 14:29, 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