wiringPi library (C) for CrowPi
เปิดโปรแกรม Vscode เชื่อมต่อ VScode เข้ากับ WSL
สร้างไดเรคทอรี่ของตัวเองขึ้นมา แล้วเข้าไปยังภายในไดเรคทอรี่
mkdir Jameza007
cd Jameza007
3. ทำการโคลนไฟล์ชุดคำสั่งภาษา C จากลิ้ง github https://github.com/absayuti/crowpi โดยใช้คำสั่งดังนี้
git clone https://github.com/absayuti/crowpi
4. คัดลอกไดเรคทอรี่ที่มีไฟล์ Crowpi ที่ดาวน์โหลดในขั้นตอนที่ 3 ไปยัง RaspberryPi
scp -r Jameza007 pi@[ip_address_of_Rpi]:~/
5. ทำการ Secure shell (ssh) เข้า RaspberryPi
ssh pi@[ip_address_of_Rpi]
password RaspberryPi : raspberry
6. ใช้คำสั่ง ls เพื่อ แสดงไฟล์อยู่ใน RaspberryPi
ls
7. ใช้คำสั่ง cd เข้าไปยังไดเรคทอรี่ที่ได้คัดลอกจากคอมพิวเตอร์มายัง RaspberryPi และเข้าไปยังดเรคทอรี่ crowpi
cd Jameza007/crowpi
8. ทำการทดลอง complie โปรแกรมชุดคำสั่งภาษา C ของแต่ละเซนเซอร์โดยใช้คำสั่งดังนี้
gcc ไฟล์โค้ด.c -o ชื่อไฟล์ที่จากComplie -lwiringPi -Wall
ชื่อไฟล์ที่ได้จากการcomplie ให้ตั้งชื่อดังนี้ ชื่อไฟล์โค้ด_รหัสนิสิต
ตัวอย่าง complie sensor DHT11 ไฟล์ temphumidity.c

9.เมื่อได้ไฟล์ complie แล้ว ให้ทำการ Run โปรแกรมด้วยคำสั่งดังนี้
./ชื่อไฟล์ที่จากComplie
ตัวอย่าง Run โปรแกรม temphumidity_รหัสนิสิต และผลการทำงาน

Date: May 2023
Author: Soontree Jaikhong (AIC-Researcher)
Author: Thanaluk Pranekunakol (AIC-Researcher)
Last updated
Was this helpful?