Quantcast
Channel: Let's Make Robots! | RobotShop - program
Viewing all articles
Browse latest Browse all 31

Motion sensing device

$
0
0

The device uses 2 ldrs. It is programmed to check if any of them is low(I mean not receiving light). If so, then it checks if now the other one is low. Based on which ldr was low first, it makes an output. The Arduino sketch is here:

#define led1 3

#define led2 5 #define ldr1 7

#define ldr2 8

int stateLed1=0;

int stateLed2=0;

const int wait=20;

int vala=0;

int valb=0;

int a=0;

int b=0;

int c=0;

int d=0;

int e=0;

int f=0;

int g=0;

int h=0;

int i=0;

int j=0;

int k=0;

read more


Viewing all articles
Browse latest Browse all 31

Trending Articles