public static void Main() { // Set up the LCD display on COM2 LCDDisplay lcdDisplay = new LCDDisplay(LCDDisplay.DISPLAY_WIDTH.x16_CHARACTERS, LCDDisplay.DISPLAY_HEIGHT.x2_LINES, SerialPorts.COM2); // Instantiate the RFID display controller RFIDDisplay rfidDisplay = new RFIDDisplay(lcdDisplay); // Set up the RFID reader using the RFID display controller to receive ID events RFIDReader rfidReader = new RFIDReader(SerialPorts.COM1, Pins.GPIO_PIN_D4, rfidDisplay); // Sleep forever, the entire program is event driven Thread.Sleep(Timeout.Infinite); }
public RFIDDisplay(LCDDisplay lcdDisplay) { // Get a copy of the LCD they set up ourLcdDisplay = lcdDisplay; // Is the LCD set up? if (ourLcdDisplay == null) { // No, throw an exception throw new NotSupportedException("The LCD object may not be NULL."); } // Clear the display when we first start ourLcdDisplay.clearDisplay(); }