For the complete documentation index, see llms.txt. This page is also available as Markdown.

wiringPi library (C) for CrowPi

  1. เปิดโปรแกรม Vscode เชื่อมต่อ VScode เข้ากับ WSL

  2. สร้างไดเรคทอรี่ของตัวเองขึ้นมา แล้วเข้าไปยังภายในไดเรคทอรี่

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] 

6. ใช้คำสั่ง ls เพื่อ แสดงไฟล์อยู่ใน RaspberryPi

ls

7. ใช้คำสั่ง cd เข้าไปยังไดเรคทอรี่ที่ได้คัดลอกจากคอมพิวเตอร์มายัง RaspberryPi และเข้าไปยังดเรคทอรี่ crowpi

cd Jameza007/crowpi

8. ทำการทดลอง complie โปรแกรมชุดคำสั่งภาษา C ของแต่ละเซนเซอร์โดยใช้คำสั่งดังนี้

gcc ไฟล์โค้ด.c -o ชื่อไฟล์ที่จากComplie -lwiringPi -Wall

ตัวอย่าง complie sensor DHT11 ไฟล์ temphumidity.c

9.เมื่อได้ไฟล์ complie แล้ว ให้ทำการ Run โปรแกรมด้วยคำสั่งดังนี้

ตัวอย่าง Run โปรแกรม temphumidity_รหัสนิสิต และผลการทำงาน

Date: May 2023

Author: Soontree Jaikhong (AIC-Researcher)

Author: Thanaluk Pranekunakol (AIC-Researcher)

Last updated

Was this helpful?