Hola Gabriel,
Que buenas noticias y tiendo a pensar que lo que ocurre con lo del
software de Arduino puede ocurrir con Wiring. En teoría solo habría que
configurar varios archivos para que Avrdude reconozca el Micro que es
diferente en Wiring y en Arduino.
En referencia al C (avrgcc) quizá lo mas complicado son los valores en
hexagesimal que hay que tener en el progrma para configurar los puertos
y los tipos de entradas (ver programa adjunto). De esto hablo en la
seccion de Micro-controladores en la página del talles del festival.
Pienso que deberian reunirse con Ricardo Dueñas que tiene experiencia
con las Avrlib de Pascal para ver como se van integrando las cosas.
Saludos,
--* Juan
Comparen este programa con el de Wiring o Arduino es otr forma de
aprender C.
//------------------------------------------------
// USING THE AVRMINI DEVELOPMENT BOARD, CONNECT
// THE LED/PUSHBUTTON HEADER TO THE PORT B HEADER.
//------------------------------------------------
//
//------------------------------------------------
// This program will cause LED0 to flash on/off
// every 500ms.
//------------------------------------------------
//compiler includes
#include <avr/io.h>
//avrlib includes
#include "global.h"
#include "timer.h"
int main(void)
{
// outb(register,byte) writes a byte to a register
// The DDRB register sets the direction of Port B.
// a '1' makes the corresponding pin an output.
// a '0' makes the corresponding pin an input.
// We set the low 4 pins of Port B (to control the leds) as
outputs
// and the high 4 pins (for buttons) pins as inputs, even though
we
// aren't using the buttons in this example.
// 0x0F is hexadecimal for binary 00001111
outb(DDRB, 0x0F);
// The PORTB register can set the physical pins on port B high
// or low when those pins are set to be outputs using DDRB.
// When pins are set to input, the PORTB register does something
// else that will be discussed later.
// To turn off the LEDs we want to pull the end connected to
// port B high (to 5V) so that there will be no voltage drop
across
// the LEDs. See the schematic.
// So we "set" the low 4 bits (to 5V) of PORTB by writing 1's.
outb(PORTB, 0x0F);
// initialize the timer library
timerInit();
//loop forever
while (1) {
//clear bit PB0 in the PORTB register - turn LED on
cbi(PORTB,PB0);
// pause for 500ms
timerPause(500);
//set bit PB0 in the PORTB register - turn LED off
sbi(PORTB,PB0);
//pause for 500ms
timerPause(500);
}
return 0;
}
_______________________________________________
____ ____ ___ ____ _ _ ___
|__| |__/ / |___ \/ |__]
| | | \ /__ |___ _/\_ |
Arzexp mailing list
[email protected]
http://lists.slow.tk/listinfo.cgi/arzexp-slow.tk