Just assembled my clock, no issues at all (3rd adafruit kit).
What i would like to know is (and i CANNOT write computer programs, i just cant. End of) is there a firmware which supports gps time update AND auto dimming???
Many thanks and keep those projects coming. I love my tv-b-gone.
Ice Tube Clock firmware question
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- mitpatterson
- Posts: 196
- Joined: Mon Aug 02, 2010 11:45 pm
Re: Ice Tube Clock firmware question
here is page that talks about mods along with how to hook up the GPS and stuff:
http://www.ladyada.net/make/icetube/mods.html
http://www.ladyada.net/make/icetube/mods.html
- cornz
- Posts: 52
- Joined: Tue Sep 08, 2009 1:06 pm
Re: Ice Tube Clock firmware question
Thanks although i already have that page stored.
My problem is this, there is a firmware for the gps mod, i understand that. Then theres a firmware that supports dimming, but there isnt a firmware that supports both these features and thays what im after, a gps compatible firmware with autodimmimg included.
As much as i try to understand how to program things i just cant. It might as well be written in chinese for all the sense it makes to me.
My problem is this, there is a firmware for the gps mod, i understand that. Then theres a firmware that supports dimming, but there isnt a firmware that supports both these features and thays what im after, a gps compatible firmware with autodimmimg included.
As much as i try to understand how to program things i just cant. It might as well be written in chinese for all the sense it makes to me.
- mitpatterson
- Posts: 196
- Joined: Mon Aug 02, 2010 11:45 pm
Re: Ice Tube Clock firmware question
not sure about that, and sorry, i didn't see that you wanted dimming too, not sure if there is a way to combine the codes at all, maybe someone else can shed some light on it
- cornz
- Posts: 52
- Joined: Tue Sep 08, 2009 1:06 pm
Re: Ice Tube Clock firmware question
Ok, doubt im even near but, ive looked in the .c file for the dimming firmware and ive found this bit
/**************************** DIMMER ****************************/
void dimmer_init(void) {
dimmer_on = eeprom_read_byte((uint8_t *)EE_DIMMER);
// Power for the photoresistor
DIMMER_POWER_DDR |= _BV(DIMMER_POWER_PIN);
DIMMER_POWER_PORT |= _BV(DIMMER_POWER_PIN);
ADCSRA |= _BV(ADPS2)| _BV(ADPS1); // Set ADC prescalar to 64 - 125KHz sample rate @ 8MHz F_CPU
ADMUX |= _BV(REFS0); // Set ADC reference to AVCC
ADMUX |= _BV(ADLAR); // Left adjust ADC result to allow easy 8 bit reading
ADMUX |= _BV(DIMMER_SENSE_PIN); // Set ADC input as ADC4 (PC4)
DIDR0 |= _BV(DIMMER_SENSE_PIND); // Disable the digital imput buffer on the sense pin to save power.
ADCSRA |= _BV(ADEN); // Enable ADC
ADCSRA |= _BV(ADIE); // Enable ADC interrupt
}
// Start ADC conversion for dimmer
void dimmer_update(void) {
if (dimmer_on)
ADCSRA |= _BV(ADSC);
}
// Update brightness once ADC measurement completes
SIGNAL(SIG_ADC) {
if (!dimmer_on || displaymode == SET_BRIGHTNESS)
return;
if (ADCH > DIMMER_THRESHOLD) { // bigger number means darker room
set_vfd_brightness(BRIGHTNESS_MIN);
} else {
set_vfd_brightness(brightness_level);
}
}
**********************************************************************
Now, i assume that this is the brightness control. I also suspect that this simply turns it on as there is no mention of a menu item.
So, can i just paste this into the gps code somewhere and then somehow convert it back into something i can program back into the chip???
Or, as i suspect, am i just miles of the mark??
/**************************** DIMMER ****************************/
void dimmer_init(void) {
dimmer_on = eeprom_read_byte((uint8_t *)EE_DIMMER);
// Power for the photoresistor
DIMMER_POWER_DDR |= _BV(DIMMER_POWER_PIN);
DIMMER_POWER_PORT |= _BV(DIMMER_POWER_PIN);
ADCSRA |= _BV(ADPS2)| _BV(ADPS1); // Set ADC prescalar to 64 - 125KHz sample rate @ 8MHz F_CPU
ADMUX |= _BV(REFS0); // Set ADC reference to AVCC
ADMUX |= _BV(ADLAR); // Left adjust ADC result to allow easy 8 bit reading
ADMUX |= _BV(DIMMER_SENSE_PIN); // Set ADC input as ADC4 (PC4)
DIDR0 |= _BV(DIMMER_SENSE_PIND); // Disable the digital imput buffer on the sense pin to save power.
ADCSRA |= _BV(ADEN); // Enable ADC
ADCSRA |= _BV(ADIE); // Enable ADC interrupt
}
// Start ADC conversion for dimmer
void dimmer_update(void) {
if (dimmer_on)
ADCSRA |= _BV(ADSC);
}
// Update brightness once ADC measurement completes
SIGNAL(SIG_ADC) {
if (!dimmer_on || displaymode == SET_BRIGHTNESS)
return;
if (ADCH > DIMMER_THRESHOLD) { // bigger number means darker room
set_vfd_brightness(BRIGHTNESS_MIN);
} else {
set_vfd_brightness(brightness_level);
}
}
**********************************************************************
Now, i assume that this is the brightness control. I also suspect that this simply turns it on as there is no mention of a menu item.
So, can i just paste this into the gps code somewhere and then somehow convert it back into something i can program back into the chip???
Or, as i suspect, am i just miles of the mark??
Please be positive and constructive with your questions and comments.