Need code from keypad to xbee and seven segment display

Bluetooth, XBee, RF......

Need code from keypad to xbee and seven segment display

Postby didiey » Sun Oct 17, 2010 6:23 am

Hello, i'm doing fyp related with broadcast xbee which use keypad and also 7segment display. i need someone to tell me how to coding all those thing. Actually, i have used pic 16f877a, and mplab v 8.46 as software to program it.

How to code, form keypad (4x4) go to pic 16f877a, and display the out put at seven segment display and simultaneously transmit the data to xbee transeiver? i really need u help, a little bit confius here, :? ~
Attachments
BROADCAST ARCH.JPG
Achitecture of broadcast wireless network system.
didiey
Newbie
 
Posts: 9
Joined: Tue Sep 28, 2010 12:23 pm

Re: Need code from keypad to xbee and seven segment display

Postby shahrul » Mon Oct 18, 2010 2:04 am

If you want to learn, see example keypad + 7 segment.
For the Xbee use UART, see the example UART Transmit and Receive.
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: Need code from keypad to xbee and seven segment display

Postby didiey » Mon Oct 18, 2010 8:25 am

Thanks a lot, i need to to study the code first, a lot of changes should be made right? actually i'm beginner in mplab, i'm juz explore it by myself coz only for my final year project. May be i need guide how to code it. :)

i'm juz used typical seven segment display. By right, should i change the coding from lcd to segment? :?

#define LCD_RS RD0
#define LCD_RW RD1
#define LCD_EN RD2
#define LCD_LIGHT RD3
#define LCD_DATA PORTD //D7-D4
#define LCD_PULSE() ((LCD_EN=1),(LCD_EN=0))



how about this code?

[size=85]while(1){
for (counter=0;counter<10;counter++)
{PORTD=[color=#0040FF]segment
[counter];
__delay_sec(1);
}
}



...confius, which one should i change, really need you help! tq.. :).
Attachments
280px-Seven_segment_02_Pengo.jpg
280px-Seven_segment_02_Pengo.jpg (6.86 KiB) Viewed 3404 times
didiey
Newbie
 
Posts: 9
Joined: Tue Sep 28, 2010 12:23 pm

Re: Need code from keypad to xbee and seven segment display

Postby shahrul » Mon Oct 18, 2010 12:47 pm

You just think 7 segment as parallel led. So, you can turn on and turn off independently.
You can set
CODE: SELECT_ALL_CODE
#define SEGMENT   PORTB      //abcdefg.

for(;;){
SEGMENT=0b11111100; //display 0
__delay_ms(30);
SEGMENT=0b01100000; //display 1
__delay_ms(30);
SEGMENT=0b11011010; //display 2
__delay_ms(30);
}
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: Need code from keypad to xbee and seven segment display

Postby yonghui » Mon Oct 18, 2010 1:35 pm

hi,

be careful with 3.3V of xbee. PIC is 5V.
thanks&regards,
yh
yonghui
Moderator
 
Posts: 732
Joined: Mon Sep 28, 2009 3:27 pm


Return to Wireless Device

Who is online

Users browsing this forum: No registered users and 31 guests

cron