Author |
Message |
Topic: convert float to string |
Indy
Replies: 1
Views: 4819
|
Forum: General CCS C Discussion Posted: Mon Aug 11, 2008 5:39 am Subject: convert float to string |
Use sprintf.char my_string[10];
float my_float=12.345;
sprintf(my_string, "%f", my_float); |
Topic: I want extract the single digit from a int8: |
Indy
Replies: 4
Views: 4355
|
Forum: General CCS C Discussion Posted: Sat Aug 09, 2008 5:01 pm Subject: I want extract the single digit from a int8: |
If you use an array instead of 3 separate variables you could do it like: int8 c[3];
int8 value = 169;
for (i=3; i>0; i--)
{
c[i-1] = value % 10;
value = val ... |
Topic: looping problem |
Indy
Replies: 7
Views: 8611
|
Forum: General CCS C Discussion Posted: Thu Jul 10, 2008 5:41 pm Subject: looping problem |
can i change the code to:
if (addr < EEPROM_SIZE)
{
write_ext_eeprom(addr++, input)
write_ext_eeprom(addr++, sec)
write_ext_eeprom(addr++, yr)
}
and when i read back the data, i do the s ... |
Topic: looping problem |
Indy
Replies: 7
Views: 8611
|
Forum: General CCS C Discussion Posted: Thu Jul 10, 2008 11:11 am Subject: looping problem |
i do realize that but how do i change the code? and why cant addr++ make the value of addr increase everytime after a data is being saved?addr++ will increment the address but look at the following co ... |
Topic: Undefined identifier |
Indy
Replies: 9
Views: 29683
|
Forum: General CCS C Discussion Posted: Thu Jul 10, 2008 5:11 am Subject: Undefined identifier |
Welcome into the world of programming.
Computers always exactly do what you tell them to do, which is not necessarily what you intend to do...
The compiler stops at the first error it encounters. ... |
Topic: ICD and code protection bit problem |
Indy
Replies: 6
Views: 7155
|
Forum: General CCS C Discussion Posted: Thu Jul 10, 2008 2:22 am Subject: ICD and code protection bit problem |
You can use the ICD as a debugger or as a programmer. You only have to set ICD=TRUE when using the ICD as a debugger.
A debugger does not work when the PROTECT fuse is set, that's why the fuse is ... |
Topic: Undefined identifier |
Indy
Replies: 9
Views: 29683
|
Forum: General CCS C Discussion Posted: Thu Jul 10, 2008 2:01 am Subject: Undefined identifier |
Your modification would be right when programmed in C++ but in traditional C there is a limitation that all variables have to be declared at the start of the function, i.e. the first line after the '{ ... |
Topic: weird behaviour of ex_fat.c example - help appreciated :) |
Indy
Replies: 20
Views: 23888
|
Forum: General CCS C Discussion Posted: Fri Jun 06, 2008 8:14 am Subject: weird behaviour of ex_fat.c example - help appreciated :) |
I remember reading one of the two file systems was better tested. I thought this was FAT16 but you found the original text and it turns out I was wrong and FAT32 is the one being better tested.
I n ... |
Topic: weird behaviour of ex_fat.c example - help appreciated :) |
Indy
Replies: 20
Views: 23888
|
Forum: General CCS C Discussion Posted: Thu Jun 05, 2008 9:53 am Subject: weird behaviour of ex_fat.c example - help appreciated :) |
I just see the CCS code defaults to FAT32 but I remember reading somewhere the FAT16 is more stable. In FAT.c change to FAT16: /// Define your FAT type here ///
//#define FAT16
#define FAT32 |
Topic: weird behaviour of ex_fat.c example - help appreciated :) |
Indy
Replies: 20
Views: 23888
|
Forum: General CCS C Discussion Posted: Thu Jun 05, 2008 9:46 am Subject: weird behaviour of ex_fat.c example - help appreciated :) |
Is it possible to store the files (or format the card) in such a way that I don't need to use apps like WINHEX or DISKEDIT to view the content of the SD/MMC ?That's what FAT16 or FAT32 is supposed for ... |
Topic: weird behaviour of ex_fat.c example - help appreciated :) |
Indy
Replies: 20
Views: 23888
|
Forum: General CCS C Discussion Posted: Thu Jun 05, 2008 9:44 am Subject: weird behaviour of ex_fat.c example - help appreciated :) |
I don't know what happened, I rebooted my computer and everything (almost) works like a charm !! Sounds like my typical Hyperterm problem. The program seems to work like a charm but (partial) data is ... |
Topic: rs232 |
Indy
Replies: 4
Views: 4958
|
Forum: General CCS C Discussion Posted: Thu Jun 05, 2008 8:39 am Subject: rs232 |
RS232 is a standard only describing the hardware. It allows you to send and receive bytes.
A floating point number consists of multiple bytes, 4 in the CCS compiler, sometimes more in other compil ... |
Topic: a variable for many pins |
Indy
Replies: 6
Views: 5983
|
Forum: General CCS C Discussion Posted: Thu Jun 05, 2008 8:00 am Subject: a variable for many pins |
You can't do this in the v3 compiler but it should be possible in the v4 compiler.
int XPIN; The int type in the CCS compiler is 8 bit and too small to hold the PIN number. Change to an int16 type ... |
Topic: weird behaviour of ex_fat.c example - help appreciated :) |
Indy
Replies: 20
Views: 23888
|
Forum: General CCS C Discussion Posted: Thu Jun 05, 2008 7:56 am Subject: weird behaviour of ex_fat.c example - help appreciated :) |
I tried to put some printf("hello"); at the beginning of the main() method but it doesn't show up in the hyperterm window... If you can't get this to work than it has no use to start debuggi ... |
Topic: C++ code examples for USB bulk transfer? |
Indy
Replies: 2
Views: 11746
|
Forum: General CCS C Discussion Posted: Wed Jun 04, 2008 3:14 pm Subject: Re: C++ code examples for USB bulk tranfer? |
Also, if I search the forum for c++ or "c++" it doesn't return anything. Any suggestions for how to search for that?Use Google with the search string: c++ site:http://www.ccsinfo.com/forum
... |
|