Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Embedded C programming

Status
Not open for further replies.

Angy

New Member
If anyone has easy to understand source of info on embedded c,Please post it on this thread.
Thanks a lot!
 
Last edited:
Can anyone tell me what this means in a c program?
unsigned int *ADCmemory=(unsigned int *)0x3200
 
Can anyone tell me what this means in a c program?
unsigned int *ADCmemory=(unsigned int *)0x3200

ADCmemory will hold an address pointing to an unsigned integer and the address of that unsigned integer is 0x3200.
Dale
 
Last edited:
Hello,
can someone tell me what this ' -> ' means in C?
Atimer = brushfan -> statefantimeout;
Thanks.
 
I do not care for C++ but ...

the -> operator lets you get from an object pointer to a real object or a an attribute of the real object.

Look at the definitions for Atimer and brushfan and you should find statefantimeout.

Anyone who can do better please speak up.

3v0
 
Pretty much right.

I might hate C++ more than you 3v0... Especially in embedded apps. Statefantimeout is just a variable that is the property of brushfan.

It's exactly the same as;
Atimer = statefantimeout;

But longer, uglier, more typing, more to go wrong and probably slower and worse to compile to assembler for the micro to use.

Down with C++! C-- rules. ;)
 
I should clarify

Object oriented programming can be a very good thing in a large application. The kind that will not fit on most micros.

C++ is a good example of how not to implement a OO language.

Given a choice I will use C#. Do not carp about it being MS as there is good support for the open source version mono. You can even use visual studio on vista to debug a C# program running under linux.

3v0
 
The arrow operator is used in C. It's how you dereference a pointer to a struct or union and access its members.

Atimer = brushfan -> statefantimeout;

is the more readable way of writing

Atimer = (*brushfan).statefantimeout.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top