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
#define DIR 2
#define STEP 3
#define BUTTON A0
#define M0 4
#define M1 5
#define M2 6
int dPause = 100;
#define DIR 2
#define STEP 3
#define BUTTON A0
#define M0 4
#define M1 5
#define M2 6
@giljr
giljr / LCD16_2_Test_01.ino
Created June 17, 2017 20:56
See Webpage:
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
#include <LiquidCrystal.h>
// LiquidCrystal (RS, E, d4, d5, d6, d7)
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // For standalone, non-shield, LCD
int ms1Pin = A0; // Stepstick MS0 to Arduino digital pin 9
int ms2Pin = A1; // Stepstock MS1 to Arduino digital pin 10
int ms3Pin = A2; // Stepstick MS2 to Arduino digital pin 11
int stepPin = A3; // Stepstick STEP pin to Arduino digital pin 12
int dirPin = A4; // Stepstick DIR pin to Arduino digital pin 13
@giljr
giljr / _34_Sensor_ADXL345_Template.ino
Last active June 6, 2017 20:05
Although it is a pseudocode, this works! Page: https://goo.gl/rdL4uY
// ARDUINO six-steps PSEUDOCODE FOR 3-AXIS SENSORS ADXL345
#include <Wire.h>
/*
ADXL345 Datasheet: https://goo.gl/uOZc2b
Table 16. Register Map Address
Hex Dec Name Type Reset_Value Description
0x2D 45 POWER_CTL R/W 00000000 Power-saving features control.
(...)
0x32 50 DATAX0 R 00000000 X-Axis Data 0.
0x33 51 DATAX1 R 00000000 X-Axis Data 1.
/*
Project name: nRF24L0 — Popular RF module using with Arduino ! #arduSerie-33
Studing nRF24L01 radios!
Flavour II - Receiver Radio
Hex File: _33_nRF24L01_SimpleReceiveRadio.ino
Revision History:
Jun, 2017
- Medium webpage:
Description:
This is a simple code to configure a radio transmitter and other receiver
/*
Project name: nRF24L0 — Popular RF module using with Arduino ! #arduSerie-33
Studing nRF24L01 radios!
Flavour I - Transmiter Radio
Hex File: _33_nRF24L01_SimpleTransmitRadio.ino
Revision History:
Jun, 2017
- Medium webpage: https://goo.gl/H8i0rT
Description:
This is a simple code to configure a radio transmitter and other receiver
+------------------------------------+----------------------------------------+---------------------------------------------------------------------------------------------------+
| Transmit | Receive | Informations |
+------------------------------------+----------------------------------------+---------------------------------------------------------------------------------------------------+
| radio.begin(); | radio.begin(); | It activates the modem. |
| radio.setRetries(15, 15); | | It is a multiple of 250 microseconds. 15 * 250 = 3750. |
| So, if the recipient does not receive data,
@giljr
giljr / _32_arduSerie_sketch_02.With_Bluetooth.ino
Created May 14, 2017 18:01
Garages are getting tighter and tighter: page: https://goo.gl/pj20lS
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3); // RX, TX
char data = 0; // Variable for storing
#define trigPin 13
#define echoPin 12
#define stop_LED 11
#define go_LED 10
@giljr
giljr / _32_arduSerie_sketch_01.No_Bluetooth.ino
Created May 14, 2017 17:57
The garages are getting more and more tight: page: https://goo.gl/pj20lS
#define trigPin 13
#define echoPin 12
#define stop_LED 11
#define go_LED 10
void setup() {
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(stop_LED, OUTPUT);