google-sheet2Html

/*! * * Google Sheets To HTML v0.9a * * To use, simply replace the "tq?key=" value in the * URL below with your own unique Google document ID * * The Google document's sharing must be set to public * */ google.load('visualization', '1', { packages: ['table'] }); var visualization; function drawVisualization() { var query = new google.visualization.Query('https://spreadsheets.google.com/tq?key=https://docs.google.com/spreadsheets/d/1-vUEZ9tae5C_OXzSi0dQPWwUrO3H5S-gImB5afFgqDg/edit?usp=sharing'); query.setQuery('SELECT A, B, C, D label A "Duration", B "Song", C "Requested By", D "URL"'); query.send(handleQueryResponse); } function handleQueryResponse(response) { if (response.isError()) { alert('There was a problem with your query: ' + response.getMessage() + ' ' + response.getDetailedMessage()); return; } var data = response.getDataTable(); visualization = new google.visualization.Table(document.getElementById('table')); visualization.draw(data, { legend: 'bottom' }); } google.setOnLoadCallback(drawVisualization);
Showing posts with label Arduino. Show all posts
Showing posts with label Arduino. Show all posts

Wednesday, November 22, 2017

Install Servo Controller Pololu บน Linux



  ติดตั้ง Pololu Maestro Control Center บน Linux






สำหรับผู้ใช้ Linux ให้ไป download และติดตั้งที่  

https://www.pololu.com/product/1350/resources

ในขณะเขียนบทความ (20 พย 2560) ชื่อไฟล์ที download ได้คือ maestro-linux-150116.tar.gz

เมื่อได้ไฟล์มาแล้ว ให้แตกไฟล์ออก ผู้เขียนแตกไฟล์ ที่ Downloads ได้แฟ้มชื่อ maestro-linux


ในfile README.txt  แจ้งว่าการติดตั้งในระบบ ต้องมี่ package ดังนี้

libusb-1.0-0-dev mono-runtime libmono-winforms2.0-cil 


เมื่อทำการติดตั้งโดยใช้คำสั่ง ตามเอกสารใน README.txt 

 $ sudo apt-get install libusb-1.0-0-dev mono-runtime libmono-winforms2.0-cil

จะเกิด error ดังในภาพ


 


คือไม่สามารถหา package ชื่อ libmono-winforms2.0-cil ให้ทำการแก้ไขโดยติดตั้ง mono-reference-assemblies-2.0 mono-devel ทดแทน
ให้ทำการแก้ไขโดยติดตั้งด้วยคำสั่ง

$ sudo apt-get install libusb-1.0-0-dev mono-runtime mono-reference-assemblies-2.0 mono-devel

  
ก็จะทำการติดตั้งได้ ขั้นต่อไป ในTerminal ให้ใช้คำสั่ง cd ไปยังตำแหน่งที่แตกไฟล์ในตัวอย่างแตกไฟล์ที่ Downloads ให้พิมพ์คำสั่ง 

$ cd Downloads/maestro-linux 

 
จะพบไฟล์ชื่อ 99-pololu.rules เพื่อใช้ในการแก้ไขค่า permission ให้กับ users ต้องทำการ copy ไฟล์ 99-pololu.rules ไปยังตำแหน่ง     /etc/udev/rules.d/
ด้วยคำสั่ง

$ sudo cp 99-pololu.rules /etc/udev/rules.d
 

ถ้าหากได้ทำการต่อบอร์ด Pololu Servo Controller ไว้แล้วต้องทำการถอดออกก่อน ทำการเรียกโปรแกรมด้วย

$ ./MaestroControlCenter

ให้สังเกตุ มีเครื่องหมาย จุด หน้า เครื่องหมาย /  ก็จะเปิดโปรแกรม Pololu Maestro Control Center ได้












Monday, August 7, 2017

ควบคุม Arduino ด้วย Processing


ใช้Processing ควบคุมบอร์ดArduino ด้วย Firmata

 



ในกรณีทีต้องการ ควบคุม Arduino ผ่านโปรแกรม Processing ทำได้โดย การ upload firmware ชื่อ Firmata ลงไปบนบอร์ด Arduino 


การติดตั้ง Firmata ลงบน Processing ให้ทำการ download เวอร์ชั่นล่าสุดจาก http://playground.arduino.cc/Interfacing/Processing

โดยเลือกให้ตรงกับเวอร์ชั่น ของ Processing ที่ติดตั้งไว้ ในที่นี้ เป็นตัวอย่างสำหรับ Processing v3 



เลือกดาว์โหลด processing-arduino.zip


 



ทำการแตกไฟล์ จะได้ โฟลเดอร์ arduino ทำการcopy ไปยัง sketchbook ซับโฟลเดอร์ libraries


 
 


เปิดโปรแกรม Arduino เลือก file → Examples → Firmata → StandardFirmata จากนั้นทำการ อัพโหลด ลงบอร์ด 






ในโค้ดตัวอย่างให้เปลี่ยน ค่าระบุชื่อพอร์ทที่ติดตั้งบอร์ด จาก [0] เป็น ttyACM0 (ปรกติจะเป็น ชื่อแรกที่ list ออกมาทาง ด้านล่่าง
 

ตัวอย่างเช่น โค้ดเดิม

arduino = new Arduino(this, Arduino.list()[0], 57600);

ให้แก้ไข เป็น

arduino = new Arduino(this, "/dev/ttyACM0", 57600);


Sunday, July 23, 2017

ติดตั้ง Arduino core สำหรับ ESP32S




ติดตั้ง Arduino core สำหรับ ESP32S


บอร์ด NodeMCU V1.1 ESP32S มีความสามารถน่าสนใจ โดยมี WIFI และ Bluetooth ในตัวทั้ง ความเร็ว และ เมโมรี ก็มากกว่า NodeMCU V2 ESP8266 ลองดูตารางเปรียบเทียบ ภาพจาก เวป

https://www.youtube.com/watch?v=Mq1YhgS5VkY



ติดตั้งArduino core สำหรับ ESP32S ในการ

ติดตั้งบน OS Linux สามารถเข้าไปดูรายละเอียดที่ https://github.com/espressif/arduino-esp32#instructions-for-debianubuntu-linux
โดยใช้คำสั่ง ดังนี้
  หลังจากการติดตั้งให้ restart Arduino IDE จากนั้นไปที่ Tools จะมีชือ บอร์ด ESP32DevModule




รายละเอียดขา Pin Map


ภาพจาก https://github.com/espressif/arduino-esp32#instructions-for-debianubuntu-linux


Saturday, July 22, 2017

แก้ปัญหา NodeMCU ทำการ Upload ข้อมูลไม่ได้


แก้ปัญหา NodeMCU upload ข้อมูลด้วย Arduino IDEไม่ได้





เมื่อทดลองใช้ NodeMCU V2 ด้วย Arduino IDE โดยใช้ OS Linux มีปัญหา อัพโหลด ข้อมูลลงไปยัง บอร์ดไม่ได้ มีข้อความ

An error occurred while uploading the sketch

error: cannot access /dev/ttyUSB0


 

ให้ทำการแก้ไข permissionโดย ใช้คำสั่ง
 
$ sudo usermod -a -G dialout <username>
$ sudo chmod a+rw /dev/ttyUSB0


โดย <username> คือชื่อที่ใช้ในการ ล๊อกอิน ของคอมพิวเตอร์
ข้อมูลจาก