Skip to content

Instantly share code, notes, and snippets.

View buildcircuit's full-sized avatar

Sagar Sapkota buildcircuit

View GitHub Profile
@buildcircuit
buildcircuit / gist:2758308
Last active January 30, 2024 01:14
Simple IR sensor using Arduino
/*
IR_remote_tester_and_detector
Connect the output pin of Infrared remote to DIG 2
Connect an LED to pin 13.
*/
#include <IRremote.h>
const int irReceiverPin = 2;
const int ledPin = 13;
IRrecv irrecv(irReceiverPin); //create an IRrecv object
@buildcircuit
buildcircuit / LED CONTROL using Android
Created May 21, 2012 17:27
LED Control using CD4094, Android and Arduino
/* Shift Out Data
Decimal to Binary using Android Emulator
*/
int ledPin=13;
int data = 8;//Connect Pin 8 of Arduino to pin 2 of CD4094 or HEF4794
int strob = 12;//Connect Pin 12 to Pin 1 of CD4094
int clock = 10;//Connect pin 10 of Arduino to pin 3 of CD4094
int oe = 9;//Connect pin 9 of Arduino to pin 15 of CD4094
int count = 0;
const int redPin = 3;
#define FADESPEED 1
void setup() {
Serial.begin(38400);
pinMode(redPin, OUTPUT);
/*
*/
// pins for the LEDs:
const int redPin = 3;
/*const int greenPin = 5;
const int bluePin = 6;*/
/*const int redPin2 = 9;
@buildcircuit
buildcircuit / btexperiment2.ino
Created December 9, 2020 00:16
Bluetooth experiment2
void setup() {
// initialize serial communication:
Serial.begin(38400);// this can be different for your Bluetooth module. It can be 9600 also.
// initialize the LED pins:
for (int thisPin = 2; thisPin < 13; thisPin++) {
pinMode(thisPin, OUTPUT);
}
}
void loop() {
@buildcircuit
buildcircuit / BT-test.ino
Created December 6, 2020 05:29
Sketch for Arduino Bluetooth Controller
void setup() {
// initialize serial communication:
Serial.begin(38400);// this can be different for your Bluetooth module. It can be 9600 also.
// initialize the LED pins:
for (int thisPin = 2; thisPin < 13; thisPin++) {
pinMode(thisPin, OUTPUT);
}
}
void loop() {
@buildcircuit
buildcircuit / ardroid.ino
Created December 6, 2020 05:07
Sketch for Ardroid app
/*
PROJECT: Ardroid
CODED BY: Anurag Goel
PUBLIC Licence Free To Modify
*/
#define START_CMD_CHAR '*'
#define END_CMD_CHAR '#'
#define DIV_CMD_CHAR '|'
#define CMD_DIGITALWRITE 10
@buildcircuit
buildcircuit / 6pinRF test.ino
Created December 5, 2020 04:23
Test 6 ports RF module
/****RF SWITCH WITH ARDUINO*/
// The 4 output ports of RF module are connected to A0-A3
//When the Analog pins receive the signal from the RF module, the Arduino activates the corresponding pin.
//For example, when A0 receives a signal, it will turn on Arduino Pin number D2
int sensorPin0 = A0;
int Pin0 = 2; // pin D2
int sensorValue0 = 0;
@buildcircuit
buildcircuit / RFBT4.ino
Created December 5, 2020 04:03
Bluetooth and RF module Code
/****RF SWITCH WITH ARDUINO*/
// The 4 output ports of RF module are connected to A0-A3
//When the Analog pins receive the signal from the RF module, the Arduino activates the corresponding pin.
//For example, when A0 receives a signal, it will turn on Arduino Pin number D2
int sensorPin0 = A0;
int Pin0 = 2;
int sensorValue0 = 0;
@buildcircuit
buildcircuit / BTmodule.ino
Created December 5, 2020 03:58
Bluetooth-Arduino module from BuildCircuit
void setup() {
// initialize serial communication:
Serial.begin(38400);// this can be different for your Bluetooth module. It can be 9600 also.
// initialize the LED pins:
for (int thisPin = 2; thisPin < 13; thisPin++) {
pinMode(thisPin, OUTPUT);
}
}
void loop() {