22-04-2014, 09:33 PM
Hola Antonio, estoy intentando hacerle un boatloader a mi arduino y estoy un poco en blanco, ya he fabricado el cable paralelo, pero no se que pasos hay que seguir exactamente, tu sabes algo del tema, gracias.
(22-04-2014, 09:33 PM)juanma1970 escribió: [ -> ]Hola Antonio, estoy intentando hacerle un boatloader a mi arduino y estoy un poco en blanco, ya he fabricado el cable paralelo, pero no se que pasos hay que seguir exactamente, tu sabes algo del tema, gracias.
(23-04-2014, 10:19 AM)juanma1970 escribió: [ -> ]Ya lo he intentado es y nada,esperare a que me llegue el chip atmega328
(25-04-2014, 01:47 PM)Namiga escribió: [ -> ]Gracias AntonioNecesitas usar varias librería:
La idea de usar 4 canales es la siguiente.
Usare 4 parejas de led (8 en total) de 10W. cada canal usara una salida diferente de Arduino, con lo cual podre manejar cada canal a mi antojo. Esto lo quiero asi por si me hago alguna vez con macandra ... que con mas luz estara mejor que con poca
De momneto todos los led son Blancos de 6500k. Mas tarde pondre algo de luz de luna.
Respecto al reloj y el LCD ya los tengo y los dos van por I2C. lo que no me aclaro es como acceder a ellos a traves de la misma via de comunicación. Se supone que las librerias haran el trabajo sucio ???
Estoy intentando hacer el codigo del dimeo.
ya he visto codigos por intenet de como simular la bajada de intensidad cuando se supone que pasa una nube!!! pero eso esta a años luz de mi conocimiento para programar aun
Un saludo
// Incluir librerías
#include <Wire.h>
#include <RTClib.h>
#include <LiquidCrystal_I2C.h>
#define LcdAddress 0x27 // Direccion I2C para el LCD
// Instanciar objetos (viene a ser lo equivalente a declarar una variable tipo objeto)
LiquidCrystal_I2C lcd_i2c(LcdAddress, 20, 4); // para display de 20x4
RTC_DS1307 RTC;
// ******************
void MostrarFechaHoraEnLCD(){
DateTime now = RTC.now();
int YYYY, MM, DD, hh, mm, ss;
char CadAux[21];
YYYY=now.year();
MM= now.month();
DD= now.day();
hh= now.hour();
mm= now.minute();
ss= now.second();
sprintf(CadAux, "%4d/%02d/%02d %02d:%02d:%02d", YYYY, MM, DD, hh, mm, ss);
lcd_i2c.setCursor(0,0);
lcd_i2c.print(CadAux);
}
// ******************
void LCD_Ini(){
lcd_i2c.init();
lcd_i2c.backlight();
lcd_i2c.setCursor(0,0);
lcd_i2c.print("Prueba LCD i2c");
}
// ******************
void RTC_Ini(){
RTC.begin();
if (! RTC.isrunning()) {
Serial.println("RTC Parado!" );
RTC.adjust(DateTime(__DATE__, __TIME__));
// RTC.adjust(DateTime("DEC 31 2011","12:59:45")); // Setting the time to a fixed
}
else{
Serial.println("RTC OK!");
}
}
// ******************
void setup(){
Serial.begin(9600); // Iniciar Serial
Wire.begin(); // Iniciar I2C
LCD_Ini(); // Iniciar LCD
RTC_Ini(); // Iniciar LCD
}
// ******************
void loop(){
MostrarFechaHoraEnLCD();
delay(1000);
}
int led1 = 2; // the pin that the LED is attached to
int led2 = 3; // the pin that the LED is attached to
int led3 = 4; // the pin that the LED is attached to
int led4 = 5; // the pin that the LED is attached to
int brightness = 0; // how bright the LED is
int fadeAmount = 1; // how many points to fade the LED by
// the setup routine runs once when you press reset:
void setup() {
// declare pin 2,3,4,5 to be an output:
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
// set the brightness of pin 2,3,4,5:
analogWrite(led1, brightness);
analogWrite(led2, brightness);
analogWrite(led3, brightness);
analogWrite(led4, brightness);
// change the brightness for next time through the loop:
brightness = brightness + fadeAmount;
// reverse the direction of the fading at the ends of the fade:
if (brightness == 0 || brightness == 170) {
brightness == 170 ;
}
// wait for 50 milliseconds to see the dimming effect
delay(90);
}
//*******Nokia 3310
//keypad debounce parameter
#define DEBOUNCE_MAX 15
#define DEBOUNCE_ON 10
#define DEBOUNCE_OFF 3
#define NUM_KEYS 5
#define NUM_MENU_ITEM 5 //Main, Set Time, LED Test, Extras, About
// joystick number
#define UP_KEY 3
#define LEFT_KEY 0
#define CENTER_KEY 1
#define DOWN_KEY 2
#define RIGHT_KEY 4
// menu starting points
#define MENU_X 0 // 0-83
#define MENU_Y 5 // 0-5
// adc preset value, represent top value,incl. noise & margin,that the adc reads, when a key is pressed
// set noise & margin = 30 (0.15V@5V)
int adc_key_val[5] ={30, 150, 360, 535, 760 };
// debounce counters
byte button_count[NUM_KEYS];
// button status - pressed/released
byte button_status[NUM_KEYS];
// button on flags for user program
byte button_flag[NUM_KEYS];
// menu definition - note Pad to eight characters
char menu_items[NUM_MENU_ITEM][12]={
"MAIN ",
"SET TIME",
"LED TEST",
"EXTRAS ",
"ABOUT "
};
void (*menu_funcs[NUM_MENU_ITEM])(void) = {
menu_main,
menu_set_time,
menu_led_test,
menu_extras,
menu_about
};
char current_menu_item;
const char RTC_MENU_ITEMS = 9;
const char LED_MENU_ITEMS = 7;
const char EXTRAS_MENU_ITEMS = 5;
byte LCD_backlight_pinState = 1;
char tstr[5]; // temporary store for manipulating strings for LCD output
Nokia_3310_lcd lcd=Nokia_3310_lcd();
(26-04-2014, 02:00 PM)Namiga escribió: [ -> ]El contaste creo que es por potenciómetro externo. No se puede controlar por código