Problem mit Sensirion.h

Hallo zusammen,

ich habe jetzt schon einige Stunden rumprobiert und komme nicht weiter. Habe mir im Internet folgenden Code rausgesucht:

// Experiment with time-controlled periodic transmission.
// Temperature and Humidity is sampled every 4 sec and transmitted 

#import <WProgram.h>

#define NODE 25
#define GROUP 4


#include <Ports.h>
#include <RF12.h>

#include <Sensirion.h>

//pin definitions for the SDA & SCL pins 
const uint8_t dataPin  =  18;
const uint8_t clockPin =  19;

float temperature;
float humidity;
float dewpoint;

Sensirion tempSensor = Sensirion(dataPin, clockPin);

MilliTimer sendTimer;
byte pending;
word seqnum;
char buf[20]; /* main buffer for transmission */
char buf_tmp[10]; /* temporary buffer */

//prototypes
char *ftoa(char *a, double f, int precision);


void setup () {
  pinMode(7, OUTPUT); /* led on pin 7 */
  
  rf12_initialize(NODE, RF12_433MHZ, GROUP); /* initializing radio module */
    
}

void loop () {

tempSensor.measure(&temperature, &humidity, &dewpoint);

ftoa(buf, temperature, 2);
ftoa(buf_tmp, humidity,2);
strcat(buf, "C:");
strcat(buf,buf_tmp);
strcat(buf, "RH%:");
ftoa(buf_tmp, humidity,2);
strcat(buf,buf_tmp);
strcat(buf, "Dew");
  
  if (rf12_recvDone() && rf12_crc == 0 && rf12_len == 2) {
    sendTimer.set(0);

  }
  
  
  if (sendTimer.poll(4096))
    pending = 1;
  
  if (pending && rf12_canSend()) {
    pending = 0;
     digitalWrite(7, LOW); 
    //rf12_sendStart(RF12_HDR_ACK, "hello!", 6);
    rf12_sendStart(RF12_HDR_ACK, buf, 20);
    ++seqnum;
     digitalWrite(7, HIGH); 
  }
}

//this function is  converting a float into a string 
char *ftoa(char *a, double f, int precision)
{
  long p[] = {0,10,100,1000,10000,100000,1000000,10000000,100000000};
  
  char *ret = a;
  long units = (long)f;
  itoa(units, a, 10);
  while (*a != '\0') a++;
  *a++ = '.';
  long decimal = abs((long)((f - units) * p[precision]));
  itoa(decimal, a, 10);
  return ret;
}

Nach dem Kompilieren erhalte ich folgende Fehlermeldungen:

C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp: In constructor 'Sensirion::Sensirion(uint8_t, uint8_t)':
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:82: error: 'OUTPUT' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:82: error: 'pinMode' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp: In member function 'uint8_t Sensirion::meas(uint8_t, uint16_t*, bool)':
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:131: error: 'digitalRead' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:135: error: 'delay' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp: In member function 'uint8_t Sensirion::measRdy()':
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:147: error: 'digitalRead' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp: In member function 'uint8_t Sensirion::putByte(uint8_t)':
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:235: error: 'OUTPUT' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:235: error: 'pinMode' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:238: error: 'digitalWrite' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:239: error: 'delayMicroseconds' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:240: error: 'HIGH' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:242: error: 'LOW' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:246: error: 'INPUT' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:248: error: 'digitalWrite' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:250: error: 'HIGH' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:251: error: 'delayMicroseconds' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:252: error: 'digitalRead' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:255: error: 'LOW' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp: In member function 'uint8_t Sensirion::getByte(bool)':
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:265: error: 'HIGH' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:265: error: 'digitalWrite' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:266: error: 'delayMicroseconds' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:267: error: 'digitalRead' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:268: error: 'LOW' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:271: error: 'OUTPUT' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:271: error: 'pinMode' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:272: error: 'digitalWrite' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:273: error: 'delayMicroseconds' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:274: error: 'HIGH' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:276: error: 'LOW' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:278: error: 'INPUT' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp: In member function 'void Sensirion::startTransmission()':
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:298: error: 'HIGH' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:298: error: 'digitalWrite' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:299: error: 'OUTPUT' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:299: error: 'pinMode' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:300: error: 'delayMicroseconds' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:303: error: 'LOW' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp: In member function 'void Sensirion::resetConnection()':
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:325: error: 'HIGH' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:325: error: 'digitalWrite' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:326: error: 'OUTPUT' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:326: error: 'pinMode' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:327: error: 'delayMicroseconds' was not declared in this scope
C:\Users\David\Documents\Arduino\libraries\Sensirion\Sensirion.cpp:331: error: 'LOW' was not declared in this scope

Der Programmcode liegt unter:

C:\Benutzer\David\Eigene Dokumente\Arduino\Programme\Temp_Hum_Messung\Temp_Hum_Messung.ino

Die Libraries liegen unter:

C:\Benutzer\David\Eigene Dokumente\Arduino\libraries\jeelib

und

C:\Benutzer\David\Eigene Dokumente\Arduino\libraries\Sensirion

bzw. auch unter:

D:\Arduino\arduino-1.0.5\libraries

Ich habe diese auch über Sketch -> libraries importieren eingefügt, aber irgendwie bin ich mir nicht sicher, wo die hin müssen. Kann mir bitte jemand helfen. Google-Recherche brachte mich auch nicht wirklich weiter, außer dass ich noch anderen Code fand. Am Code dürfte es aber nicht liegen, da dieser ja kopiert ist.

Vielen Dank für eure Hilfe,
David

Davduino:
Am Code dürfte es aber nicht liegen, da dieser ja kopiert ist.

Nope.
:stuck_out_tongue:

Dein Code ist für Arduino-Versionen vor 1.0 (da sehen die Versionsnummern so aus: 0021, 0022, 0023)

Und Du scheinst die Arduino-Software in der Version 1.0.5 zu verwenden.

Das passt nicht.
Am besten such Du Dir eine aktuelle Library zum Kopieren statt so ein Zeugs aus der Arduino-Steinzeit!

Also ich habe jetzt weiter recherchiert. Mir wurde ein RF FSK Shield Rev B in die Hand gedrückt und ein Adaptive Design Sensor V1.1 2009 und ich soll was daraus machen...

http://altelectronics.co.uk/shop/arduino/arduino-fsk-rf-shield-315-/-433-92-/-868-/-915-mhz-v2-0/prod_78.html?review=write
http://altelectronics.co.uk/shop/arduino/temperature-humidity-sensor/prod_79.html

Kann es sein, dass die beiden Teile ziemlich veraltet sind und dafür kein Arduino 1.0.5 Code existiert? Ich komme nicht weiter. Könnte mir bitte jemand einen Tipp geben, wie ich weiter arbeiten könnte?

Ersetze mal <WProgram.h> durch <Arduino.h>. Dann musst du wahrscheinlich noch ein paar andere Funktionen anpassen (in den Dateien die du included hast und deren cpp Dateien). In der Wire Lib wurde z.B. send durch write ersetzt. Aber im Prinzip sollte sich das umbiegen lassen.

Hier z.B.:
http://wyolum.com/upgrading-to-arduino-1-0/

Wird sehr wahrscheinlich helfen !
In der messenger-lib steht das z.B. auch noch so/falsch drin.