DEV Community

MrChoke
MrChoke

Posted on • Originally published at Medium on

1

Get Temperature for Mac Mini M1

ตอนนี้ app เสียตังทะยอยกันออกมา สามารถตรวจสอบอุณหภูมิ และ ความเร็วพัดลมกันได้บ้างแล้ว ส่วนทาง open source ยังหายากอยู่ ลองหาๆ ดูมีคนหนึ่งเอา source จาก iOS มาดัดแปลง (มีความใกล้เคียงกันมากกับ iOS ?)

Source Code

fermion-star/apple_sensors

Compile

monitor.cpp

clang -o monitor monitor.cpp -lstdc++
Enter fullscreen mode Exit fullscreen mode

temp_sensor.m

clang -o temp_sensor temp_sensor.m -framework Foundation -framework IOKit
Enter fullscreen mode Exit fullscreen mode

Use

./temp_sensor|./monitor
Enter fullscreen mode Exit fullscreen mode

ส่วนความเร็วพัดลมยังไม่มีนะครับ คิดว่าน่าจะ get ค่ามาคล้ายๆ กัน


Top comments (0)

Retry later
Retry later