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
#include <LED.h>
LED led(13); // assign digital pin 13 to an LED
void setup() {
}
void loop() {
led.toggle();
if (led.state()) {
delay(1000);
} else {
#include <LED.h>
LED led(13); // assign digital pin 13 to an LED
void setup() {
}
void loop() {
led.on();
// LED.cpp - Example library to manipulate LEDs - public domain
#include "LED.h"
// the constructor
LED::LED(byte pin) {
_pin = pin; // save the pin number
pinMode(pin, OUTPUT); // configure pin as output
}
// the public methods
// LED.h - Example library for manipulating LEDs - public domain
#ifndef LED_h
#define LED_h
#if ARDUINO < 100
#include <WProgram.h>
#else
#include <Arduino.h>
#endif
@giljr
giljr / Avr_Arduino_Ep_04_InterruptRoutine.c
Created May 28, 2018 20:31
Episode #04- Interrupt Routine -Atmel Studio 7 & UNO Serie (Ep#00) @giljrE https://medium.com/series/atmel-studio-7-uno-ep-00-969b9cc3cf7b
#define F_CPU 16000000UL /* 16MHz Frequency Working Arduino UNO Clock */
#include <avr/io.h>
#include <util/delay.h> /* Include a AVR LibC functions*/
#include <avr/interrupt.h> /* this is the new library needed */
/* Defining the basics macros*/
#define LedOn PORTB |= (1<<PORTB0)
#define LedOff PORTB &= ~(1<<PORTB0)
#define LedToggle PINB |= (1<<PINB0)
#define SWITCH_PRESSED !(PIND & (1<<PIND7))
#define F_CPU 16000000UL /* 16MHz Frequency Working Arduino UNO Clock */
#include <avr/io.h>
#include <util/delay.h> /* Include a AVR LibC functions*/
/* Defining the basics macros*/
#define LedOn PORTB |= (1<<PORTB0)
#define LedOff PORTB &= ~(1<<PORTB0)
#define LedToggle PINB |= (1<<PINB0)
#define F_CPU 16000000UL /* 16MHz Frequency Working Arduino UNO Clock */
#include <avr/io.h>
#include <util/delay.h> /* Include a AVR LibC functions*/
int main(void)
{
/* PORTB Data Register - DS pg 92 */
DDRB |= (1<<DDB5);
@giljr
giljr / AgentControl.cs
Created May 5, 2018 21:44
Adventure Game Tutorial
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;
public class AgentControl : MonoBehaviour {
public Transform home;
NavMeshAgent agent;
@giljr
giljr / TheSimplestCoroutine.cs
Created May 5, 2018 21:10
Unity AdventureGame Totorial
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TheSimplestCoroutine : MonoBehaviour
{
void Start ()
{
string[] messages = { "Welcome", "to", "this", "amazing", "game!" };
@giljr
giljr / playerMovement.cs
Created April 30, 2018 23:32
See Tutorial Unity AdventureGame
using UnityEngine;
using UnityEngine.EventSystems;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.AI;
public class PlayerMovement : MonoBehaviour {
public Animator animator;
public NavMeshAgent agent;