Ich erstelle einen drahtlosen Sensor mit einem Attiny85. Ich möchte die Daten an ein Arduino Uno senden, also habe ich das 315-MHz-HF-Link-Kit von Spark Fun gekauft. Da der Attiny85 keinen TX hat, habe ich mich für die Verwendung der Manchester-Bibliothek entschieden, die jedoch auf dem Attiny85 nicht kompiliert werden kann.
Ich habe die Schritte in diesem Blog befolgt: http://mchr3k-arduino.blogspot.mx/2012/01/wireless-sensor-node-part-2.html?showComment=1338749638806#c853067277980266192
Hier ist der Code, den ich verwende:
#include <WProgram.h> //otherwise it says it can't find Arduino.h
#include <Manchester.h> //include the library to comunicate
#define TxPin 2 //the pin that is used to send data
int sensorPin = 4;
int ledPin = 3;
int count = 50;
void setup(){
pinMode (ledPin, OUTPUT);
man.workAround1MhzTinyCore(); //add this in order for transmitter to work with 1Mhz Attiny85/84
man.setupTransmit(TxPin, MAN_1200); //set transimt pin
}
void loop(){
if (count == 50){
digitalWrite (ledPin, HIGH);
count = 0;
}
int data = analogRead(sensorPin);
man.transmit(data); //transmits and reads the data
delay (100);
count ++;
}
Hier ist die Fehlermeldung:
/Users/joelsimonoff/Documents/Arduino/libraries/MANCHESTER/Manchester.cpp: In function 'void MANRX_SetupReceive(uint8_t)':
/Users/joelsimonoff/Documents/Arduino/libraries/MANCHESTER/Manchester.cpp:366: error: 'TCCR2A' was not declared in this scope
/Users/joelsimonoff/Documents/Arduino/libraries/MANCHESTER/Manchester.cpp:366: error: 'WGM21' was not declared in this scope
/Users/joelsimonoff/Documents/Arduino/libraries/MANCHESTER/Manchester.cpp:368: error: 'TCCR2B' was not declared in this scope
/Users/joelsimonoff/Documents/Arduino/libraries/MANCHESTER/Manchester.cpp:368: error: 'CS21' was not declared in this scope
/Users/joelsimonoff/Documents/Arduino/libraries/MANCHESTER/Manchester.cpp:369: error: 'OCR2A' was not declared in this scope
/Users/joelsimonoff/Documents/Arduino/libraries/MANCHESTER/Manchester.cpp:379: error: 'TIMSK2' was not declared in this scope
/Users/joelsimonoff/Documents/Arduino/libraries/MANCHESTER/Manchester.cpp:379: error: 'OCIE2A' was not declared in this scope
/Users/joelsimonoff/Documents/Arduino/libraries/MANCHESTER/Manchester.cpp:380: error: 'TCNT2' was not declared in this scope