Skip to content

Instantly share code, notes, and snippets.

View giljr's full-sized avatar
💭
Full Stack Developer with a degree in Computer Engineering.

Gilberto Oliveira Jr giljr

💭
Full Stack Developer with a degree in Computer Engineering.
View GitHub Profile
class PIR {
private:
int _ledPin;
int _pirPin;
int _pirState;
public:
/* Project Ardu_Serie # 45
Working w/ MultiFile Sketch - Part III - Atmega328p IC - Arduino MC
Ino File: _45_working_w_MultiFile_Sketch_03.ino
*/
#include <LiquidCrystal.h>
#include <DFR_LCD_Keypad.h> //Sample using https://www.dfrobot.com library
// select the pins used on the LCD panel
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
class HC_SR04 {
private:
int _trigPin; // HC-04 variables
int _echoPin;
long _duration;
int _distanceCm;
/* Project Ardu_Serie # 45
Working w/ MultiFile Sketch - Part II - Atmega328p IC - Arduino MC
Ino File: _45_working_w_MultiFile_Sketch_02.ino
*/
#include <LiquidCrystal.h>
#include <DFR_LCD_Keypad.h> //Sample using https://www.dfrobot.com library
// select the pins used on the LCD panel
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
/* Project Ardu_Serie # 45
Working w/ MultiFile Sketch - Part I - Atmega328p IC - Arduino MC
Ino File: _45_working_w_MultiFile_Sketch_01.ino
*/
#include <LiquidCrystal.h>
#include <DFR_LCD_Keypad.h> //Sample using https://www.dfrobot.com library
// select the pins used on the LCD panel
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
/* Project Ardu_Serie # 43
* Working w/CTC Mode Part I - Atmega328p IC - Arduino MC
*
* C File: _43_working_w_CTC_01.c
*
* Use: TIMER2
*
* Objective: We need to flash an LED every 100 ms (10 Hertz).
*
* Instructions:
@giljr
giljr / working_w_CTC_w_INTERRUPTION_w_OCRnx.c
Last active August 26, 2018 18:25
working_w_CTC_w_INTERRUPTION_w_OCRnx.c https://youtu.be/Umo5PFym7wM
/* Project Ardu_Serie # 43
* Working w/CTC w/Interruption w/ OCnx Toggle Pin Mode Part III - Atmega328p IC - Arduino MC
*
* Use: TIMER2
*
* Objective: We need to flash an LED every 100 ms (10 Hertz).
* Using Interruption instead of polling technique!
* Getting hid of ISR Method! Use OCnx PIN (Toggle mode)
*/
#include <avr/io.h>
/* Project Ardu_Serie # 43
* Working w/CTC w/Interruption Mode Part II - Atmega328p IC - Arduino MC
*
* Use: TIMER2
*
* Objective: We need to flash an LED every 100 ms (10 Hertz).
* Using Interruption instead of polling technique!
*/
#include <avr/io.h>
#include <avr/interrupt.h> // 1ª Modification: include int library
@giljr
giljr / gist:04e3cb51ab44a97bc13e0061659937d4
Last active August 25, 2018 02:28
_43_CTC_AtmelStudio7_Code.c
/* Project Ardu_Serie # 43
* Working w/CTC Mode Part I - Atmega328p IC - Arduino MC
*
* Use: TIMER2
*
* Objective: We need to flash an LED every 100 ms (10 Hertz).
*/
#include <avr/io.h>
#######################################
# Syntax Coloring Map For LED
#######################################
#######################################
# Datatypes (KEYWORD1)
#######################################
LED KEYWORD1