This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int RED_LED = 12; | |
int BLUE_LED = 13; | |
int GREEN_LED = 14; | |
void setup() { | |
// Initialisation | |
pinMode(RED_LED,OUTPUT); | |
pinMode(BLUE_LED,OUTPUT); | |
pinMode(GREEN_LED,OUTPUT); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<highgui.h> | |
#include<cv.h> | |
using namespace cv; | |
int main() | |
{ | |
Mat A,B; | |
A=imread("boy.jpg"); //Read the image file | |
namedWindow("Boy", CV_WINDOW_AUTOSIZE ); //Create a new window to show the image. Name the window as "boy" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
value=$(cat /sys/bus/iio/devices/iio:device0/in_voltage0_raw) | |
value=$(echo $value*0.0004394 | bc) | |
echo "$value V" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include <unistd.h> | |
int main(int argc, char* argv[]) | |
{ | |
if(argc!=3){ | |
printf("Syntax: %s <no_of_times_to_blink> <delay_us>\n",argv[0]); | |
return 0; | |
} | |
int delay=atoi(argv[2]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while true | |
do | |
echo 1 > /sys/class/gpio/gpio23/value | |
cat /sys/class/gpio/gpio23/value | |
sleep 1 | |
echo 0 > /sys/class/gpio/gpio23/value | |
cat /sys/class/gpio/gpio23/value | |
sleep 1 | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
void Dec2Hex(int no){ | |
int hex=0; | |
if(!no) | |
return; | |
else { | |
hex=no%16; | |
Dec2Hex(no/16); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% Power-Law Transformation | |
% Equation s=cr^a | |
A=imread('401566.jpg'); | |
A=rgb2gray(A); | |
c=1; | |
a=2.2; | |
imshow(uint8(c*(double(A).^a))); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% Log Transform | |
% Equation s=c*log(1+r) | |
A=imread('401566.jpg'); | |
A=rgb2gray(A); | |
imshow(log(double(A)+1)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A=imread('401566.jpg'); %Change 401566.jpg with your image file | |
A=rgb2gray(A); | |
imshow(255-A); %(L-1)-r;L=256(8 bit gray scale) |
NewerOlder