Posts

Object avoiding robot car

Image
//hrrobotics Object avoiding robot car int trigPin = 9; //sensor pin int echoPin = 8; int revleft4 = 10; // Motor Pins int fwdleft5 = 11; int revright6 = 12; int fwdright7 = 13; long duration, distance; void setup() { Serial.begin(9600); pinMode(revleft4, OUTPUT); // Set Motor Pins As Output pinMode(fwdleft5, OUTPUT); pinMode(revright6, OUTPUT); pinMode(fwdright7, OUTPUT); pinMode(trigPin, OUTPUT); // Set Trig Pin As O/P To Transmit Waves pinMode(echoPin, INPUT); //Set Echo Pin As I/P To Recieve Reflected Waves } void loop() { digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); // Transmit Waves For 10us delayMicroseconds(10); duration = pulseIn(echoPin, HIGH); // Recieve Reflected Waves distance = duration / 58.2; // Get Distance delay(10); if (distance > 30) // Condition For Absence Of Obstacle { digitalWrite(fwdright7, HIGH); // Move Forward digitalWrite(revright6, LOW); digitalWrite(

Reed sensor working and program with Aurdino

Image
void setup(){ pinMode(13,OUTPUT); pinMode(3,INPUT); Serial.begin(9600);}void loop(){ if (digitalRead(3)== HIGH) { digitalWrite(13,LOW); } else { digitalWrite(13,HIGH); } }

Clap switch code

Image
int sound_sensor = A0; int relay = 13; int clap = 0; long detection_range_start = 0; long detection_range = 0; boolean status_lights = false; void setup() { pinMode(sound_sensor, INPUT); pinMode(relay, OUTPUT); } void loop() { int status_sensor = digitalRead(sound_sensor); if (status_sensor == 0) { if (clap == 0) { detection_range_start = detection_range = millis(); clap++; } else if (clap > 0 && millis()-detection_range >= 50) { detection_range = millis(); clap++; } } if (millis()-detection_range_start >= 400) { if (clap == 2 ) { if (!status_lights) { status_lights = true; digitalWrite(relay, HIGH); } else if (status_lights) { status_lights = false; digitalWrite(relay, LOW); } } clap = 0; } }

Display clock,aurdino clock

Image

Powerbank module,pocket powerbank,hr robotics

Image
material needs 1.powerbank module 2.2000mah lithium ion cell 3.pvc pipe

12 channel chaser light

Image
#define t 30 #define t1 20 #define t2 100 #define t3 50 void setup() { // set up pins 2 to 13 as outputs for (int i = 2; i <= 13; i++) { pinMode(i, OUTPUT); } } /////////////////////////////////////////////////////////////////////////////////Effect 1 void loop(){ effect_1(); effect_1(); effect_2(); effect_2(); effect_3(); effect_3(); effect_4(); effect_4(); effect_5(); effect_5(); effect_6(); effect_6(); effect_7(); effect_7(); } //left to right and right to left void effect_1() { for(int i=2; i<14; i++){ digitalWrite(i, HIGH); delay(t1); digitalWrite(i+1, HIGH); delay(t1); digitalWrite(i+2, HIGH); delay(t1); digitalWrite(i, LOW); delay(t1); digitalWrite(i+1, LOW); delay(t1); } for(int i=13; i>1; i--){ digitalWrite(i, HIGH); delay(t1); digitalWrite(i-1, HIGH); delay(t1); digitalWrite(i-2, HIGH); delay(t1); digitalWrite(i, LOW); delay(t1); digitalWrite(i-1, LOW); delay(t1); } } //////////////////////////////////////////////////////////////

5 channel chaser light

Image
int m1a = 9; int m2a = 10; int m1b = 11; int m2b = 12; int m1c = 13; char val; void setup () { pinMode(m1a,OUTPUT); pinMode(m2a,OUTPUT); pinMode(m1b,OUTPUT); pinMode(m2b,OUTPUT); pinMode(m1c,OUTPUT); } void loop () { digitalWrite(m1a,HIGH); delay(100); digitalWrite(m1a,LOW); digitalWrite(m2a,HIGH); delay(100); digitalWrite(m2a,LOW); digitalWrite(m1b,HIGH); delay(100); digitalWrite(m1b,LOW); digitalWrite(m2b,HIGH); delay(100); digitalWrite(m2b,LOW); digitalWrite(m1c,HIGH); delay(100); digitalWrite(m1c,LOW); }