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
@giljr
giljr / _28_arduSerie_pong_game_00.ino
Created March 23, 2017 22:28
Here is a minimal common code for Ping-Pong Game for Arduino - part 1/3
int n; // display row counter
void setup() {
for (int z = 2; z < 14; z++) {
pinMode(z, OUTPUT); // all pins output for driving the LED matrix
}
//digitalWrite(5, HIGH); // all pins output for driving the LED matrix
//digitalWrite(12, HIGH); // all pins output for driving the LED matrix
byte imageMem[8] = { // display buffer
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
float speed_x = 1; // ball variables: speed & positions(pos_x/pos_y)
float speed_y = 0.5; // transversal speed (y axis)
float pos_x = 0; // ball position in axis
float pos_y = 4; // Range for the complete paddle bat design from 1 up to 6
float paddle_l, paddle_r; // paddle positions
int n; // display row counter
void setup() {
@giljr
giljr / _28_arduSerie_pong_game_03.ino
Last active March 23, 2017 23:14
Ping_Pong Game - Final & Complete Version - Visit Jungletronics: https://goo.gl/ON9NIr
#define AUTOPLAY true
byte imageMem[8] = { // display buffer
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
float speed_x = 1; // ball variables: speed & positions(pos_x/pos_y)
float speed_y = 0.5; // transversal speed (y axis)
float pos_x = 0; // ball position in axis
float pos_y = 4; // Range for the complete paddle bat design from 1 up to 6
float paddle_l, paddle_r; // paddle positions
int n; // display row counter
#include <FlexiTimer2.h> // use timer for sampling to get even time base for data
#define INVERTED_INPUT_PIN 10
const int READ_PWM_PIN = A0;
const int READ_FILTERED_PIN = A1;
const int READ_DIGITAL_PIN = 8;
int inverted_value = 0;
void setup() {
#include <FlexiTimer2.h> // use timer for sampling to get even time base for data
const int READ_SINE_PIN = A0;
const int READ_OUTPUT_PIN = A1;
int inverted_value = 0;
void setup() {
Serial.begin(115200); // initialize serial communications (to match that used by PlotNValues.pde)
@giljr
giljr / _29_Blink_Flash_ATTINY85.ino
Last active April 15, 2017 00:51
Here https://goo.gl/mh6TgX, I summarized everything for you in 10 steps and less than 10 minutes away...
const int Red = 0;
const int Green = 1;
const int Blue = 2;
volatile uint8_t* Port[] = {&OCR0A, &OCR0B, &OCR1B};
void setup() {
DDRB |= (1 << DDB4) | (1 << DDB1) | (1 << DDB0);
#include <FlexiTimer2.h> // use timer for sampling to get even time base for data
const int READ_A0_PIN = A0;
const int READ_A1_PIN = A1;
const int READ_A2_PIN = A2;
int inverted_value = 0;
/*
Project name:
04 #kidSerie - Arduino + HC06 + MIT App Inventor 2 + Sliding
Leds (see details also in video below!)
Flavour I -
Hex File: _04_kidSerie_sketch_01_bluetooth_SlidingLeds.ino
Revision History:
20161020:
- board found on youtube https://youtu.be/8CjL5JB6YfI
Description:
/*
Project name:
ABC Project: Arduino, Bluetooth and Compass V1.0 - 24 #arduSerie
(ABC project - Arduino, Bluetooth and Compass Project!!!)
Flavour III - Final Result
Hex File: _24_arduSerie_Arduino_Bluetooth_Compass.ino
Revision History:
20161231:
- from How To Make a Compass using Arduino and Processing IDE
by Dejan Nedelkovski