Skip to content

Instantly share code, notes, and snippets.

@vixtory09678
Last active April 5, 2019 18:38
Show Gist options
  • Save vixtory09678/c9e1bb41234f9c62a60628ff5ab3fac5 to your computer and use it in GitHub Desktop.
Save vixtory09678/c9e1bb41234f9c62a60628ff5ab3fac5 to your computer and use it in GitHub Desktop.
int temperature = getTempFromSensor(); // อ่านค่าอุณหภูมิจาก sensor แล้วเอาเช็คเงื่อนไขเพื่อทำอะไรบางอย่าง
if (temperature < 20){ // ถ้าอุณหภูมิน้อยกว่า 20 ให้ปิดแอร์ หนาว!!
closeAirCondition();
} else { // แต่ถ้าไม่ใช่ก็ให้เปิดแอร์ เริ่มร้อนไง
openAirCondition();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment