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
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Soldier : MonoBehaviour {
private GameObject mEnemy;
// Use this for initialization
void Start () {
//Move to the left
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Crosshair : MonoBehaviour {
// Use this for initialization
void Start () {
//hide the mouse cursor
<!doctype html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<!--<script type="text/javascript" src="./jquery311.js"></script> -->
<script type="text/javascript" src="https://github.com/adafruit/io-issues/releases/download/mqttjs/mqtt.js"></script>
<!-- <script type="text/javascript" src="./mqtt.js"></script> -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
/*
Project name:
05 #kidSerie - Adafruit-IO Meets ESP8266, Arduino & MIT App Inventor 2 (Awesome Smart Phone App!)
Flavour IV
Hex File: _05_kidSerie_sketch_04.Adafruit_Forth_Try.ino
Revision History:
20161029:
- from github adafruit/Adafruit_MQTT_Library
https://github.com/adafruit/Adafruit_MQTT_Library/blob/master/examples/mqtt_esp8266/mqtt_esp8266.ino
https://learn.adafruit.com/mqtt-adafruit-io-and-you/intro-to-adafruit-mqtt
// Test program for LED matrix, Simple PONG game
// 8x8 Matrix is connected using a 74HC138 multiplexer
// on PIN 2,3 and 4 controlling the collumns
// The rows are controlled (sourced) by PIN 5-12
//
// In a timer interrupt (timer2, 1kHz) the display routine is
// called, outputting the global imageMem buffer.
//
// one paddle (potentiometer) is connected to Analog input 0
// autoplay can be defined for a static demo.
#include <osa.h>
// Config TIMER2 @ 1 ms (FOSC = 8MHz)
/*
1.000 = P_cycleMachine * Prescaler * Postscale * (PR2 + 1)
1.000 = 0.5us * 4 * 10 * (PR2 + 1) //1:10 Postscaler
PR2 = 49 //Prescaler is 4
*/
#define T2CON_CONST 0B01001101 //Timer2 ON, Prescaler 1:4 e Postscale 1:10
#define PR2_CONST (49) //1us for FOSC
@giljr
giljr / _35_Receiving_Serial_Data_11.ino
Last active October 29, 2017 22:59
J3BCP - Testing arrival bytes - See webpage: https://goo.gl/4zmgGK
/*
J3BCP Testing the bytes that come from Arduino.
Run this code on Arduino Pro Mini
see webpage: https://goo.gl/4zmgGK
*/
char data;
void setup() {
Serial.begin(9600);
@giljr
giljr / _100_J3_Solar_Tracket_Turret_v2.ino
Created October 17, 2017 21:20
J3 Solar Tracker Turret V1.0 / Visit : https://goo.gl/MtRcYe
#include <Servo.h> // include Servo library
Servo horizontal; // horizontal servo
int servoh = 90; // stand horizontal servo
Servo vertical; // vertical servo
int servov = 90; // stand vertical servo
// LDR pin connections
// name = analogpin;
int ldrlt = 0; //LDR top left
int ldrrt = 1; //LDR top rigt
int ldrld = 2; //LDR down left
#include <Wire.h> // I2C library
//-------- REGISTER MAP for ADXL345 chip -----//
#define ACC (0x53) // ADXL345 ACC address
#define POWER_CTL (0x2D) // Power-saving features control
#define DATA_FORMAT (0x31) // Data format control
#define BW_RATE (0x2C) // Data rate and power mode control
#define DATAX0 (0x32) // First address for axis x
#define A_TO_READ (6) // num of bytes we are going to read each time
// two bytes for each axis
#define DIR 2
#define STEP 3
#define BATT A0
#define M0 4
#define M1 5
#define M2 6
#define _TRUE 1
#define _FALSE 0