Hi,
ich will ein kleines elektro “Spielzeug”-Auto bauen und benutze zum fernsteuern ein ATtiny84 (A PU), doch beim uploaden erscheint ein Fehler.
1.) Wie erkenne ich welche clock mein ATtiny hat?
2.) Wie behebe ich den Fehler?
Ein paar Informationen:
- Ich bin ein Anfänger
- Ich nutze die Arduino Duemillanove
- Ich arbeite nach dieser Anleitung: fluuux.de - This website is for sale! - fluuux Resources and Information.
- Ich habe WinAVR installiert
- Ich arbeite mit der Arduino Software Version: 1.0.5
Das ist der Code:
#include <VirtualWire.h>
#include <VirtualWire_Config.h>
const int LEDPin_rc = 10;
//const int LEDPin_power = 9;
const int TransmitterPin = 8;
const int ButtonPin_rc = 1;
const int PotiPin_speed = 7;
const int PotiPin_direction = 6;
int speed = 0;
int direction = 0;
int last_speed = 0;
int last_direction = 0;
boolean rc = true;
boolean last_rc = true;
char *message;
String message_convert;
void setup() {
pinMode(LEDPin_rc, OUTPUT);
//pinMode(LEDPin_power, OUTPUT);
pinMode(TransmitterPin, OUTPUT);
pinMode(ButtonPin_rc, INPUT);
pinMode(PotiPin_speed, INPUT);
pinMode(PotiPin_direction, INPUT);
//digitalWrite(LEDPin_power, HIGH);
vw_set_ptt_inverted(true);
vw_setup(2000);
vw_set_tx_pin(TransmitterPin);
}
void loop() {
speed = analogRead(PotiPin_speed);
direction = analogRead(PotiPin_direction);
rc = analogRead(ButtonPin_rc);
if(rc != last_rc) {
message = "rrrr";
vw_send((uint8_t *)message, strlen(message));
vw_wait_tx();
last_rc = rc;
}
if(rc) {
analogWrite(LEDPin_rc, HIGH);
if(last_speed != speed) {
message_convert = String(0000 + ((speed / 2) - 256));
message_convert.toCharArray(message, 4);
last_speed = speed;
vw_send((uint8_t *)message, strlen(message));
vw_wait_tx();
} else if(last_direction != direction) {
message_convert = String(0000 + ((direction / 57) + 300));
message_convert.toCharArray(message, 4);
last_direction = direction;
vw_send((uint8_t *)message, strlen(message));
vw_wait_tx();
}
} else {
analogWrite(LEDPin_rc, LOW);
}
}
Beim uploaden kommt folgender Fehler:
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny84
avrdude: stk500_program_enable(): protocol error, expect=0x14, resp=0x50
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51
Schon mal danke im voraus.
MfG,
- Paul