Documentation


Install the LCD version on to the Arduino Board

LCD version Wire Connection Chart:

Wire Connection Chart

The Code:

// Fair Draw REAL! - Random Number Generator
// Copyright (c) Jordan Fung Dev. 2014
 
#include <LiquidCrystal.h>
 
LiquidCrystal lcd(12, 11, 10, 7, 6, 5, 4);
int randNumber;
 
void setup()
{
  randomSeed(analogRead(0));
  for(int i=0; i < 1; i++)
  {
    randNumber = random(1,100);
  }
  lcd.begin(16, 2);
  lcd.setCursor(1, 0);
  lcd.print("FairDraw REAL!");
  lcd.setCursor(4, 1);
  lcd.print("~ ");
   lcd.print(randNumber);
    lcd.print(" ~");
}
 
void loop()
{
}
 

Install the Serial Monitor version on to the Arduino Board

Wire Connection Chart:

The Code:

// Fair Draw REAL! Serial Monitor - Random Number Generator
// Copyright (c) Jordan Fung Dev. 2014
 
int randNumber;
 
void setup()
{
  Serial.begin(9600);
  randomSeed(analogRead(0));
  Serial.println();
  Serial.println("Fair Draw REAL! Serial Monitor");
  Serial.println("(Press the Button to Draw another number)");
  Serial.println(" ");
  for(int i=0; i < 1; i++)
  {
    randNumber = random(1,100);
    Serial.println("The Number Generated is: ");
    Serial.print(randNumber);
  }
  Serial.println(" ");
  Serial.println(" ");
  Serial.println("Number Generated Sucessfully!");
  Serial.println(" ");
}
 
void loop()
{
}

 

The Arduino Code File can be downloaded here

Last edited Feb 17, 2014 at 11:59 AM by jordanfung, version 5