Skip to content

Instantly share code, notes, and snippets.

View RAMESHNOOTHI's full-sized avatar

NOOTHI RAMESH RAMESHNOOTHI

  • L&T Technology Services Limited
  • Banglore
View GitHub Profile
@RAMESHNOOTHI
RAMESHNOOTHI / adc_example.c
Created January 22, 2021 10:23 — forked from Wollw/adc_example.c
ATmega328P ADC conversion example
/* A simple ADC example that checks the analog reading on ADC0 and turns
* an LED on if the reading is higher than a threshold value and turns if
* off if it is under that value. */
#include <avr/io.h>
#include <stdint.h>
/* Which analog pin we want to read from. The pins are labeled "ADC0"
* "ADC1" etc on the pinout in the data sheet. In this case ADC_PIN
* being 0 means we want to use ADC0. On the ATmega328P this is also
* the same as pin PC0 */
@RAMESHNOOTHI
RAMESHNOOTHI / main.c
Created January 22, 2021 10:22 — forked from Wollw/main.c
#include <stdio.h>
#include "serial.h"
#include <avr/pgmspace.h>
int main(void) {
serial_init(19200);
int i;
char buffer[8];