Hackster is hosting Hackster Holidays, Ep. 7: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Friday!Stream Hackster Holidays, Ep. 7 on Friday!
PCBX
Published

A Deep Dive into the 3D-NAND Gate Verification Circuit

Unlock the future of electronics with our 3D-NAND Gate Verification Circuit, ensuring reliable performance and efficiency in advanced tech.

BeginnerFull instructions provided54

Things used in this project

Story

Read more

Schematics

3d-nand_gate_verification_circuit_2oQyyzNjPY.png

Code

Untitled file

Arduino
#include <LiquidCrystal.h>

// Initialize the LCD library, setting the Arduino pins connected to the LCD
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

// Define the pins for the buttons and logic gate outputs
const int button1 = 7;
const int button2 = 8;
const int andOutput = 9;
const int notOutput = 10;

void setup() {
  // Set the number of columns and rows for the LCD
  lcd.begin(16, 2);
  // Initialize the pin modes
  pinMode(button1, INPUT_PULLUP);
  pinMode(button2, INPUT_PULLUP);
  pinMode(andOutput, INPUT);
  pinMode(notOutput, INPUT);
  // Display the welcome message
  lcd.print("Logic Gate Test");
}

void loop() {
  // Read the state of the buttons
  int stateButton1 = digitalRead(button1);
  int stateButton2 = digitalRead(button2);
  
  // Calculate the AND gate output
  int andState = stateButton1 & stateButton2;
  digitalWrite(andOutput, andState);
  
  // Calculate the NOT gate output
  int notState = !andState;
  digitalWrite(notOutput, notState);
  
  // Display the results
  lcd.setCursor(0, 1);
  lcd.print("AND: ");
  lcd.print(andState);
  lcd.print(" NOT: ");
  lcd.print(notState);
  
  // Delay for a while to observe the results
  delay(500);
}

Credits

PCBX
19 projects • 3 followers
Customer Success: Your one-stop solution for PCB and PCBA services, plus component sourcing. Enjoy FREE online simulation and EDA.

Comments