Witam, próbuję zrobić projekt w stylu inteligenty dom i chcę sterować różnymi urządzeniami przez internet lecz nie chcę stawiać serwera bo i tak nie mam zewnętrznego IP. Pozostaje więc założyć zewnętrzny serwer i wysyłać dane na ftp w postaci plików. Byłbym wdzięczny za wskazanie jakiejś drogi (tutorial kurs cokolwiek) kod z działającym serwerem już posiadam i układ działa w pełni nie wiem natomiast jak połączyć się z serwerem wprowadzając nazwę użytkownika i hasło. Z góry dziękuje za pomoc. pozdrawiam.
Poprawiłem już kod ze strony http://tuxgraphics.org lecz mam problem z ustawieniem timera dla atmegi 16 byl bym wdzięczny za pomoc
/* setup timer T2 as an interrupt generating time base.
* You must call once sei() in the main program */
void init_cnt2(void)
{
cnt2step=0;
PRR&=~(1<<PRTIM2); // write power reduction register to zero
TIMSK2=(1<<OCIE2A); // compare match on OCR2A
TCNT2=0; // init counter
OCR2A=244; // value to compare against
TCCR2A=(1<<WGM21); // do not change any output pin, clear at compare match
// divide clock by 1024: 12.5MHz/128=12207 Hz
TCCR2B=(1<<CS22)|(1<<CS21)|(1<<CS20); // clock divider, start counter
// 12207/244=50Hz
}
// called when TCNT2==OCR2A
// that is in 50Hz intervals
ISR(TIMER2_COMPA_vect){
cnt2step++;
if (cnt2step>50){
cnt2step=0;
sec++; // stepped every second
}
}
poniżej zamieszczam błędy jakie sypie mi avr studio
../test_web_client.c:131: error: 'PRR' undeclared (first use in this function)
../test_web_client.c:131: error: (Each undeclared identifier is reported only once
../test_web_client.c:131: error: for each function it appears in.)
../test_web_client.c:131: error: 'PRTIM2' undeclared (first use in this function)
../test_web_client.c:132: error: 'TIMSK2' undeclared (first use in this function)
../test_web_client.c:132: error: 'OCIE2A' undeclared (first use in this function)
../test_web_client.c:134: error: 'OCR2A' undeclared (first use in this function)
../test_web_client.c:135: error: 'TCCR2A' undeclared (first use in this function)
../test_web_client.c:137: error: 'TCCR2B' undeclared (first use in this function)
../test_web_client.c: At top level:
../test_web_client.c:143: warning: 'TIMER2_COMPA_vect' appears to be a misspelled signal handler
Poprawiłem już kod ze strony http://tuxgraphics.org lecz mam problem z ustawieniem timera dla atmegi 16 byl bym wdzięczny za pomoc
/* setup timer T2 as an interrupt generating time base.
* You must call once sei() in the main program */
void init_cnt2(void)
{
cnt2step=0;
PRR&=~(1<<PRTIM2); // write power reduction register to zero
TIMSK2=(1<<OCIE2A); // compare match on OCR2A
TCNT2=0; // init counter
OCR2A=244; // value to compare against
TCCR2A=(1<<WGM21); // do not change any output pin, clear at compare match
// divide clock by 1024: 12.5MHz/128=12207 Hz
TCCR2B=(1<<CS22)|(1<<CS21)|(1<<CS20); // clock divider, start counter
// 12207/244=50Hz
}
// called when TCNT2==OCR2A
// that is in 50Hz intervals
ISR(TIMER2_COMPA_vect){
cnt2step++;
if (cnt2step>50){
cnt2step=0;
sec++; // stepped every second
}
}
poniżej zamieszczam błędy jakie sypie mi avr studio
../test_web_client.c:131: error: 'PRR' undeclared (first use in this function)
../test_web_client.c:131: error: (Each undeclared identifier is reported only once
../test_web_client.c:131: error: for each function it appears in.)
../test_web_client.c:131: error: 'PRTIM2' undeclared (first use in this function)
../test_web_client.c:132: error: 'TIMSK2' undeclared (first use in this function)
../test_web_client.c:132: error: 'OCIE2A' undeclared (first use in this function)
../test_web_client.c:134: error: 'OCR2A' undeclared (first use in this function)
../test_web_client.c:135: error: 'TCCR2A' undeclared (first use in this function)
../test_web_client.c:137: error: 'TCCR2B' undeclared (first use in this function)
../test_web_client.c: At top level:
../test_web_client.c:143: warning: 'TIMER2_COMPA_vect' appears to be a misspelled signal handler