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);

Thursday, January 26, 2017

โปรแกรม อ่าน ประกาศข่าว ชมรม ออโตเมติก

ประกาศข่าว ชมรม ด้วยคอมพิวเตอร์


   เนื่องด้วย พรบ. คอมพิวเตอร์ฉบับใหม่ ที่ประกาศใช้(25 มค.2560) มีบทกำหนดโทษผู้เผยแพร่ ซอร์ดโค้ด ที่มีผู้อื่นนำไปใช้ในทางผิดกฎหมาย จึงขอประกาศไว้ในที่นี้ว่า ผู้เขียนมีเจตนา สอนการเขียนโปรแกรมเพื่อการศึกษา เท่านั้น

   ในบทความนี้ เป็นการเขียน Python script สำหรับ เรียก CQ ในการแข่งขัน CQ contest หรือ ไปใช้ในการประกาศข่าวสมาคม โดยตั้งเวลาได้ โดยใช้ กราฟฟิก GUI ของ Tkinter

ก่อนทำการเรียกใช้ โปรแกรม
สิ่งที่ต้องเตรียมคือ ไฟล์เสียงนามสกุล wav  ซึ่งเป็นไฟล์ เสียงที่ บันทึกไว้ล่วงหน้า รูปร่างหน้าตาของ โปรแกรม มีดังนี้





แถบ slide bar เพื่อเลือกการตั้งเวลา ให้รอกี่นาที จึงอ่านประกาศ ซึ่งตั้งได้ 30 นาที เมื่อทำการตั้งเวลาแล้ว ให้กดปุ่ม Start
เมื่อครบเวลาที่กำหนด จะ เล่น ไฟล์เสียง ออกทางวิทยุสื่อสาร ดังภาพ


 ภาพด้านล่าง เป็น สคริป




ในการใช้งานจริง ให้แก้ไข ที่ บรรทัด def PlayAudio โดยทำการแทรกโค้ด สังเปิดปิด สวิท ptt ของวิทยุสื่อสาร

และ ให้แก้ไข การนับเวลา ที่ start_timer ซึ่งได้แก้ไว้ให้ เร็วกว่าจริง เพื่อ บันทึกวีดีโอ
 https://youtu.be/yyIs20I4qHo


No comments:

Post a Comment