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)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay