- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi guys,
Ive been playing around with my 2 button key fob and receiver, and i thought wouldnt it be great to interface it to my Psoc 1.
conected to my psoc are 2 ir beam breakers i made, they currently work with a simple bit of code. I was wanting to make a simple alarm. it shoud be like this. system on> wait till armed (button 1 of key fob) > armed> do alarm stuff (already done). button 2 of the fob should disarm the alarm whether the alarm was activated or just to disable it even if it wasnt activated.
so do i need to declare something like:
buttonarm==0;
buttondisarm==0;
while buttonarm is not pressed, dont do anything, if it is arm alarm activated
{
do alarm stuff, have this done to monitor ir beam breakers
if the alarm goes off for any reason and buttondisarm is pressed, disable alarm output
}
im 100% sure on how to implement the keyfob
any help is always greatly appreciated.
thanks
- Labels:
-
PSoC 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hiya lleung, ive only got the cy3210 eval 1 kit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You set up the PWD but it was not used in your software and it also needs some change to the internal wiring of the PSoC1 to make it work.
How about use a software debounce for now.
The most simple way is to use a delay loop for debouncing. (This is not the best way but easy to understand. Once you master this we use better approach to this)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi lleung,
do you mean use a software delay like this? This is a software delay i used before
unsigned int x=0;
void delaytimes(int x) // DELAY FUNCTION
{
int i,j;
for(i=0;i<x;i++)
{
for(j=0;j<10;j++)
{
}
then to use it call it like so with the numerical value, is the delay calculated by the numerical value divides by the clk?
delaytimes(100);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Simple delay functions can be had as the following describes -
http://www.planetpsoc.com/component/content/article/32-delay-functions.html
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Dana,
I remember seeing that delay function as part of the LCD module, but didnt know i could use it without placing an LCD module and just adding the files to the project, i shall look into that. thanks Dana