Giter Club home page Giter Club logo

avr-essential's Introduction

avr-essential

Essential functions to get started with programming an AVR ATmega MCU

How to use?

  • Create a new file like main.c
  • Include essential.c
  • In the main.c create the main function and start programming

What is included in essential.c?

  • USART
  • SPI
  • ADC
  • more functionalities will be added regularly.

Usage

USART

  • To initialize USART use USARTinit(uint16_t ubrr_value). For various ubrr_value visit this site or check the datasheet.
  • Read a character using USARTReadChar().
  • Write a character using USARTWriteChar(char data).
  • Read a string using USARTReadString(int si). Where int si is the size of the string to read.
  • Send a string using USARTSendString(char s[]). Where char s[] is the string to be sent.

SPI

  • To initilize Master use initMasterSPI().
  • To initilize Slave use initSlaveSPI().
  • To transmit data in Master mode use transmitMaster(unsigned char data).
  • To receive data in Slave mode use receiveSlave().

ADC

  • To initilize ADC use initADC().
  • To read the input voltage use readADC(uint8_t ch). Where uint8_t ch is the channel.

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.