LogicCraft Pro Logic Gates Development Board

Exploring digital designs with the Logic Gate Evaluation Board

BeginnerProtip100
LogicCraft Pro Logic Gates Development Board

Things used in this project

Hardware components

Logic Gates Evaluation Board
×1
Male to Male banana cables
×12
USB power cable
×1

Story

Read more

Schematics

Basic Logic Gates with an Arduino

Code

Logic Gates with an Arduino

Arduino
Use the below code to simulate logic gates with an Arduino. Open the serial monitor to observe outputs.
const int inputA = 2; // Input A pin
const int inputB = 3; // Input B pin
const int outputPin = 7; // Output LED pin (optional)

void setup() {
  Serial.begin(9600); // Initialize serial communication
  pinMode(outputPin, OUTPUT); // Set output pin as output (optional)
}

void loop() {
  // Read input states
  int a = digitalRead(inputA);
  int b = digitalRead(inputB);

  // Simulate logic gates
  int andOutput = a & b;
  int orOutput = a | b;
  int notA = !a;

  // Print results to serial monitor
  Serial.print("Input A: ");
  Serial.println(a);
  Serial.print("Input B: ");
  Serial.println(b);
  Serial.print("AND Output: ");
  Serial.println(andOutput);
  Serial.print("OR Output: ");
  Serial.println(orOutput);
  Serial.print("NOT A Output: ");
  Serial.println(notA);
  
  // Optional: Write output to LED (replace with your desired logic)
  // digitalWrite(outputPin, andOutput); // Example: Light LED only for AND output

  delay(5000); // Add a delay for better readability
}

Credits

Bhuvisara Dharmasena
5 projects • 1 follower
Contact
Chathura Yapa Bandara
19 projects • 5 followers
Contact

Comments

Please log in or sign up to comment.