Posts

Showing posts from June, 2018

Tips for Cadence

Virtuoso Schematic Draw a diagonal line - F3 Zoom to fit - F Defining parameter for the upper level - pPar("parameter_name") Virtuoso Layout Zoom to fit - F Show layer pattern - Shift+F Show block - Ctrl+F Update the Annotation Browser - Connectivity->Update->Components And Nets

การลบ Windows ใน Bootcamp

ปัญหา: "The startup disk cannot be partitioned or restored to a single partition" วิธีแก้: เปิด Terminal แล้วรัน diskutil eraseVolume fat32 BOOTCAMP disk0s4 diskutil eraseVolume jhfs+ BC1 disk0s3 diskutil eraseVolume jhfs+ BC2 disk0s4 diskutil mergePartitions jhfs+ BCMP disk0s3 disk0s4 diskutil list ถ้ามี disk0s3, รัน diskutil eraseVolume fat32 BOOTCAMP disk0s3 เสร็จแล้วรัน Bootcamp Assistant แล้ว Remove/Restore

การสร้างหน้า google maps ใน ionic slide menu

Image
สร้าง Project โดยใช้ SlideMenu Template เพิ่ม <script src="http://maps.google.com/maps/api/js?key= API_KEY "></script> ใน www\index.html เพิ่มหน้าแผนที่โดยเพิ่ม code ในไฟล์ \www\templates\ map.html <ion-view view-title="Map">     <ion-content>         <div id="map" data-tap-disabled="true"></div>     </ion-content> </ion-view> เพิ่ม menu item โดยเพิ่ม code ในไฟล์ \www\templates\menu.html         <ion-item menu-close href="#/app/map">             Map         </ion-item> เพิ่ม code ใน \www\js\app.js   .state('app.map', {       url: '/map',       views: {           'menuContent': {               templateUrl: 'templates/map.html',               controller: 'MapCtrl'           }       }   }) เพิ่ม controller ใน \www\js\controller.js โดยเบื้องต้นได้กำหนดพิกัดตายตัว .cont

การตั้งค่า Raspberry Pi 3 เพื่อเชื่อมต่อ RS485

Image
Objective: ทดสอบการใช้งาน RPi กับ RS485 โดยในการทดสอบจะให้ RPi สื่อสารกับ PC อุปกรณ์ฝั่ง RPi: 1. Raspberry Pi 3 2. RS485 Shield V3 - Raspberry Pi [2] อุปกรณ์ฝั่ง PC: 1. RS485 to Serial UART Module [3] 2. USB to UART converter ยี่ห้อ INEX โปรแกรมฝั่ง PC: 1. โปรแกรมสื่อสารพอร์ต serial ในที่นี้ใช้ serial monitor ใน arduino IDE การเตรียม RPi: 1. ติดตั้งโปรแกรมเพื่อใช้งานพอร์ด serial ด้วยคำสั่ง $ sudo apt-get update $ sudo apt-get install python-dev $ sudo pip install wiringpi $ sudo apt-get install python-serial 2. แก้ไขไฟล์ /boot/cmdline.txt โดยเอาข้อความ  "console = ttyAMA0, 115200 kgdboc = ttyAMA0, 115200" ออก โดยจะเหลือไว้เพียง: dwc_otg.lpm_enable = 0 console = tty1 root = / dev/mmcblk0p2 rootfstype = ext4 elevator = deadline rootwait 3. ปิดการเข้า console ผ่านพอร์ต serial ด้วยคำสั่ง $ sudo systemctl disable serial-getty@ttyAMA0.service 4. แก้ไขไฟล์ /boot/config.txt ให้ค่า "enable_uart=1" 5. ปิด RPi

การใช้งาน SD shield, GPRS shield ร่วมกับ Arduino Mega

Image
Issue: ที่ผ่านมาเราใช้ mega ขา 10, 11 ต่อเข้ากับ gprs shield ขา 7, 8 (SWserial) แต่เมื่อมี sd shield มาต่อด้วย ทำให้เราใช้ขา 10, 11 ดังกล่าวไม่ได้เพราะมันทับกับ ขา spi ที่ต้องใช้สื่อสารกับ sd shield Objective: บทความนี้เสนอการแก้ปัญหาการใช้งาน SD shield, GPRS shield ร่วมกับ Arduino Mega โดยใช้ HWserial (ขา 14, 15) แทน SWserial  (ขา 10, 11) Hardware: 1. arduino mega 2. gprs shield พร้อม ซิม 3. sd shield 4. สายไฟ สาย USB และอื่นๆ ต่อวงจรเข้าด้วยกันตามรูป โดย 1. mega ขา 14 -> gprs ขา 8 2. mega ขา 15 -> gprs ขา 7 3. set jumper บน gprs ไปที่ SW uart 4. mega ขา 53 -> gprs ขา 4 เพื่อเชื่อมกับ sd shield ขา 4 ที่อยู่ตรงกลาง Software: 1. Arduino IDE เขียนโปรแกรม: ใช้ "Serial3 เชื่อมต่อ gprs" และ "Serial เชื่อมต่อคอมพิวเตอร์" โปรแกรมด้านล่างเป็นการเปิดไฟล์ที่อยู่ใน sd card และแสดงข้อมูลภายในออกมาทาง serial  จากนั้นเชื่อมต่อ gprs เพื่อทดสอบการเปิดเว็บด้วย AT command #include <SPI.h> #include <SD.h&