Arduino C programming questions

Hello everyone,

I am using an Arduino Uno platform since 3 days, and I have already spent like 20 hours on it.
I have bought the seeed studio kit, who contains a sensor Chassis v1.1 (its an electronic brick which has to be pluged on your Arduino Uno platform).
What I would like to do now, is to start programing my platform in C rather than with this hybird language.
I meet quite a lot of problem, the most important being that I do not find correspondence between the pins of the platform and those of the electric chassis.

Thus, the following code does not work :

#include <avr/io.h>
#define F_CPU 16000000UL
#include <util/delay.h>

int main (void)
{
	DDRD |= (1<<PD5);
	while (1) 
	{
		PORTD |= (1<<PD5);
		_delay_ms(1000);
		PORTD &= ~(1<<PD5);
		_delay_ms(1000);
	}
	return 1;
}

because I just can't find how to map the printed circuits of the electronic brick compared with those of the platform.
The code above has to make a LED bright then shut (every 1 sec), but it's not the case.
What should I do ?

I'm currently coding on the AVR studio and I have followed this tutorial : How to start using AvrStudio, C code and Arduino | HeKilledMyWire

I can't map this platform pins : http://arduino.cc/en/uploads/Hacking/Arduino-To-Atmega8-Pins.png with this shield : http://shieldlist.org/images/174/chassis.jpg

Thanks for your help.

What I would like to do now, is to start programing my platform in C rather than with this hybird language.

The "hybrid language" is C++.

because I just can't find how to map the printed circuits of the electronic brick compared with those of the platform.

I have no idea what that means.

Pin mappings should be marked on the schematic.

AWOL:

What I would like to do now, is to start programing my platform in C rather than with this hybird language.

The "hybrid language" is C++.

because I just can't find how to map the printed circuits of the electronic brick compared with those of the platform.

I have no idea what that means.

Pin mappings should be marked on the schematic.

Yeah it's C++ but with less features ...
Anyway it's not really the problem, I have to program it in C to avoid the processing. Its like flashing C on the microcontroller I guess.
The problem is that I have no pin mapping on the shield, I have one on the platform, but the shield takes 3 pin of the platform for each of its plugs ...
So I can't really determine which pins I have to switch ...

Yeah it's C++ but with less features ...

Well, it's missing "new" and "delete" (and I assume you meant "fewer") but apart from that, what do you feel is missing?

Try this

The problem is that I have no pin mapping on the shield, I have one on the platform, but the shield takes 3 pin of the platform for each of its plugs ...

So I can't really determine which pins I have to switch ...

Then take the shield back, if they can't provide documentation they should not be selling hardware.

If you don't have schematics for your hardware I don't see how we can help?

The only other thing to do is get your multimetre out and reverse engineer the thing yourself.

When you say "the following code does not work" do you mean that it compiles but the pin doesn't toggle on the Arduino header?

BTW what you have there is no more "C" than most Arduino code, _delay_ms() is just Atmel's version of delay().


Rob

Bremen:
Anyway it's not really the problem, I have to program it in C to avoid the processing. Its like flashing C on the microcontroller I guess.

:roll_eyes:

The problem is that I have no pin mapping on the shield, I have one on the platform, but the shield takes 3 pin of the platform for each of its plugs ...
So I can't really determine which pins I have to switch ...

this might help you :
http://www.seeedstudio.com/wiki/images/a/a9/Electronic_Bricks_Starter_Kit_Cookbook_v1.3.pdf