Hi, I am trying to compile the sketch below but I cannot compile or upload to the ATTINY85 chip when I choose ATTINY85 (arduino as ISP) from the board menu. The error log of Arduino IDE is also below. What is the problem?
Note: I have uploaded the Arduino ISP sketch to the uno already.
int analogPin = 3; // Data cable connected to the analog pin
int YelLED= 1; // yellow LED pin for Temp>36
int RedLED= 0; //red LED pin for Temp>40
int Fan= 2; //Fan connected to the MOSFET will be high Temp>37
float val = 0; // variable to store the value read
void setup(){
pinMode(YelLED, OUTPUT);
pinMode(RedLED, OUTPUT);
pinMode(Fan, OUTPUT);
function1(); //for the temperatures lower than 30 and higher than 25
function2(); //for the temperatures higher than 30
function3(); //for the temperatures higher than 30
}
void loop(){
float val=0;
val = analogRead(analogPin)*0.48828125;
digitalWrite(YelLED, LOW);
digitalWrite(RedLED, LOW);
digitalWrite(Fan,LOW);
if(val>=36 && val<40){
function1();}
if(val>40){
function2();
function3();}
delay(1000);
}
void function1(){ //function which should work only in 36-40 degrees
digitalWrite(YelLED, HIGH);
}
void function2(){ //funtion which should work only after 40 degrees
digitalWrite(RedLED,HIGH);
digitalWrite(YelLED, HIGH);
}
void function3(){ //funtion which should work only after 36 degrees
digitalWrite(Fan,HIGH);
//delay(3000);
}
I had that problem in the past and it was due to the wrong board. I see you use the option ATTiny85(with arduino as ISP), this never worked for me.
I had to use the master library, select in the board attiny85(8mhz internal clock) and in the programmer menu arduino as ISP. this is the only way it worked for me
Robin2:
Please don't waste people's time by posting the same question in two places.
...R
Posting the same? I deleted the previous thred and oppened here under microcontrollers section. Does it still counttwo times?? If it is still staying there and if you are the moderator, please merge them or you can delete the other...
halford:
I had that problem in the past and it was due to the wrong board. I see you use the option ATTiny85(with arduino as ISP), this never worked for me.
I had to use the master library, select in the board attiny85(20mhe external clock) and in the programmer menu arduino as ISP. this is the only way it worked for me
Thanks, I will try it tomorrow and I will post the results soon.
Robin2:
Please don't waste people's time by posting the same question in two places.
...R
Posting the same? I deleted the previous thred and oppened here under microcontrollers section. Does it still counttwo times?? If it is still staying there and if you are the moderator, please merge them or you can delete the other...
So what happened to the reply I made on the other thread?
Robin2:
Please don't waste people's time by posting the same question in two places.
...R
Posting the same? I deleted the previous thred and oppened here under microcontrollers section. Does it still counttwo times?? If it is still staying there and if you are the moderator, please merge them or you can delete the other...
So what happened to the reply I made on the other thread?
...R
Sory for the complication. you asked
Robin2:
It looks as if some library file (perhaps the core library for the Attiny85) is missing or can't be found.
What have you done to make it possible to compile code for the Atting85?
Can you provide a link to the instructions you are following?
Hi, I tried it first with 8Mhz Clock in the board menu and Blink sketch, it works!! There were some expected errors while uploading but the LED is blinking. Because I have chosen the 8Mhz as the clock speed, the LED stays on and off more then 1 sec, but it is alright!