rodrigoaviador
Cirrus
Há fazer.... tenho que apagar o 1.0.1???
começou a passar dados.. vou ver melhorrrr
Há fazer.... tenho que apagar o 1.0.1???
Faz download da versão 022:
http://arduino.cc/hu/Main/Software
faz com este
Código:/******* Sketch to test Input Capture interrupt handling ********************************* functionality: measure length of pulses on the ICP pin with precision of 0.5 microseconds Show the min and max pulse widths in microseconds on the serial port **************************************************************************************************************/ #include <stdio.h> // for verbose debugging using sprintf #define icpPin 8 // ICP input pin on arduino #define outPin 2 // output pin that will shadow the input, can be monitored with a scope // some variables to help see that something is happening in the interrupt handlers volatile unsigned int Value; // this stores the current ICR1 value volatile unsigned int MinValue; volatile unsigned int MaxValue; volatile unsigned int Overflows; volatile unsigned int PulseCount; /* Overflow interrupt vector */ ISR(TIMER1_OVF_vect){ // here if no input pulse detected Overflows++; // incriment overflow count } /* ICR interrupt vector */ ISR(TIMER1_CAPT_vect){ TCNT1 = 0; // reset the counter if( bit_is_set(TCCR1B ,ICES1)){ // was rising edge detected ? digitalWrite(outPin,HIGH ); // yes, set our output pin high to mirror the input } else { // falling edge was detected Value = ICR1; // save the input capture value digitalWrite(outPin,LOW ); // set our output pin low to mirror the input PulseCount++; if(Value < MinValue) // update min or max values as appropriate MinValue = Value; if (Value > MaxValue) MaxValue = Value; } TCCR1B ^= _BV(ICES1); // toggle bit value to trigger on the other edge } void setup() { Serial.begin (19200); pinMode(outPin, OUTPUT); // declare the ledPin as an OUTPUT pinMode(icpPin, INPUT); // ICP pin (digital pin 8 on arduino) as input MinValue = 30000; // Initialise with extreme values MaxValue = 0; TCCR1A = 0 ; // this register set to 0! TCCR1B =_BV(CS11); // NORMAL MODE!!, prescaller 8, rising edge ICP1 - this works TCCR1B |= _BV(ICES1); // enable input capture TIMSK1 = _BV(ICIE1); // enable input capture interrupt for timer 1 TIMSK1 |= _BV(TOIE1); // enable overflow interrupt to detect missing input pulses Serial.print("Finished setup\r\n"); } // this loop prints the number of pulses in the last second, showing min and max pulse widths void loop() { char buffer[80]; // show the captured data, divide pulse widths by 2 to display time in microseconds sprintf(buffer,"Got %d pulses: min=%d, max=%d (%d timer overflows)\r\n", PulseCount, MinValue / 2, MaxValue / 2, Overflows); Serial.print(buffer); // send the info to the serial port /* reset variables ready for the next reading */ PulseCount = Overflows = 0; // reset counts MinValue = 30000; // set values to extremes MaxValue = 0; delay(1000); } // wait 1 second for next update
Mudaste o baud rate na consola?
O problema pode ser de muita coisa..mas sem mais informações não te posso ajudar..
-Estás ligando directamente ao receptor RF da consola (e não o pluviómetro ou anemometro), correcto? De certeza que tens isso bem ligado?
-Que resultados tens no Serial Monitor usando aquele código que meti aqui no forum? Copia para aqui os resultados de 3/4 minutos. Aquele código que dei não é para funcionar com o Cumulus, serve apenas para verificar os dados recebidos pelo PIN 8 do Arduino.
-A que distancia estás a testar? O pluviometro e o anemometro devem estar junto da consola para fazer testes.
Não precisas de mudar o driver quando usas outra versão do Arduino.
Sim, está ligado diretamente da estação, do receptor ( consola )
Sim, está bem plugado e varias vezes verificado isso.
o anemometro e o pluviometro, estão no telhado, a uns 15 metros da consola. os dados recebidos pelo código que passastes, estõ codificados
EX sfgsty223 aaa
gadtyq n h334hnwj
Terei que levar um not book para telhado então???
Sim, está ligado diretamente da estação, do receptor ( consola )
Sim, está bem plugado e varias vezes verificado isso.
o anemometro e o pluviometro, estão no telhado, a uns 15 metros da consola. os dados recebidos pelo código que passastes, estõ codificados
EX sfgsty223 aaa
gadtyq n h334hnwj
Terei que levar um not book para telhado então???
Se estão codificados é porque tens o baudrate errado no Serial Monitor, muda para 19200. Apenas com os dados 3/4 minutos consigo saber se estás a receber ou não pacotes dos sensores.
logo depois, coloquei a estação ( comsole ) mais perto do receptor, e tive isso.
ai instalei o cumlus 132, data logger e o data loger está a receber, menos o cumulus
Finished setup
Got 0 pulses: min=15000, max=0 (0 timer overflows)
Got 68 pulses: min=4, max=7856 (0 timer overflows)
Got 66 pulses: min=5, max=7817 (0 timer overflows)
Got 61 pulses: min=4, max=7816 (0 timer overflows)
Got 65 pulses: min=5, max=7817 (0 timer overflows)
Got 64 pulses: min=5, max=7817 (0 timer overflows)
Got 69 pulses: min=4, max=7854 (0 timer overflows)
Got 65 pulses: min=5, max=7820 (0 timer overflows)
Got 62 pulses: min=5, max=16633 (0 timer overflows)
Got 65 pulses: min=5, max=7816 (0 timer overflows)
Got 63 pulses: min=5, max=7822 (0 timer overflows)
Got 63 pulses: min=4, max=7845 (0 timer overflows)
Got 63 pulses: min=5, max=7829 (0 timer overflows)
Got 64 pulses: min=5, max=7825 (0 timer overflows)
Got 64 pulses: min=4, max=7829 (0 timer overflows)
Got 63 pulses: min=5, max=7816 (0 timer overflows)
Got 64 pulses: min=6, max=7945 (0 timer overflows)
Got 64 pulses: min=5, max=8785 (0 timer overflows)
Got 72 pulses: min=4, max=8262 (0 timer overflows)
Got 62 pulses: min=5, max=8449 (0 timer overflows)
Got 62 pulses: min=5, max=7827 (0 timer overflows)
Got 66 pulses: min=5, max=7816 (0 timer overflows)
Got 63 pulses: min=4, max=7815 (0 timer overflows)
Got 62 pulses: min=5, max=7806 (0 timer overflows)
Got 60 pulses: min=7, max=7810 (0 timer overflows)
Got 63 pulses: min=5, max=16659 (0 timer overflows)
Got 62 pulses: min=5, max=16660 (0 timer overflows)
Got 65 pulses: min=5, max=7805 (0 timer overflows)
Got 60 pulses: min=5, max=7787 (0 timer overflows)
Got 64 pulses: min=4, max=7807 (0 timer overflows)
Got 65 pulses: min=5, max=7856 (0 timer overflows)
Got 70 pulses: min=5, max=7849 (0 timer overflows)
Got 72 pulses: min=6, max=8529 (0 timer overflows)
Got 61 pulses: min=5, max=7787 (0 timer overflows)
Got 61 pulses: min=5, max=7825 (0 timer overflows)
Got 63 pulses: min=5, max=7798 (0 timer overflows)
Got 61 pulses: min=6, max=7813 (0 timer overflows)
Got 68 pulses: min=4, max=7819 (0 timer overflows)
Got 62 pulses: min=5, max=7815 (0 timer overflows)
Got 61 pulses: min=5, max=7817 (0 timer overflows)
Got 62 pulses: min=4, max=7835 (0 timer overflows)
Got 66 pulses: min=5, max=7835 (0 timer overflows)
Got 63 pulses: min=5, max=7874 (0 timer overflows)
Got 61 pulses: min=5, max=7758 (0 timer overflows)
Got 65 pulses: min=5, max=7845 (0 timer overflows)
Got 63 pulses: min=4, max=7796 (0 timer overflows)
Got 62 pulses: min=5, max=7817 (0 timer overflows)
Got 69 pulses: min=5, max=7859 (0 timer overflows)
Got 79 pulses: min=5, max=16632 (0 timer overflows)
Got 65 pulses: min=4, max=8241 (0 timer overflows)
Got 61 pulses: min=5, max=16653 (0 timer overflows)
Got 60 pulses: min=8, max=7586 (0 timer overflows)