C

I was hoping to find on-line manuals that I could print and read on the john. So far no luck. But what I really need is how to declare variables in C.

For example, I have a sample code that has the statement:

unsigned char

and

unsigned long

What do these mean and do they limit the declaration to integers. What do i declare if I want a floating point?

Also, someone told me I cant do floating point with a Keil Compiler because of licensing issues (I got my copy from Silicon Labs and have just registered it). I will eventually need to do trig functions. What do i have to get (buy) to complete my project?

Parents
  • I was hoping to find on-line manuals that I could print and read on the john. So far no luck. But what I really need is how to declare variables in C.

    You don't need an on-line manual, you need actual literature on the basics of C programming. The C51 compiler manual is not a substitute for a book about C, nor is it intended to be one.

    K&R (i.e. "The C programming language" by B. W. Kernighan and D. M. Ritchie) has already been suggested, and I strongly second that recommendation. After all, it's _the_ book about C written by the guys who invented C in the first place.

    I will eventually need to do trig functions.

    Using trigonometric functions does not require use of floating point arithmetics. In fact, part of the skillset of an embedded developer is coming up with solutions that fit the capabilities of the target hardware - and the '51 is very much unsuited for floating point math (even though the C51 compiler will not try to keep the programmer from shooting himself in the foot there).

    There are other solutions, like using lookup tables and interpolation.

Reply
  • I was hoping to find on-line manuals that I could print and read on the john. So far no luck. But what I really need is how to declare variables in C.

    You don't need an on-line manual, you need actual literature on the basics of C programming. The C51 compiler manual is not a substitute for a book about C, nor is it intended to be one.

    K&R (i.e. "The C programming language" by B. W. Kernighan and D. M. Ritchie) has already been suggested, and I strongly second that recommendation. After all, it's _the_ book about C written by the guys who invented C in the first place.

    I will eventually need to do trig functions.

    Using trigonometric functions does not require use of floating point arithmetics. In fact, part of the skillset of an embedded developer is coming up with solutions that fit the capabilities of the target hardware - and the '51 is very much unsuited for floating point math (even though the C51 compiler will not try to keep the programmer from shooting himself in the foot there).

    There are other solutions, like using lookup tables and interpolation.

Children
More questions in this forum