Change Brightness & Contrast of a video (OpenCV C++)
Motion Detector Using Arduino
The arduino code is shown in below.
========================================================================
/* PIR sensor tester*/
int ledPin = 2; // choose the pin for the LED
int inputPin = 3; // choose the input pin (for PIR sensor)
int pirState = LOW; // we start, assuming no motion detected
int val = 0; // variable for reading the pin status
void setup() {
pinMode(ledPin, OUTPUT); // declare LED as output
pinMode(inputPin, INPUT); // declare sensor as input
Serial.begin(9600);
}
void loop(){
val = digitalRead(inputPin); // read input value
if (val == HIGH) { // check if the input is HIGH
digitalWrite(ledPin, HIGH); // turn LED ON
if (pirState == LOW) {
// we have just turned on
Serial.println("Motion detected!");
// We only want to print on the output change, not state
pirState = HIGH;
}
} else {
digitalWrite(ledPin, LOW); // turn LED OFF
if (pirState == HIGH){
// we have just turned of
Serial.println("Motion ended!");
// We only want to print on the output change, not state
pirState = LOW;
}
}
}
========================================================================
The video demo is shown in below.
========================================================================
/* PIR sensor tester*/
int ledPin = 2; // choose the pin for the LED
int inputPin = 3; // choose the input pin (for PIR sensor)
int pirState = LOW; // we start, assuming no motion detected
int val = 0; // variable for reading the pin status
void setup() {
pinMode(ledPin, OUTPUT); // declare LED as output
pinMode(inputPin, INPUT); // declare sensor as input
Serial.begin(9600);
}
void loop(){
val = digitalRead(inputPin); // read input value
if (val == HIGH) { // check if the input is HIGH
digitalWrite(ledPin, HIGH); // turn LED ON
if (pirState == LOW) {
// we have just turned on
Serial.println("Motion detected!");
// We only want to print on the output change, not state
pirState = HIGH;
}
} else {
digitalWrite(ledPin, LOW); // turn LED OFF
if (pirState == HIGH){
// we have just turned of
Serial.println("Motion ended!");
// We only want to print on the output change, not state
pirState = LOW;
}
}
}
The video demo is shown in below.
Arduino Interfacing with Visual Studio to read Temperature
Today I'm going to show you how Arduino interfacing with Visual studio to read temperature.
If you don’t know to start visual studio program
click here. Tutorial 7- Change Brightness & Contrast of an image OpenCv C++
Tutorial 6 - Assessing the pixel values of an image OpenCv C++
PC graphical interface for Arduino (Using visual studio C#)
RaspberryPi - How to install Rasbian OS into micro SD card
Tutorial 5 - Convert an Image Color OpenCV C++
Tutorial 4 -Depth, No. of Channels & Type of Image OpenCV C++
Tutorial 3 - Java Variable and Data Types
Newly Updated progTpoint android App
Tutorial 3 - Create a Image OpenCV C++
Python Development Using Visual Studio
Install Python in Windows
Tutorial 2 - Load and Display Image OpenCV C++
Python Introduction
progTpoint-android app install to your phone
Now you can see tutorials without browsing. Install our android app to keep in touch with us.
Tutorial 2 - JAVA first program ( Hello World ) in ubuntu
Tutorial 1.2 -> Install JAVA in Ubuntu
Subscribe to:
Posts (Atom)
3 comments: