Posts

Showing posts from 2014

Multiplication Trainer

Image
Multiplication Trainer I designed a simple code so that my son could memorize his tables. This code generates random numbers between 2 and 12 and asks for the product of the 2 numbers. You need to enter the answer and then press the # key. If you answer correctly it will display a message with the correct answer for 3 seconds and then move on to asking a new question. If you answer incorrectly, it will display an appropriate message with the correct answer for 5 seconds and move on to asking the next question. It also displays the date, time, temperature and humidity when you press the * key for 10 seconds.  Below are some images -  Code -   #include <dht.h> #include <Wire.h> #include <LCD.h> #include "RTClib.h" #include <LiquidCrystal_I2C.h> #include <Keypad.h> LiquidCrystal_I2C lcd(0x20, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Addr, En, Rw, Rs, d4, d5, d6, d7, backlighpin, polarity RTC_DS1307 RTC; #de

Temperature and Humidity sensor using Arduino display on I2C 16X2 LCD

Image
Temperature and Humidity sensor using Arduino display on I2C 16X2 LCD Library download link -  https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads NOTE: Some of this type board come with the A0 A1 A2 connections (See photo) that are NOT bridged with solder as in the photo. Those will have address 0x27 not address 0x20. For that version you need to change the sketch example below. LiquidCrystal_I2C lcd(0x20, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); MUST BE CHANGED TO: LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); Completed project Schematics A quick video Code -  #include <dht.h> #include <Wire.h> #include <LCD.h> #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x20, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Addr, En, Rw, Rs, d4, d5, d6, d7, backlighpin, polarity #define dht_dpin A0 //no ; here. Set equal to channel sensor is on dht DHT; void setup(){   Serial.begin(9600

Simple LED memory game using Arduino

Image
Simple LED memory game - (also known as Repeat after me!) LEDs light up with corresponding musical notes in a randomized sequence. Press the buttons in the same sequence to win a round. Starting difficulty level is configurable, as is the number of rounds you win before the difficulty level increases. Credits - tim.id.au/arduino/ Image of the completed project Schematics Video of the game  The Code - /*   "That memory game" - "Simon" clone using an Arduino kit   LEDs light up with corresponding musical notes in a randomised sequence. Press the   buttons in the same sequence to win a round. Starting difficulty level is configurable, as is the number   of rounds you win before the difficulty level increases.   tim.id.au/arduino/   30/11/2013 */ // Digital pin definitions int leds[] = {10, 9, 8, 7}; // digital pins for green LEDs 1-4 and red LED int led = 11; int buttons[] = {6, 5, 4, 3}; // digital pins for buttons