Sinhala Arduino Tutorial | How to control rgb led colors with bluetooth and ir 1) Arduino program - char p; #include <IRremote.h> IRrecv Piusha(A2); decode_results results; #define redPin 6 #define greenPin 3 #define bluePin 5 void setup() { digitalWrite(6,HIGH); digitalWrite(3,HIGH); digitalWrite(5,HIGH); Serial.begin(9600); Piusha.enableIRIn(); pinMode(redPin, OUTPUT); pinMode(greenPin, OUTPUT); pinMode(bluePin, OUTPUT); } void loop() { if (Piusha.decode(&results)) { Serial.println(results.value, DEC); Piusha.resume(); } delay(100); long val = results.value; if (Piusha.decode(&results)) { Serial.println(results.value, DEC); Piusha.resume(); } if (val ==16195807) { digitalWrite(6,LOW);//red col...
Posts
Showing posts from 2021
NodeMcu Sinhalen - Install Drivers & Setup Arduino IDE for Programming s...
- Get link
- X
- Other Apps
- Get link
- X
- Other Apps
NodeMCU Sinhalen 02 – Install Drivers & Setup Arduino IDE for Programming අද වීඩියෝ එකෙන් බලන්න හදන්නේ Nodemcu Board එකට අවශ්ය Drivers Install කරගන්න විදිය සහ Arduino IDE එකේ කරගන්න ඕනෙ වෙනස් කම් ටික. මේ Video එක බලලා ඔයාලගේ අදහස් Comment කරන්න Subscribe කරන්න Like කරන්න Share කරන්න Board Manager Url = http://arduino.esp8266.com/stable/package_esp8266com_index.json CP210x Drivers – https://www.silabs.com/products/mcu/Pages/USBtoUARTBridgeVCPDrivers.aspx
- Get link
- X
- Other Apps
Sinhala Arduino Tutorial 06| IR Sensor programs- IR readings code- #include <IRremote.h> IRrecv Piusha(A2); decode_results results; void setup() { Serial.begin(9600); Piusha.enableIRIn(); } void loop() { if (Piusha.decode(&results)) { Serial.println(results.value, DEC); Piusha.resume(); } delay(100); long val = results.value; } IR led on program- #include <IRremote.h> IRrecv Piusha(A2); decode_results results; void setup() { Serial.begin(9600); Piusha.enableIRIn(); pinMode(12,OUTPUT); } void loop() { if (Piusha.decode(&results)) { Serial.println(results.value, DEC); Piusha.resume(); } delay(100); long val = results.value; if (val ==16769310) { digitalWrite(12,HIGH); delay(500); ...
- Get link
- X
- Other Apps
Sinhala Arduino | How to make obstacle avoiding car using arduino & l298n motor driver H-Bridge Diagram - code- #include <Servo.h> //Servo motor library. This is standard library #include <NewPing.h> //Ultrasonic sensor function library. You must install this library //our L298N control pins const int LeftMotorForward = 4; const int LeftMotorBackward = 5; const int RightMotorForward = 6; const int RightMotorBackward = 7; //sensor pins #define trig_pin 2 #define echo_pin 3 #define maximum_distance 200 boolean goesForward = false; int distance = 100; NewPing sonar(trig_pin, echo_pin, maximum_distance); //sensor function Servo servo_motor; //our servo name void setup(){ pinMode(RightMotorForward, OUTPUT); pinMode(LeftMotorForward, OUTPUT); pinMode(LeftMotorBackward, OUTPUT); pinMode(RightMotorBackward, OUTPUT); servo_motor.a...
- Get link
- X
- Other Apps
Smart light system Diagram - Code- char p ; #include <IRremote.h> IRrecv Piusha ( A1 ); decode_results results ; void setup () { Piusha . enableIRIn (); pinMode ( 9 , OUTPUT ); Serial . begin ( 9600 ); } void loop () { if ( Piusha . decode ( & results )) { Serial . println ( results . value , DEC ); Piusha . resume (); } delay ( 100 ); long val = results . value ; if ( val == 16769310 ) { digitalWrite ( 9 , HIGH ); delay ( 500 ); } if ( val == 16736670 ) { digitalWrite ( 9 , LOW ); delay ( 500 ); } if ( Serial . available ()){ p = Serial . read (); Serial . println ( p ); } if ( p == '1' ){ digitalWrite ( 9 , HIGH ); } else if ( p == '2' ){ digitalWrite ( 9 , LOW ); } ...
- Get link
- X
- Other Apps
Sinhala Arduino|Automatic hand Sanitizer code- #include<Servo.h> Servo myservo; #define trigPin 3 #define echoPin 2 void setup() { Serial.begin(9600); pinMode( trigPin,OUTPUT); pinMode( echoPin,INPUT); myservo.attach(9); } void loop() { digitalWrite(trigPin,LOW); delayMicroseconds(2); digitalWrite(trigPin,HIGH); delayMicroseconds(10); digitalWrite(trigPin,LOW); long p = pulseIn(echoPin,HIGH); long inches =p / 74 /2; long cm = p / 29 /2; if(cm<10){ myservo.write(90); } else { myservo.write(0); } delay(500); }
- Get link
- X
- Other Apps
Sinhala Arduino Tutorial 10|Soil Sensor Module 1st code- int soil = A1; //connect soil to A0 int value= 0; //define value 0 void setup() { pinMode(soil,INPUT); Serial.begin(9600); //this is not necessary-but to show value to pc } void loop() { value = analogRead(soil ); //read value-analog from A0 Serial.println(value); delay(100); } 2nd code- int soil =A1; int value=0; int led=13; void setup() { pinMode(soil,INPUT); pinMode(led,OUTPUT); Serial.begin(9600); //this is not necessary-but to show value to pc } void loop() { value = analogRead(soil ); //read value-analog from A0 Serial.println(value); delay(100); if(val>340){ digitalWrite(led,HIGH); } if(val>930){ digitalWrite(led,LOW); } delay(100); }