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
/*  — Ardu-Serie#53
Project name: A4988 — Stepper Motor Driver Carrier
Allegro’s A4988 — Bipolar Stepper Motor Driver — 2A@35v peak
*/
#define DIR 2
#define STEP 3
#define M0 4
#define M1 5
@giljr
giljr / _49_TB6612FNG_Lab_02.ino
Created November 3, 2018 21:13
TB6612FNG: Dual DC Motor Driver SparkFun Motor Driver — [email protected] peak — Ardu-Serie#49 https://medium.com/jungletronics/tb6612fng-dual-dc-motor-driver-690abd44465d
//define the two direction logic pins and the speed / PWMA and PWMB pin
const int PWMA = 6; // Front Motor (A)
const int AIN1 = 5;
const int AIN2 = 4;
// Rear Motor (B)
const int PWMB = 3;
const int BIN1 = 2;
const int BIN2 = 1;
@giljr
giljr / _49_TB6612FNG_Lab_01.ino
Created November 3, 2018 19:10
TB6612FNG: Dual DC Motor Driver SparkFun Motor Driver — [email protected] peak — Ardu-Serie#49 https://medium.com/jungletronics/tb6612fng-dual-dc-motor-driver-690abd44465d
const int PWMA = 6;
const int AIN1 = 5;
const int AIN2 = 4;
void setup()
{
//set all pins as output
pinMode(AIN1, OUTPUT);
pinMode(AIN2, OUTPUT);
@giljr
giljr / _52_L298N_DualDriver_02.ino
Created November 1, 2018 20:08
L298N - Dual Full-Bridge Driver Darlington Transistor Arrays Based - 3A@50v peak - Ardu-Serie#52 https://medium.com/p/337321f593ee/edit
/*  
Project name: L298N - Dual Full-Bridge Driver
Darlington Transistor Arrays Based - 3A@50v peak
Flavour II - 2 DC Motors @12v
*/
//Port's Commands Motor A
int IN1 = 4;
int IN2 = 5;
int ENA = 9;
//Port's Commands Motor B
/*  Project name: L298N - Dual Full-Bridge Driver
Darlington Transistor Arrays Based - 3A@50v peak
Flavour I - 1 Motor @5v
*/
#define IN1 6
#define IN2 7
void setup() {
@giljr
giljr / _59_DRV8825_StepperMotor_01.ino
Last active November 7, 2018 20:23
Stepper Motor — Bipolar Mode — 2.5A@45v peak — Ardu_Serie #59 https://medium.com/jungletronics/drv8825-high-current-stepper-motor-driver-carrier-b51eead97fe8
#define DIR 2
#define STEP 3
#define M0 4
#define M1 5
#define M2 6
int dPause = 100;
void setup()
@giljr
giljr / _48_EASYDRIVER_test_motor_01.ino
Created October 29, 2018 19:24
This is the most basic example you can have with an Arduino, an Easy Driver, and a stepper motor;) https://medium.com/jungletronics/easydriver-4-wire-stepper-motor-driver-9f32b233efe6
/* Project Ardu_Serie # 48
EASYDRIVER: 4-Wire-Stepper Motor Driver - Brian Schmalz Design on A3967 IC 
Bi-Polar Motors — .75A@30v peak — Making Using This a Breeze!
Code I
From: Brian Schmalz - Easy Driver Examples - Sample code and projects to get your stepper running!
http://www.schmalzhaus.com/EasyDriver/Examples/EasyDriverExamples.html
Objective: Hi,This is the most basic example you can have with an Arduino,
an Easy Driver, and a stepper motor;)
*/
@giljr
giljr / _44_Tachometer_Reading_Ticks_01.ino
Last active September 14, 2018 01:18
Quick Fun Speed Lab Closed Loop Motion Control — Ardu_Serie#44 https://medium.com/jungletronics/quick-fun-speed-lab-39b0cbc53303
/*
Project name: Quick Fun Speed Lab - Ardu_Serie#44
Simpler experiment -  Closed Loop Motion Control - Small Fan
Flavour I - tachometer: Code From the Book Arduino Internals (file size: ???? bytes)
Hex File: _44_Tachometer_Reading_Ticks_01.ino
*/ // Fun's Connections definition
// In case using bare Arduino: Connect the fun's terminal
// on pins 5, 6 and 7 (SGN to pin 5)
//#define VCC 6 // VCC - FUN'S RED WIRE - POWER SUPPLY BUS
#define SGN 5 // SIGNAL - FUN'S YELLOW WIRE - TACHOMETER
class TMP36 {
private:
// TMP36 variables
float _tempC;
int _reading;
int _tempPin; // = 1;
//custom degree character
byte degree[8] = {
/* Project Ardu_Serie # 45
Working w/ MultiFile Sketch - Part IV - Atmega328p IC - Arduino MC
Ino File: _45_working_w_MultiFile_Sketch_04.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);