LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-09-2006, 08:07 PM   #1
weifeng
LQ Newbie
 
Registered: Feb 2006
Posts: 4

Rep: Reputation: 0
need help in correcting errors urgently


hi,

i m working on a DS1307 RTC program. i am using MPLAB IDE/C18 compiler. while trying to build the program, there are errors in it. can anyone help mi with the errors? i nid to get it done soon... the line in red is a syntax error...thanx

#define DS1307_SDA PIN_B1
#define DS1307_SCL PIN_B0
void boot_up(void);
void rtc_programming(void);
void read_rtc(void);

//==========================
// initial DS1307
//==========================
void init_DS1307()
{
output_float(DS1307_SCL);
output_float(DS1307_SDA);
}
//==========================
// write data one byte to
// DS1307
//==========================
void rtc_set(unsigned char rtcreg)
{
short int status;
i2c_start();
i2c_write(0xd0);
i2c_write(address);
i2c_write(data);
i2c_stop();
i2c_start();
status=i2c_write(0xd0);
while(status==1)
{
i2c_start();
status=i2c_write(0xd0);
}
}
//==========================
// read data one byte from DS1307
//==========================
byte read_DS1307(byte address)
{
byte data;
i2c_start();
i2c_write(0xd0);
i2c_write(address);
i2c_start();
i2c_write(0xd1);
data=i2c_read(0);
i2c_stop();
return(data);
}


i knew that byte was not an integer type for C18 compiler. i tried using unsigned char, but still the same syntax error.....
 
Old 02-09-2006, 08:18 PM   #2
oulevon
Member
 
Registered: Feb 2001
Location: Boston, USA
Distribution: Slackware
Posts: 438

Rep: Reputation: 30
Why did you start a new thread? You already have a thread with this in it.


http://www.linuxquestions.org/questi...d.php?t=413219
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
need help in correcting errors urgently weifeng Programming 4 02-10-2006 12:26 AM
Correcting a yum dependency issue muppetmaster Fedora 3 11-02-2005 03:28 AM
ntpd not correcting local time plythgam Linux - Software 1 08-16-2004 04:12 PM
Problem Correcting Dependencies Dip Linux - Software 4 12-25-2003 08:16 AM
Correcting e-mails in Evolution 1.4.5 finrold Linux - Software 0 10-29-2003 04:48 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration