Skip to content

Instantly share code, notes, and snippets.

View buildcircuit's full-sized avatar

Sagar Sapkota buildcircuit

View GitHub Profile
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(13, 12, 10, 9, 8, 7);
int led = 11; // the PWM pin the LED is attached to
int brightness = 0; // how bright the LED is
int fadeAmount = 5; // how many points to fade the LED by
@buildcircuit
buildcircuit / blink_LCD.ino
Created July 2, 2020 10:09
Blink 5mm LED on the LCD Shield
@buildcircuit
buildcircuit / cd4029_ldr.ino
Created June 30, 2020 13:25
CD4029 up and down counter module responding to sensor
int sensorPin = A0; // select the input pin for the photoresistor
int CLK = 13; // Pin 13 of Arduino gives pulse to CD4029 module
int sensorValue = 0; // variable to store the value coming from the sensor
int RESET=11; // connect to reset pin of CD4029
int UD=12; // connect to UD pin of CD4029
void setup() {
Serial.begin(9600);
@buildcircuit
buildcircuit / cd4029.ino
Last active June 30, 2020 12:58
CD4029 up and down counter
// Basic test of CD4029 up and down counter module
// Module designed by Sagar Sapkota from www.buildcircuit.net
void setup() {
pinMode(13, OUTPUT);// Connect pin 13 to CLK pinl
pinMode(12,OUTPUT); // Connect pin 12 to UD
//RESET THE COUNTER
// Connect Pin 11 of Arduino to RST Pin
pinMode(11,OUTPUT);
digitalWrite(11,HIGH);
@buildcircuit
buildcircuit / esp8266-led-blink.ino
Created October 29, 2015 21:26
ESP8266 LED Blink Project
@buildcircuit
buildcircuit / RGB-SMD-LED.ino
Created October 20, 2015 22:11
RGB-SMD-LED-5050
/* ---------------------------------------------------------
* | Experimentation Kit for Arduino Example Code |
* | CIRC-RGB .: Colourful Light :. (RGB LED) |
* ---------------------------------------------------------
*
* We've blinked an LED and controlled eight in sequence now it's time to
* control colour. Using an RGB LED (actual 3 LEDs in a single housing)
* we can generate any colour our heart desires.
*
* (we'll also use a few programming shortcuts to make the code
/*arduino touch 8
VCC-----------5V
GND-----------GND
OUT1-----------2
OUT2-----------3
OUT3-----------4
OUT4-----------5
OUT5-----------6
OUT6-----------7
OUT7-----------8
@buildcircuit
buildcircuit / rgb-led.ino
Created September 3, 2015 04:30
RGB LED
/* FILE: ARD_RGB_LED_MODULE_HCARDU0021_Example.pde
DATE: 04/07/12
VERSION: 0.1
This is a simple example of how to use the HobbyComponents RGB LED module
(HCARDU0021). The module has 3 separate LED's (Red, Green & Blue) which
Can be individually driven by applying a voltage to the appropriate module pin.
This example uses the standard Arduino analogWrite (PWM) function to cycle
through the full range of colours this module is capable of producing.
Please be aware that this module does NOT include current limiting
//Analog read pins
const int xPin = 0;
const int yPin = 1;
const int zPin = 2;
//The minimum and maximum values that came from
//the accelerometer while standing still
//You very well may need to change these
int minVal =270;
int maxVal =440;
@buildcircuit
buildcircuit / adxl335
Created September 2, 2015 01:37
adxl335 accelerometer
//Analog read pins
const int xPin = 0;
const int yPin = 1;
const int zPin = 2;
//The minimum and maximum values that came from
//the accelerometer while standing still
//You very well may need to change these
int minVal =270;
int maxVal =440;