- Send to a friend
-
- Remove this product from my favorite's list.
- Add this product to my list of favorites.
Pi-Puck Extension for e-puck 2
712,50 €
650,00 €
587,50 €
1 687,50 €
No products added yet
Detailed Description:
Uses:
For a variety of vibration the triggering effect reported theft alarm, smart car, earthquake alarm, motorcycle alarm.
Compared to the module with normally open type vibration sensor module, vibration, longer trigger relay module can drive
Module Features:
Module using the instructions:
SCM test program:
Sensor trigger test
Single chip microcomputer: STC89C52
Baud rate: 9600
Product use: vibration induction trigger, alarm is triggered.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
> # include < reg52. H
Unsigned char date;
# define uchar unsigned char
# define uint unsigned int
Sbit key1 = P0 ^ 1;
/ * function declaration -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * /
Void delay (uint z);
Void Initial_com (void);
/ / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/ *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * function name: delay (uint z)
* * function function: time delay function
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* /
Void delay (uint z)
{
Uint I, j;
For (I = z; I > 0; I -)
For (j = 110; j > 0; j --);
}
/ / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/ / * * * * * * * * a serial port initialization function * * * * * * * * * * * * * * * * * * * *
/ / * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Void Initial_com (void)
{
EA = 1;/ / always interrupt
ES = 1;/ / allow the serial port interrupt
ET1 = 1;/ / allow the timer T1 interruption
TMOD = 0 x20; / / timer T1, baud rate in mode 2 interrupt
PCON = 0 x00; / / SMOD = 0
SCON x50 = 0; / / 1 is controlled by a timer
TH1 XFD = 0; / / the baud rate is set to 9600
TL1 = 0 XFD;
TR1 = 1;/ / open the timer T1 run control bits
}
/ / * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/ / * * * * * * * * * * * * * the main function * * * * * * * * * * * *
/ / * * * * * * * * * * * * * * * * * * * * * * * * * * * *
The main ()
{
Initial_com ();
While (1)
{
If (key1 = = 1)
{
Delay (); / / jitter elimination
/ / if (key1 = = 1) confirm the trigger
{
SBUF = 0 x01;
Delay (200);
}
}
If (RI)
{
The date = SBUF; / / microcontroller to accept
SBUF = date; / / microcontroller send
RI = 0;
}
}
}