Instantly share code, notes, and snippets.

Sagar Sapkota buildcircuit

View GitHub Profile
View esp8266-led-blink.ino
View RGB-SMD-LED.ino
/* ---------------------------------------------------------
* | 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
View TTP226.ino
/*arduino touch 8
VCC-----------5V
GND-----------GND
OUT1-----------2
OUT2-----------3
OUT3-----------4
OUT4-----------5
OUT5-----------6
OUT6-----------7
OUT7-----------8
View rgb-led.ino
/* 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
View adxl335.ino
//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;
View adxl335
//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;
View adxl345.ino
//Add the SPI library so we can communicate with the ADXL345 sensor
#include <SPI.h>
//Assign the Chip Select signal to pin 10.
int CS=10;
//This is a list of some of the registers available on the ADXL345.
//To learn more about these and the rest of the registers on the ADXL345, read the datasheet!
char POWER_CTL = 0x2D; //Power Control Register
View line-follower.ino
int sensor1 = A0; //connected to analog 0
void setup()
{
Serial.begin(9600);
}
void loop() {int sensor1pin = analogRead(sensor1);
Serial.print("sensor1:");
Serial.println(sensor1pin);
delay(2000);
View temperature-sensor.ino
const int sensorDOPin = 2; // connect DO pin to pin 2 of Arduino
const int ledPin = 13; // the number of the LED pin
// variables will change:
int SensorState = 0; // variable for the state of the sensor
void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the sensor pin DO as input
View Active buzzer test
int buzzer=8;// Set the control the buzzer digital IO pin
void setup()
{
pinMode(buzzer,OUTPUT);// Setting the digital IO pin mode , OUTPUT is Wen out
}
void loop()
{
unsigned char i,j;// Define the variable
while(1)
{