Skip to content

Instantly share code, notes, and snippets.

View OsoianMarcel's full-sized avatar
💭
I may be slow to respond.

Osoian Marcel OsoianMarcel

💭
I may be slow to respond.
View GitHub Profile
@OsoianMarcel
OsoianMarcel / Basic_Queue_Example.c
Last active December 26, 2021 12:58
A basic example of queue written in C (Arduino)
// 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 January 22, 2021 17:25
Basic Example - How to use Ultrasonic SR04 distance sensor with Atmega8 and Timer0 (8Mhz)
// 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>