Skip to content

Instantly share code, notes, and snippets.

View Gunisalvo's full-sized avatar

Rodrigo "Gunisalvo" Leite Gunisalvo

  • Entrementes
  • Rio de Janeiro
View GitHub Profile
@Gunisalvo
Gunisalvo / pushButton.ino
Created August 24, 2015 18:07
Arduino Push Button
int portaEscrita = 7;
int portaLeituraA = 4;
int portaLeituraB = 2;
int pressionadoA = 1;
int pressionadoB = 1;
void setup() {
pinMode(portaEscrita, OUTPUT);
pinMode(portaLeituraA, INPUT_PULLUP);
@Gunisalvo
Gunisalvo / alarmeLuminosidade.ino
Created August 24, 2015 18:52
Alarme com photoresistor
int leitorLuminosidade = A1;
int sirene = 2;
int luminosidade = 0;
void setup() {
Serial.begin(9600);
pinMode(sirene,OUTPUT);
}
void loop() {
@Gunisalvo
Gunisalvo / ServoPotenciometro.ino
Created August 25, 2015 12:02
Servo + Potenciometro
#include <Servo.h>
Servo servo;
int potenciometro = A1;
int leitura;
void setup()
{
servo.attach(9);
Serial.begin(9600);
@Gunisalvo
Gunisalvo / Pullup.ino
Created August 28, 2015 14:54
inicioPullUp
int ledVerde = 7;
int botaoVerde = 5;
int estadoVerde;
void setup() {
pinMode(ledVerde,OUTPUT);
pinMode(botaoVerde,INPUT);
Serial.begin(9600);
#define TAMANHO_MAXIMO_DO_SEGREDO 4
#define REPETICOES_ESTADO_FINAL 3
#define TEMPO_LUZ 1000
#define TEMPO_PAUSA 500
#define BOTAO_VERDE 8
#define BOTAO_AMARELO 9
#define BOTAO_VERMELHO 10
#define BOTAO_AZUL 11
#include <EEPROM.h>
int acumulador = 0;
static int acumulador2 = 0;
int acumulador3;
int enderecoEEPROM = 0;
void setup() {
Serial.begin(9600);
#define TAMANHO_MAXIMO_DO_SEGREDO 4
#define REPETICOES_ESTADO_FINAL 3
#define TEMPO_LUZ 1000
#define TEMPO_PAUSA 500
#define ledVerde 2
#define ledAmarelo 3
#define ledVermelho 4
#define ledBranco 5
@Gunisalvo
Gunisalvo / week_02.tf
Created June 7, 2018 15:17
UoL: Cloud Computing week 2
provider "aws" {
region = "us-east-2"
}
resource "aws_security_group" "uol_security" {
name = "CKIT523-Group-[REPLACE WITH YOUR NAME]" #fixme!
description = "Uol Security"
ingress {
@Gunisalvo
Gunisalvo / SensibleApproach.java
Created June 15, 2018 16:03
Concurrency Patterns
import java.util.*;
import java.util.concurrent.*;
public class SensibleApproach {
private static long SIMULATION_TIME = 5000L;
public static void main(String[] args) throws InterruptedException {
UnsafeBuffer guinea = new UnsafeBuffer(10);
@Gunisalvo
Gunisalvo / week_03.tf
Created June 19, 2018 10:26
UoL: Cloud Computing week 3 (storage)
variable "student_name" {
default = "STUDENT_NAME" #fix me!
}
variable "region" {
default = "us-east-2"
}
provider "aws" {
region = "${var.region}"