Code Monkey home page Code Monkey logo

keypad-led's Introduction

Keyboard & Led

This is a 4x4 keypad that blinks an led several times based on which key has been pressed. Built using an atmega328p, a 4x4 keypad, a resistor and led. The code runs on C.

Getting Started

Basic components required are:

  1. Microcontroller (Atmega 328p-pu)
  2. Crystal for timing operations (16Mhz crystal)
  3. Resistor (10 kilohms)
  4. Power source
  5. Wires (male to female and male to male wires)
  6. A programmer (usbtinyisp or any other)
  7. Board (copper board or bread board)
  8. Wires
  9. Led

Set up the circuit as shown in the figure below

Video Example

A video of the code running

clock counting downwards

Prerequisite

In this case I was using the terminal from linux

Install avr gcc by running the following command

sudo apt-get install gcc-avr binutils-avr avr-libc

Install avrdude by running

sudo apt-get install avrdude

Installing

To upload the code to the chip, one can run these commands:

The following compiles the code to a .obj file

avr-gcc -g -Os -Wall -mcall-prologues -mmcu=atmega328p -fno-exceptions -o main.obj main.c

The following code compiles the code to a .hex file

avr-objcopy -R .eeprom -O ihex main.obj main.hex

The following code uploads the .hex file to the chip (in this case I was using a usbtinyisp)

avrdude -b 19200 -c usbtiny -p m328p -U flash:w:main.hex para gravar no atmega

References

This are the references I used

  1. Patrick Hood Daniel, using a 4x4 keypad https://www.youtube.com/watch?v=6FjrKXmquxU&t=898s

  2. Avr Microcontroller and Embedded Systems The: Using Assembly and C Book by Muhammad Ali Mazidi, Sarmad Naimi, and Sepehr Naimi

keypad-led's People

Contributors

peterokwara avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

mohamedassem93

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.