= SPIマスター = Arduino用のSPIクラス(マスター側)を書きました。 source:/arduino-spi 使い方の例。[http://japan.maxim-ic.com/quick_view2.cfm/qv_pk/3149 MAX6675冷接点補償K熱電対ディジタルコンバータ]から温度を読んでみました。 {{{ #!c #include "SPI.h" #define SLAVE 10 void setup() { Serial.begin(9600); SPI_Master.begin(SLAVE); } void loop() { int value; delay(500); SPI_Master.enable(SLAVE); value = SPI_Master.read() << 8; value |= SPI_Master.read(); SPI_Master.disable(); if ((value & 0x0004) != 0) Serial.println("Error"); else Serial.println((value >> 3) * 0.25); } }}}