Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Osoian Marcel OsoianMarcel

🏠
Working from home
View GitHub Profile
@OsoianMarcel
OsoianMarcel / Basic_Queue_Example.c
Last active Dec 26, 2021
A basic example of queue written in C (Arduino)
View Basic_Queue_Example.c
// A basic example of queue written in C
// Useful for small microcontrollers
// Tags: Arduino | Atmega | AVR | STM32
#include <stdio.h>
#include <stdint.h>
// Maximum number of items in queue
#define QUEUE_MAX 5
@OsoianMarcel
OsoianMarcel / Ultrasonic_SR04_Atmega8_8Mhz_Timer0_Basic_Example.c
Last active Jan 22, 2021
Basic Example - How to use Ultrasonic SR04 distance sensor with Atmega8 and Timer0 (8Mhz)
View Ultrasonic_SR04_Atmega8_8Mhz_Timer0_Basic_Example.c
// Notice: 8 Mhz frequency is expected
#define SONIC_DDR DDRC
#define SONIC_PORT PORTC
#define SONIC_PIN PINC
#define SONIC_TRG_PIN PINC0
#define SONIC_ECHO_PIN PINC1
#include <avr/io.h>
#include <util/delay.h>