Truth table of NAND gate when connected to Arduino.
Truth table of NAND gate when connected to Arduino is given below. Led will turn on if any of the input is LOW. LED will turn off when both inputs are HIGH.
A simple program to control NAND gate using Arduino is given below.
void setup()
{
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
}
void loop()
{
digitalWrite(8, LOW);
digitalWrite(9, HIGH);
delay(1000);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);
delay(1000);
digitalWrite(8, HIGH);
digitalWrite(9, LOW);
delay(1000);
digitalWrite(8, LOW);
digitalWrite(9, LOW);
delay(1000);
}
Upload the above program to your arduino board. If the circuit is correct and uploading is successfull, LED will remain off for three seconds. Then turn on for next one second. This process continues for ever.
Read more :
Great Article
ReplyDeleteIoT Projects
Python Training in Chennai
Project Center in Chennai
Python Training in Chennai