Home > Arduino & SCM Supplies > Digital
Simple circuit of digital temperature module and integrated LED connecting to digital 13 interface to make temperature indicator light. Use number 13 interface to connect the integrated LED£¬ connect digital temperature sensor to number 3 interface. When the digital temperature sensor senses key signal£¬ the LED is on£¬ otherwise£¬ it's out. Sample code: Int Led = 13;/ / define LED interface Int buttonpin = 3;/ / define the digital temperature sensor interface Int val./ / define digital variable val Void setup () { PinMode (Led£¬ the OUTPUT);/ / define the LED for the output interface PinMode (buttonpin£¬ INPUT);/ / define the digital temperature sensor for the output interface } Void loop () { Val = digitalRead (buttonpin);/ / to assign the value of digital interface 3 read val If (val = = HIGH) / / when digital temperature sensor detection signal£¬ LED flashing { DigitalWrite (Led£¬ HIGH); } The else { DigitalWrite (Led£¬ LOW); } }