Curtain system

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

Curtain system

Postby nagufever » Tue Jan 18, 2011 1:15 pm

i am using Cytron PR16 Sending data using RF but how do i modify the Rx PIC coding because i am adding LM35 temperature sensor,Dc motor and LDr sensor to the PIC.
nagufever
Newbie
 
Posts: 15
Joined: Mon Sep 06, 2010 10:46 pm

Re: Curtain system

Postby hyng » Tue Jan 18, 2011 2:06 pm

What do you mean by the Rx coding? The LM35 and Motor controlling is quite same with the PR11.
User avatar
hyng
Moderator
 
Posts: 292
Joined: Thu Apr 16, 2009 11:35 am

Re: Curtain system

Postby shahrul » Tue Jan 18, 2011 4:41 pm

Maybe you want transmit LM35 data wireless. Using 10bit ADC, then you need to transmit 2byte.
Ex,
temperature=read_a2d(0);
uart_transmit(temperature>>8);
uart_transmit(temperature);

Then you will receive 2 byte of temperature value. This only concept, not including synchronizing the data.
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: Curtain system

Postby nagufever » Wed Jan 19, 2011 2:43 pm

i mean turning on/off LM35 & LDR using RF remote to draw and close the curtain using DC motor.Then, i want to open and close directly the curtain from the RF transmitter.That's why asking which part of PR16Tx and Rx PIC source code i need to modify in order for it to function properly?
nagufever
Newbie
 
Posts: 15
Joined: Mon Sep 06, 2010 10:46 pm

Re: Curtain system

Postby shahrul » Wed Jan 19, 2011 5:14 pm

nagufever WROTE:i mean turning on/off LM35 & LDR using RF remote to draw and close the curtain using DC motor.Then, i want to open and close directly the curtain from the RF transmitter.That's why asking which part of PR16Tx and Rx PIC source code i need to modify in order for it to function properly?

I don't get what your flow. Wireless the LM35 or wireless the push button? You need to understand that code and write for your own. Nobody will help for full code, just help for the concept and idea.
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: Curtain system

Postby nagufever » Thu Jan 20, 2011 12:51 am

I don't get what your flow. Wireless the LM35 or wireless the push button? You need to understand that code and write for your own. Nobody will help for full code, just help for the concept and idea.


RF push button to activate LM35.Can you give me syntax to write the code for transmitter and receiver section?
nagufever
Newbie
 
Posts: 15
Joined: Mon Sep 06, 2010 10:46 pm

Re: Curtain system

Postby shahrul » Thu Jan 20, 2011 1:08 am

nagufever WROTE:RF push button to activate LM35.Can you give me syntax to write the code for transmitter and receiver section?

How to activate LM35? LM35 is input to read temperature. It's not output like buzzer that can turn on/off. If enable/disable LM35 reading, it can.
For TX
CODE: SELECT_ALL_CODE
#define      PB      RA0
unsigned char      DATA

if(PB==0) DATA=DATA&0b11111110;    //clear bit 0
else DATA=DATA|00000001;               //set bit 0
send_uart(DATA);

For RX
CODE: SELECT_ALL_CODE
if(RCIF==1)    DATA=RCREG;

if(DATA==0x00) temperature=0;
else if(DATA==0x01) temperature=read_a2d(0);

If you don't understand, you need to learn back to basic..
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: Curtain system

Postby nagufever » Thu Jan 20, 2011 10:22 am

RF push button to enable/disable LDR with relay(receiver).Can you give me syntax to write the code for transmitter and receiver section?
nagufever
Newbie
 
Posts: 15
Joined: Mon Sep 06, 2010 10:46 pm

Re: Curtain system

Postby shahrul » Thu Jan 20, 2011 10:35 am

nagufever WROTE:RF push button to enable/disable LDR with relay(receiver).Can you give me syntax to write the code for transmitter and receiver section?

I have give the example. It should give you idea.
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: Curtain system

Postby nagufever » Fri Jan 21, 2011 11:52 pm

You mean your example is a full code or syntax?
nagufever
Newbie
 
Posts: 15
Joined: Mon Sep 06, 2010 10:46 pm

Next

Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 1 guest

cron