/*
Demonstration of the seven segment decoder.
See https://blog.jochumzen.com/p/entries.html entry 10
Set a four bit binary number on DIP switches 5-8
The corresponding Hex value is shown on the seven segment display.
*/
//Library with basic gates
#include <ACELBC.h>
//Create an Arduino board
auto* ard = new ArduinoBoard();
//Define chips
auto* decoder = new SevenSegmentDecoderAnode();
//Add all chips to be emulated here
Chip* chips[] = {
decoder
};
//Add all connections here
ConnectionBase* connections[] = {
new Connection(ard, 2, decoder->Q[3]),
new Connection(ard, 3, decoder->Q[2]),
new Connection(ard, 4, decoder->Q[1]),
new Connection(ard, 5, decoder->Q[0]),
new Connection(decoder->S[0], ard, 22),
new Connection(decoder->S[1], ard, 23),
new Connection(decoder->S[2], ard, 24),
new Connection(decoder->S[3], ard, 25),
new Connection(decoder->S[4], ard, 26),
new Connection(decoder->S[5], ard, 27),
new Connection(decoder->S[6], ard, 28),
};
//Setting up the emulation. No need to change
Emulation emulation = Emulation(ard, chips, sizeof(chips)/2,
connections, sizeof(connections)/2);
void setup() {
Serial.begin(9600); Serial.println(); Serial.println("START");
Serial.println();
emulation.makePrintPin(13, 1);
}
void loop() {
emulation.emulate();
}
D3..D0
Print