Skip to content

Instantly share code, notes, and snippets.

@fxprime
Created June 13, 2019 12:46
Show Gist options
  • Select an option

  • Save fxprime/26e2aa3a2812b726a8ad48770c410d79 to your computer and use it in GitHub Desktop.

Select an option

Save fxprime/26e2aa3a2812b726a8ad48770c410d79 to your computer and use it in GitHub Desktop.
/**
* www.ArduinoNa.com
* ในตัวอย่างนี้ใช้ Library ของคุณ E. Kremer ซึ่งสามารถเพิ่มได้จาก
* Arduino IDE -> Tools -> Manage Libraries -> พิมพ์ว่า MAX6675
* เลือก MAX6675 with hardware SPI by Evgeny Kremer
*
* ต่อกับ arduino uno/pro mini
* sensor -> arduino uno/pro mini
* gnd -> gnd
* vcc -> vcc
* sck -> digital 13
* cs -> digital 10
* so -> digital 12
* ตัวย่อ
* cs = chip select บางที่ใข้ slave select
* so = slave out = MISO = master in slave out
* sck = signal clock สัญญาณนาฬิกา
**/
#include <MAX6675.h>
#define CS_PIN 10
MAX6675 tcouple(CS_PIN);
void setup()
{
Serial.begin(9600);
Serial.println("****MAX6675 thermocouple library by E. Kremer****");
Serial.println();
}
void loop()
{
float celsius = tcouple.readTempC();
float fahrenheit = tcouple.readTempF();
Serial.print("T in С = ");
Serial.print(celsius);
Serial.print(". T in Fahrenheit = ");
Serial.println(fahrenheit);
delay(500);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment