Cheapest Attiny85?

Hi, I am planing to buy a Attiny85 to make a led pov display. I live in India So can you tell me where I can Find cheapest Attiny85with free delivery in Internet??

Question by Soumojit   |  last reply

attiny85 problems

OK so I recently discovered the ATTiny85 microcontroller and have though of many ways to use it.  After figuring out how to program it, I began testing its limits.  The pins I have been able to use so far are; VCC+GND (obviously), Reset, PWM 0+1, and A1.  A2+A2 however, I have not been able to use as analog input.  Does anyone know why?  I am using a Mac and arduino uno as ISP if that makes any difference.  Any help would be greatly appreciated.  P.S.  I'm pretty new to this, so please use simple language :)

Topic by dudes   |  last reply

ATtiny85 Supported Commands? Answered

Lately i have had a problem with certain sketches not working correctly on an ATtiny85-20PU. The blink sketch works fine on the ATtiny85 but this sketch below will not, also this sketch below does work correctly on an Arduino board. The list of supported commands for ATtiny85 are pinMode() digitalWrite() digitalRead() analogRead() analogWrite() shiftOut() pulseIn() millis() micros() delay() delayMicroseconds() Also the Arduino reference page is  The one possible thing i can see as not being supported might be "  round  " on line 33 causing this sketch to not work properly. I do not know this for a fact as i can not actually find anything that is not supported. Do you know if " round " is a hang up for ATtiny85's? . //int IRSense = A0;  //For ATnega328 int IRSense = 2;  // For ATtiny85 //int IRTrans = 9;  // For ATnega328 int IRTrans = 3;  // For ATtiny85 //int LED1 = 10;    // For ATmega328 int LED1 = 4;     // For ATtiny85 int valueAmbient = 0; void setup() { pinMode(IRSense, INPUT); pinMode(IRTrans, OUTPUT); //Serial.begin(9600); digitalWrite(IRTrans,LOW); pinMode(LED1,OUTPUT); } void ambient() { digitalWrite(IRTrans,HIGH); delay(20); valueAmbient = analogRead(IRSense); delay(20); } void loop() { ambient(); digitalWrite(IRTrans,LOW); delay(20); int value = analogRead(IRSense); int value2 = round(value - valueAmbient); int dist = (((value2+15.0)/(value2*(value2+100.0)))*2000.0); if (dist <= 10){    digitalWrite(LED1,HIGH); } else { digitalWrite(LED1,LOW); } //Serial.print(dist); //Serial.print("cm."); //Serial.println(""); delay(20); }

Question by WWC   |  last reply

ATTiny85 programming error

Hi everyone, I'm having a bit of trouble with programming an ATTiny85 using an Arduino Uno.  I've previously been able to program them quite easily using the method shown here;   I've tried using both a homemade programming shield and wiring a breadboard, but I get the same error each time; avrdude: Yikes!  Invalid device signature.          Double check connections and try again, or use -F to override          this check. I don't know what this means or how to fix it.  I know my wiring is good, the breadboard is at least quadruple checked and I have used the shield many many times before.  Any suggestions or ideas? ~Dudes

Topic by dudes   |  last reply

I2C addresses > 63 are not usable with atTiny85?

Hi I have a big problem with addressing multiple attiny85-chips with I2C: For what I know the attiny uses 7-bit addresses for communication. I am using the TinyWireS lib, which works perfectly fine for me, untill I am reaching address: '64' which is '1000000' in binary. The highest usable address should be '1111111'. Here is the attiny85 datesheet. This is what happens: Slave: Attiny85: switches led on or off when msg is received over I2C. Slaveaddress: 64 #include #include #define output (4) #define I2C_SLAVE_ADDR (64) //works if I2C_SLAVE_ADDR < 64 void setup() {   TinyWireS.begin(I2C_SLAVE_ADDR);   pinMode(output, OUTPUT); } volatile bool state = LOW; void loop() {   byte msg = -1;   if(TinyWireS.available())     msg = TinyWireS.receive();   if(msg == 1)     state = HIGH;   else if(msg == 0)     state = LOW;   else if(msg == 2)     state = !state;   digitalWrite(output, state); } Master: Arduino pro mini: sendMsg(0, true); //works! led on chip: 64 switches on sendMsg(64, true); //fails! led on chip: 64 is off. #include #define DEVICE (64) //0 works! void setup() {     Wire.begin(); } void loop() {     sendMsg(1, DEVICE);     delay(2000);     sendMsg(0, DEVICE);     delay(2000); } void sendMsg(int msg, int device) {     Wire.beginTransmission(device);     Wire.write(msg);     Wire.endTransmission(); } Have you any idea how to solve this problem?

Question by DELETED_MakiY2   |  last reply

on attiny85 chip, how to control servo motor with IR sensor?

Hi i would like to know the coding which is to control servo motor for using IR sensor on attiny85 chip. i can do with arduino but attiny85 is not same as it. what i want to control is simple press button (0x01FE847B) to move servo motor 180 degree press button (0x01FE44BB)to move servo motor 0 degree please help me

Topic by kclook   |  last reply

how to control servo motor for using IR sensor on ATTINY85??

Hi i would like to know the coding which is to control servo motor for using IR sensor on attiny85 chip. i can do with arduino but attiny85 is not same as it. what i want to control is simple  press button (0x01FE847B) to move servo motor 180 degree press button (0x01FE44BB)to move servo motor 0 degree please help me

Topic by kclook 

attiny85 tilt switch dc motor

Hello my project consists of an attiny85 with an led a dc motor a tilt switch and  a button. the button changes the pwm values and the led goes to the same values to know the strength of pwm.  the tilt switch will activate the dc motor at the corresponding pwm speed based on how many times the button is pressed. here is my code const int inPin = 3;         // tilt switch or button to trigger dc motor const int outPin = 1;       // dc motor const int buttonPin = 2; //button to change pwm const int ledPin = 0; // led to know the state of pwm int pwmvalue = 255; int buttonPushCounter = 0; int buttonState = 0; int lastButtonState =0; int LEDstate = HIGH;      // the current state of the output pin int reading;           // the current reading from the input pin int previous = LOW;    // the previous reading from the input pin // the follow variables are long's because the time, measured in miliseconds, // will quickly become a bigger number than can be stored in an int. long time = 0;         // the last time the output pin was toggled long debounce = 50;   // the debounce time, increase if the output flickers void setup() {   pinMode(buttonPin, INPUT);   pinMode(ledPin, OUTPUT);   pinMode(inPin, INPUT);   digitalWrite(inPin, HIGH);   // turn on the built in pull-up resistor   pinMode(outPin, OUTPUT); } void loop() { buttonState = digitalRead(buttonPin); if (buttonPushCounter == 1) {   (pwmvalue == 255);}   if (buttonPushCounter == 2) {   (pwmvalue == 180);}   if (buttonPushCounter == 3) {   (pwmvalue == 110);}   if (buttonPushCounter == 4) {   (pwmvalue == 70);}   // compare the buttonState to its previous state   if (buttonState != lastButtonState) {     // if the state has changed, increment the counter     if (buttonState == HIGH) {       // if the current state is HIGH then the button       // wend from off to on:       buttonPushCounter++;           } else {       // if the current state is LOW then the button       // wend from on to off:           }     // Delay a little bit to avoid bouncing     delay(50);   }   // save the current state as the last state,   //for next time through the loop   lastButtonState = buttonState;   // turns on the LED every four button pushes by   // checking the modulo of the button push counter.   // the modulo function gives you the remainder of   // the division of two numbers:   if (buttonPushCounter % 0 == 0) {     analogWrite(ledPin,pwmvalue);   }   if (buttonPushCounter % 1 == 0) {       analogWrite(ledPin,pwmvalue);   }   if (buttonPushCounter % 2 == 0) {       analogWrite(ledPin,pwmvalue);   }   if (buttonPushCounter % 3 == 0) {       analogWrite(ledPin,pwmvalue);   }       int switchstate;   reading = digitalRead(inPin);   // If the switch changed, due to bounce or pressing...   if (reading != previous) {     // reset the debouncing timer     time = millis();   }   if ((millis() - time) > debounce) {      // whatever the switch is at, its been there for a long time      // so lets settle on it!      switchstate = reading;      // Now invert the output on the pin13 LED     if (switchstate == HIGH)       LEDstate = LOW;     else       LEDstate = HIGH;   } LEDstate = HIGH == pwmvalue;     digitalWrite(outPin, pwmvalue);   // Save the last reading so we keep a running tally   previous = reading;   } is my code written correctly for my purpose is there anything i could have written better? its compiling without any problems andni havn't been able to upload because i ust back into arduino and im waiting for my attinys to come in. thank you guys for reading.

Question by wesm4   |  last reply

Can't properly flash Attiny85, please help.

I have working proto of a bathroom exhaust fan controlled by methane sensor via arduino uno. I now wish to transfer this sketch to an ATtiny85 (cause i had extras). I have programmed ATtiny before, and can successfully get 'blink' going on this specific MCU. However I cannot get my sensor sketch to work properly... Perhaps I am asking too much of this little guy? I am including my code and video in hopes that someone can steer me in the right direction.  /*   AT85      Arduino    Circuit   0 (PB5)   A0             pin 3 of 50k pot   2 (PB7)   ~9             led or relay     Trim Pot        1              GND   2              GND   3              Arduino (attiny) & Sensor B1     Sensor   A1             +5VDC   H1             GND   GND            GND   B1             Trim Pot 3   */   const int numReadings = 10;    // average sensor reading used from 10 samples int ledPin = 1;                  // replaced ac/dc relay with led to debug int readings[numReadings];      // the readings from the analog input int index = 0;                  // the index of the current reading int total = 0;                  // the running total int average = 0;                // the average int inputPin = 0;    //reading from sensor unsigned long start_time; unsigned long current_time; unsigned long elapsed_time; void setup() {   // sets digital pin 1 to output   pinMode(ledPin, OUTPUT);     // sets analog 0 to input   pinMode(inputPin, INPUT);   // initialize all the readings to 0:   for (int thisReading = 0; thisReading < numReadings; thisReading++)     readings[thisReading] = 0;          } void loop() {         // 10 sample average used to prevent false positive from a bounce and/or spike         // subtract the last reading:   total= total - readings[index];           // read from the sensor:    readings[index] = analogRead(inputPin);   // add the reading to the total:   total= total + readings[index];         // advance to the next position in the array:    index = index + 1;                      // if we're at the end of the array...   if (index >= numReadings)                  // ...wrap around to the beginning:     index = 0;                             // calculate the average:   average = total / numReadings;           // send it to the computer as ASCII digits          delay(1000); // delay in between reads for stability                    int threshold = 300;                  // sets the threshold value   if(average > threshold){  // determines if the level of methane breaks threshold         start_time = millis();      // starts exhaust fan on 5 min timer     digitalWrite(ledPin, HIGH);      do  {       current_time = millis();      // defines the 5 minute timer       elapsed_time = current_time - start_time;     }     while(elapsed_time < 300000); // 5 min. countdown   }     if(average < threshold){      // sensor is checked against threshold       digitalWrite(ledPin, LOW);  // fan turns off if sensor value below threshold     }                             // or stays on until it is below threshold     } thanks in advance!

Question by earthtown   |  last reply

Is there a way to save data onto an ATTINY85 chip, separate from your C program?

Hey everyone, this is my first post and I am not quite sure how to word this, so please bear with me. :) Here is the  ATTINY85 datesheet Basically, the long and short of it is, I made a simple USB HID Programmable Key-stroker Device. I used Macetech's capslocker for inspiration on the circuit design and then wrote my own program in C. Capslocker Design (Basically this design exactly except I have also added two zener diodes for voltage regulation on both USB data lines and a programming header) : However, instead of just sending Capslock on and off (like the Capslocker), this one allows you to send strings of text, combinations of keys, can switch to a mouse and I am currently adding a wireless receiver and RF remote trigger the device with the press of a button to mess with my boss. Currently, if I want to change the keystrokes or mouse movements I have to recompile and then burn the new software onto the ATtiny85 device. Instead, I am looking for an easier way to go about modifying the keystrokes that are saved on the device. Is there anyway to save data to a specific part of the ATTINY that would not require recompiling each time I wanted to update the recorded keystrokes? Or maybe a way to save a text file onto an ATTINY85 device that the C program could load? If not could this be done with an EEPROM? I have programming experience but I am reallllly green when it comes to AVR stuff, so I am not even sure what I should be looking for to accomplish this. Any nudge in the right direction would be appreciated. Thanks for reading and I love this community I have been lurking for quite some time and your posts have helped me quite a bit!

Question by DELETED_MakiY2   |  last reply

add an external crystal to attiny85?

How can i add a 16mhz crystal to attiny85? i dont know how and cant find it online

Question by fossilshark   |  last reply

adding an external crystal to attiny85?

How can i add an external crystal to run at 16 mhz to my attiny85? can someone please tell me step by step what to do i have searched everywhere and cannot find the answer. thanks.

Question by fossilshark   |  last reply

Bluetooth (HC-06) with ATtiny85

Hi everyone,      I've been playing around with the HC-06 Bluetooth module for a while now and have had great success with it so far.  However, I have been using the Arduino Uno and Pro Mini, which have quite a few unused pins in my applications.  In order to downsize I'm trying to use the Atmel ATtiny85 chip.  I have used it many times in the past so I'm at least a bit familiar with its functions and limits.  For some reason I cannot get the Bluetooth module to work with the ATtiny85.  After many long and frustrating hours spent in vain, I decided to ask you all for help.  Does anyone know of any good tutorials or code for using the ATtiny85 with the HC-06 module?  It would be great if I could use the app Ardudroid to control the ATtiny85, but any help would be greatly appreciated.   Thanks ~Dudes

Topic by dudes   |  last reply

Is there somewhere to get attiny85 codes?

I'm wondering if there are any sites for attiny85 codes?  Like I know there are fireflies and traffic light codes and such by people here on instructables.  Is there a list of all these somewhere? 

Topic by aliasjanedoe   |  last reply

ATtiny85 memory and ATtiny2313 memory?

Ok I just looked at the datasheets for my ATtiny85 and my recently bought ATtiny2313. The 2313 has 20 pins, and the 85 has 8. What I don't get is the ATtiny85 has 8000 bytes of memory and the ATtiny2313 only as 2000 bytes of memory!!? Why does the ATtiny85 have significantly more memory and it's only 1/3 the size of the ATtiny2313? I know this sounds silly but why? How can I find other chips like ATtiny2313 but with more memory? Thanks!

Topic by HavocRC   |  last reply

What is the input value on an atTiny85

I am programming an atTiny with Arduino as the ISP and am wondering if an analogRead will come out between 0 and 1023 like arduino or a different value such as exact voltage or a different reference.  

Question by stino66   |  last reply

what does the number on ATTINY85 mean?

Are all ATTINY85 20PU the same?  I've noticed different seller's pictures have different numbers printed on them.  What do these mean?

Topic by aliasjanedoe   |  last reply

is it possible to make a tv b gone with an attiny85 20pu?

I have a few at the house. i am programming with an arduino uno as isp. all the examples i can find uses an ATtiny85V -10.

Question by rtalley   |  last reply

How do I replace the board of a flashlight with a customized perfboard to set up an invidual On/Off frequency? Answered

I am currently  customizing the a flash light (customized intervals between on&off;). To program the individual frequency I made use of an attiny 85 microcontroller that has been programmed making use of an arduino. On a breadboard my experiment worked well. I have attached the pins of the attiny 85 as follows: Pin8: Long lead LED & + side of the battery; Pin5: Small lead LED; Pin 4: - side of the battery; To realize this experiment for a torch light I have disassembled a torch light and replaced the board with a self-made one making use of a perfboard. Well if I attached the red wire (of an external battery box) to pin 8 and the black wire (of an external battery box) to pin 4 of the attiny85 the torch works well. However I wanted to replace the board and it should work the way it worked before with the programmed mode making use of the battery of the torch light as power source. The battery within the torch light is placed on the back side. There only the plus side of the battery touches the spring and this gets again in touch with the self made perfboard. Here I am aware that the energy wlil flow through the spring to the soldered microcontrller. Hence alle soldered and connected pins of the attiny 85 will have the voltage of the battery. However I cannot determine certain pins to be charged and some not to be...( here I think I am missing a point) The problem I experience is that only the plus side of the battery, placed in the torch light, gets in touch with the perfboard. The torch light does not work using my perfboard. I know for sure that the torch will work if both the plus and the minus side of the battery are attached to the microcontroller(pin 4/8). However the initial torch light was also attached only to the plus side of the battery, and it did work. I don't know how. I am pretty sure that there something wrong with my plan or my I do think little naively, can you give some suggestions?

Question by sathees31   |  last reply

I need a relay to run from an ATtiny85 chip.?

I need a relay that can be switched from an ATtiny85 chip output pin, and can be used at 120V AC and 15A. Otherwise I will need to use a transistor, but hopefully I won't. What about the ATMEGA328 instead of the ATtiny85? Thanks guys and gals.

Question by Geniusdude   |  last reply

Problem with ATtiny85 IR controlled LED

I am making a LED Light Stick with IR control to change the colour. Uploaded the schematics I made. Is there any mistake ? Do i misunderstand anything ? If yes, please forgive me, I am a complete noob and here to learn. I am going to add a 5v regulator to the Attiny85 power supply. And 380ohm resistor from pin5,6,7 to the corresponding transistor's base pins. I planned to use S8050 NPN transistor. How i calculate the things: 1. The RGB LED Strips i using is rated at 15W/metre @ 5V . Power supply i am using is 6V which is 4xAAA battery .I apply P=IV and get 2.5A/metre of current. Then I calculate current used in 60cm of LED Strips (2.5/100*60) and I get 1.5A current per 60cm. I devided the value by 3 and get 0.5A for each Red, Green and Blue pin. 2. Next step, I found the S8050 DC current gain (hFE/Beta) which is 40 and apply the formula Ic/Ib = B (Ic = 0.5A , Ib = unknown, B=40). I get the Ib of 0.0125A. Which mean i need 0.0125A of current in order to Fully-On the transistor at Ic=0.5A @ 6V. 3.To find the resistor value from Attiny85's Pin, I apply formula Ib = (Vb-Vbe)/Rb (Ib=0.0125, Vb=5 because the power supply of Attiny85 is 5v not 6v , Vbe=0.7V , Rb = Unknown) and i get value of Rb = 376ohm approximate to 380ohm. Another issue is that i didn't really know how to write the code. analogWrite seem didn't work for ATtiny85 sincce there's just 2 analog output for the controller. Or delayMicroseconds will work ? But i could'nt figure out how to write the code. I am very new to arduino. I know i should start at the basic first but i really need to get this project done. And please forgive my language. I didn't know English very well. Thanks a lot.

Topic by Sooncheng 

Why is the ATtiny85 more expensive than the ATmega328? What? Answered

I only need 2 I/O pins, but if I can get it cheaper with the 328 then why not?  Can anyone find the tiny for under 5 bucks with shipping?

Question by Spaceman Spiff   |  last reply

I need a mini-arduino! Help with finding one!

Hey guys! I had a question! I got several ATtiny85s and they were great! I was able to use my Arduino Sketches and my use Arduino to upload the code to them. But now I have a new project and I need more then 2 outputs! I need another microcontroller just like the Attiny85 but with say 4-10 outputs. Any sugggestions? Oh, I have to be able to use my Arduino sketches with it, so I can't use things like the picaxe thingy. I also don't want to buy a miniduino or microduino. Thanks!

Topic by HavocRC   |  last reply

how do i code a pattern of leds on a attiny 85?

I am making a prop and i need to embed a attiny to run 3 leds in a specific pattern, here is the patterm led 2 on for .75 seconds  led 3 on for .75 seconds  that pattern repeated 3 times then led 1 on for a half a seconds  then 2 on for 1/2  then 3 on for 1/2  that repeated twice then the whole thing restarted  i dont so much want some code i want to learn how to do it please help

Question by Jonny1128   |  last reply

attiny85 on two 3v coin cell batteries?

I've seen specs for attiny85 that say 6v, but most say 5.5v max, so I'm wondering if it's safe to use two 3v coin cell batteries to power them?  Such as CR2032 or CR2450.  I would only use one, but I need 4.5v for my LEDs.  Three AA is too bulky.  Thanks.

Topic by aliasjanedoe   |  last reply

Why isn't my ATTiny85 accepting this SoftwareSerial???!? Answered

My code is from the IR Cloud light instructable. I am trying to place a smaller, more abbreviated code into an ATTiny85. The tutorial written by MIT says we can put SoftWareSerial on it (reference: But anyway, Code: #include int RECV_PIN = 0; int green = 4; int yellow = 2; int blue = 3; int white = 1; #define powercode 16712445 #define stormcode 16745085                 IRrecv irrecv(RECV_PIN); decode_results results; void setup() {   pinMode(green, OUTPUT);     pinMode(yellow, OUTPUT);         pinMode(blue, OUTPUT);             pinMode(white, OUTPUT);   irrecv.enableIRIn(); // Start the receiver } int whitebool = 0; int rainbool = 0; int yellowbool = 0; int bluebool = 0; int greenbool = 0; unsigned long last = millis(); void loop() {   if (irrecv.decode(&results;)) {                      //Sun if (results.value == 16712445) {       if (millis() - last > 250) {         whitebool = !whitebool;         digitalWrite(white, whitebool ? HIGH : LOW);       }       last = millis();     }     //red       if (results.value == 16745085) {       if (millis() - last > 250) {         greenbool = !greenbool;         digitalWrite(green, greenbool ? HIGH : LOW);       }       last = millis();     } //yellow     if (results.value == 16726725) { // Sun up       // If it's been at least 1/4 second since the last       // IR received, toggle the relay       if (millis() - last > 250) {         yellowbool = !yellowbool;         digitalWrite(yellow, yellowbool ? HIGH : LOW);       }       last = millis();     } //blue         if (results.value == 16759365) { // Sun up       // If it's been at least 1/4 second since the last       // IR received, toggle the relay       if (millis() - last > 250) {         bluebool = !bluebool;         digitalWrite(blue, bluebool ? HIGH : LOW);       }       last = millis();     }     irrecv.resume(); // Receive the next value   }     } And error : /Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp: In member function 'void IRsend::mark(int)': /Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:227: error: 'TCCR2A' was not declared in this scope /Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:227: error: 'COM2B1' was not declared in this scope /Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp: In member function 'void IRsend::space(int)': /Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:235: error: 'TCCR2A' was not declared in this scope /Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:235: error: 'COM2B1' was not declared in this scope /Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp: In member function 'void IRsend::enableIROut(int)': /Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:253: error: 'TIMSK2' was not declared in this scope /Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:263: error: 'TCCR2A' was not declared in this scope /Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:263: error: 'WGM20' was not declared in this scope /Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:263: error: 'TCCR2B' was not declared in this scope /Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:263: error: 'WGM22' was not declared in this scope /Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:263: error: 'CS20' was not declared in this scope /Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:263: error: 'OCR2A' was not declared in this scope /Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:263: error: 'OCR2B' was not declared in this scope /Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp: In member function 'void IRrecv::enableIRIn()': /Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:279: error: 'TCCR2A' was not declared in this scope /Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:279: error: 'WGM21' was not declared in this scope /Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:279: error: 'TCCR2B' was not declared in this scope /Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:279: error: 'CS21' was not declared in this scope /Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:279: error: 'OCR2A' was not declared in this scope /Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:279: error: 'TCNT2' was not declared in this scope /Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:282: error: 'TIMSK2' was not declared in this scope /Users/pdyates/Documents/Arduino/libraries/IRremote/IRremote.cpp:282: error: 'OCIE2A' was not declared in this scope What's the big idea??? If this is way too deep, I'll just use an Arduino Uno for this project... I just really want this to be tiny. :(

Question by pyates1   |  last reply

How do you upload a program to an ATtiny85?

I've read many instructables on how to do it with an arduino, but how is this done with the simple chip? I've seen no information on how to do it standalone. Anyone know?

Question by 4lifenerdfighter   |  last reply

AtTiny85 port analog / digital setup order bug

/*How to configure port setup in correct order AtTiny? Bug in combiler or  what is wrong here? Circuitry here has two LEDs and one analog input.  LEDs are ON or OFF depending voltage of potentiometer. Simple code below makes digital output PB1 high impedance, so LED current is too low because voltage drops. If port configuration setup is made in other order port output works fine. */ /*                     ___     D5 PB5  1|o      |8  Vcc     D3 PB3  2|        |7  PB2 A1   Voltage measurement, potentiometer     D4 PB4  3|        |6  PB1 D1   --|>--|          GND  4| ___|5  PB0 D0   --|>--| */ byte led0 = PB0; byte led1 = PB1; byte potentiometer = A1; int voltage; /* It is important in which order pin configuration has been set. Wrong order causes PB1 to high impedance, low current, output. This must be combiler bug, I think. If port BP1 setup has been made using straight to register there is no problem in order. Any other analog input port and digital port combination works correctly. */ void setup() {   pinMode(led0, OUTPUT);   pinMode(led1, OUTPUT);  // Doesn't work if this is before pinMode(potentiometer, INPUT);   //DDRB &= ~(1 << DDB2); // Alternative working setup for led1 as output   pinMode(potentiometer, INPUT);    //pinMode(led1, OUTPUT);  // Works if this led1 setup is after pinMode(potentiometer, INPUT); } void analog_input() {   voltage = analogRead(potentiometer);   if (voltage < 500) {     digitalWrite(led0, HIGH);     digitalWrite(led1, LOW);   }   else   {     digitalWrite(led0, LOW);     digitalWrite(led1, HIGH);   } } void loop() {   analog_input(); }

Topic by PaavoM   |  last reply

attiny85 to control two different jobs through a switch?

What i really want is to piece up 2 sketches together in attiny85 programming,the result is to enable it to be controlled through a switch.the 2 sketched are pretty long.I don't know how bcz i am a newbie in first i thought of 'Case,break'syntax,but later found it may not suitable. The pins i choose is Pin4(Analog2) physical pin3 of attiny85 to control of WS2812B light strip.another Pin1(PWM)physical Pin6 to control a speaker. #include #include #define PIN 4 Adafruit_NeoPixel strip = Adafruit_NeoPixel(30, PIN, NEO_GRB + NEO_KHZ800); void setup() {     Serial.begin(9600);   strip.begin();; // Initialize all pixels to 'off' } void loop() {     int sensorValue = analogRead(A0);   Serial.println(sensorValue);//Just for the calipration     if(sensorValue > 10)   { rainbowCycle(0); } if(sensorValue >30){ theaterChase(strip.Color(255,0,0),10); theaterChase(strip.Color(255,0,0),10); theaterChase(strip.Color(0,0,255),10); } if(sensorValue >40){   colorWipe(strip.Color(255,0,0),10);   colorWipe(strip.Color(0,255,0),10);   colorWipe(strip.Color(0,0,255),10); } } ============ /* ATtiny85 Speaker */ // constants const int Speaker = 1;             // speaker pin void setup() {   pinMode(Speaker, OUTPUT); void playBeep(void) {     for (int i=0; i < 500; i++)     {       digitalWrite(Speaker, HIGH);       delay(1);       digitalWrite(Speaker, LOW);       delay(1);     } }

Question by gada888   |  last reply

Makefiles and HEX files?

I am sorry for my stupidity but I am no AVR programmer. Here is my trouble. I am not so sure how to create a makefile in winavr or a hex file from some source code that I have. Whenever I do have code, it already has the makefile and the HEX file. Also, if you edit source code is the HEX file going to change too or will it stay the same? I noticed, that although an ATtiny85 is supposed to be compatible with the ATtiny25 when I try to program code into an ATtiny85 with ATtiny25 it doesn't work. Is there a place I change it to work with the ATtiny85...?

Question by blinkyblinky   |  last reply

Makefiles and Hex files

I am sorry for my stupidity but I am no AVR programmer. Here is my trouble. I am not so sure how to create a makefile in winavr or a hex file from some source code that I have. Whenever I do have code, it already has the makefile and the HEX file. Also, if you edit source code is the HEX file going to change too or will it stay the same? I noticed, that although an ATtiny85 is supposed to be compatible with the ATtiny25 when I try to program code into an ATtiny85 with ATtiny25 it doesn't work. Is there a place I change it to work with the ATtiny85...?

Topic by blinkyblinky 

1 key keyboard?

Heres the circuit for 1 key keyboard which has to be done with a attiny85 but can i modify the circuit to be made with a  12F683

Question by robot1398   |  last reply

ATtiny85 IR USB receiver that works with any IR remote!!

Hello everybody, I have made my own USB IR receiver using and Arduino to program the core of the project which is an attiny85. I dealt with a lot of issues and got desperate as well trying to put it together. After many hours of study and research on the Internet I came up with a solid procedure to make it work. Now I enjoy my own receiver that I can program to work with any remote. The procedure is not easy, so I made my own guide for future reference that evolved into an instructable to return to the community of makers and developers part of what I have got from them:\

Topic by achanakbhayank 

i can not get my attiny to work !

I am trying some projects with the attiny85 but not one is working only blink and fade wat am i doing rong? i like to make a dice

Question by BenK6   |  last reply

How to show 3 different temperatures using 3 LEDs connected to a ATtiny85?

Hi people I am trying to build a temperature sensor using 3 LEDs. The aim is to have them come on at specific temperatures. This is for my motorcycle ride to work this coming winter. I want to know when the temp goes below 8c down to 5c from 5c down to 0c then below. I have managed to do this via a arduino board & a LM35 sensor and 3 LEDs. But I cant get this to work on the ATtiny85 chip. Below is the code I wrote for this on the arduino. Any help or different program would be of great. *my first attempt at a temp warning light need it to come on when temp lower than 5deg celsius */ int tempPin = A1; int led01 = 8; int led02 = 9; int led03 = 10; int tempMax = 28; int tempMid = 27; int tempMin = 5; int temp; void setup() {   Serial.begin(9600);     pinMode (led01, OUTPUT);   pinMode (led02, OUTPUT);   pinMode (led03, OUTPUT);   pinMode (tempPin, INPUT); }     void loop() {      temp = analogRead(tempPin);      temp = temp * 0.48828125;     Serial.print("TEMPRATURE = ");   Serial.print(temp);   Serial.print("*C");   Serial.println();   delay(1000);   if (temp > tempMax){   digitalWrite(led01, HIGH);   digitalWrite(led02, LOW);   digitalWrite(led02, LOW);   } if (temp < tempMid){   digitalWrite(led01, LOW);   digitalWrite(led02, HIGH);   digitalWrite(led02, LOW);   } if (temp < tempMin){   digitalWrite(led01, LOW);   digitalWrite(led02, LOW);   digitalWrite(led02, LOW); }}

Question by minimadmalc   |  last reply

Programming an Attiny85 with Arduino Uno as ISP, but I keep getting Serial was not declared in this scope?

The sketch runs fine on the uno, but as soon as I switch the board to Attiny 85, i get an error that says serial was not declared in this scope.  Any help is greatly appreciated! Here is the sketch for reference. #include const int relay = 9; //Relay Control const int RECV_PIN = 8; //IR Sensor int relayState = LOW; IRrecv irrecv(RECV_PIN); decode_results results; void setup() {   Serial.begin(9600);   irrecv.enableIRIn();   pinMode(relay, OUTPUT); } void loop() {   if (irrecv.decode(&results;)){         long int decCode = results.value; Serial.println(decCode); switch (results.value) {           case 1637937167: // Power Button      {       relayState = !relayState;       digitalWrite(relay, relayState);       delay(100); } irrecv.resume(); // Receive the next value   }   } }

Question by meanbean   |  last reply

has anyone used the sparkfun tiny avr programmer to program an atmega chip?

I know that in the documentation it specifically says that you can program an atmega chip with it; however, I don't know how I would go about it. can I program it through the arduino IDE like I can with the attiny85? if so, where would I get the files for it (I had to get specific files for the attiny85 chip)? where would I connect the wires (the hookup guide shows a connection points that are nonexistent on the actual chip)? sorry if these questions are simple. I'm currently blundering and flailing into the world of AVR microcontrollers and need all the help I can get.

Question by codongolev   |  last reply

Update Instructable or make new Instructable? Answered

If you have revised a project that you wrote an Instructable for, is it common practice to update the instructable or write a new one? My changes are not really full 2.0 level, but they are a significant new step.  I have an Arduino based project, and I've pulled out the relatively expensive Arduino and replaced it with a dollar ATtiny85. 

Question by fadecomic   |  last reply

What resistor do I need to drop 9 volts to 4.5 or 5?

I need to use a resistor (not a voltage regulator, sorry) to drop 9 volts from a battery down to 4.5 or 5. I am running an attiny85, which is also used to power up to 3 30ma leds. What do I need to use?

Question by XOIIO   |  last reply

Program a cheap microcontroller to work with a electric odometer?

I need suggestions for 1) a cheep microcontroller, and 2) how to program this controller to work with this setup (link) (minus the arduino) .  If that does not make sense just ask and I will try to answer as soon as possible. Edit: If this solution can have anything to do with the ATtiny85 that would be great because i just found a box at a garage sale that was full of them. Thanks in Advance, Zootsuitman

Question by zootsuitman   |  last reply

Looking for code to make a Atting85 into a Toggle Touch LED light?

I want to make a simple touch lamp using an attiny85 that will toggle on and off with a single touch point. I have looked on the web and found lots of touch code, but nothing that exactly fits my need. I am not a programmer and cannot tweak someone else code. I will be running the whole thing off rechargeable AA batteries. Thanks for the help!

Question by BeerCzar   |  last reply

Limit current for a circuit using 5V 450mA power supply?

Have a 5V DC power supply that is rated for 450mA +-50mA...want to use it for a 5V circuit with an Attiny85 and a couple of LEDs. I don't think I could use a voltage regulator since that will bring the voltage to lower than 5V, but the current seems high for use in a small circuit. How can I limit it? Using a resistor? Or should I not bother?

Question by tpdasf   |  last reply

piezo reacting from splitting power to multiple things

I have two attiny85s that I'm powering with a single 3v battery.  One of these is connected to a piezo (so lights will flash when tapped).  However, the second one keeps affecting the power enough to set off the piezo reaction frequently without tapping.  I don't want to use two separate batteries.  How do I split the power between the two without them affecting each other? Thanks.

Topic by aliasjanedoe   |  last reply

Circuit help

So, my brother tasked me with making him a customizable doorbell for his house for Christmas (of course he didn't tell me till last week, but whatever). looked around at a bunch of stuff online and found a few decent items. some of them use those voice recorder modules from radio shack...which  might work, but I've used them before and they're pretty quiet. also, not the best sound in general from the mic used to record to them. so I found this thing;=1 which is a riff on this thing  which uses an ATTINY85 to play audio via the PWM output from an SD card. I like this guy because it's gives more options for sound and is generally more "gee whiz". however, the guy built it from scrap parts and has some admitted flaws in it, notably the power supply and the audio amplifier. so, I'd like some help figuring out how to build the same thing, but with a more "correct" power supply and amplifier. also, not exactly an electronics wizard so the fact that there are a billion different chips listed as ATTINY85, I wouldn't mind if someone can make a more sensible parts list (there aren't that many parts). I plan to trigger the thing with an off the shelf wireless doorbell type thing.

Topic by crapflinger   |  last reply

whats the difference between all the 8pin attinys? Answered

I just cant find it, and yet i see  "attiny45" "attiny85" "attiny13" "attiny25" and some others all over the net, theyr all 8pin. what exactly is the difference? and can i use a C++ program for an attiny45 on a attiny13 without modifications? and if not, what do i need to alter? couse i want to make a stealth USB caps lockers ( but i only have attiny13 lying around. i also like the blinking, singing, marioman (  but that also uses a different attiny...

Question by godofal   |  last reply

I can't Upload a code to this AVR chip!?!!!!

I'm trying to upload a code to an atmega48p (on the chip it says atmega48pv-10pu) using avrdude and it just won't do it! It always says mismatch signiature, and I bricked one atmega48p already by bypassing it (somehow wrote over fuses and they're screwed). I'm under a lot of pressure and I need to upload this code asap! Right now I'm compiling the code as atmega48 because if I compile it as a atmega48p, I get like 92 errors in my code for some reason. I also upload it as an atmega48 because there is no option for an atmega48p. I know my programmer works because I can upload a code to an attiny85. NEED HELP FAST

Topic by guyfrom7up   |  last reply

Compiling the Blink Sketch? Answered

When i compile the Blink sketch on a 328 it verifies OK. Compile the same blink sketch on a ATtiny85 verifies OK. Compile the same blink sketch on a ATtiny2313 it troughs an error every time. These are the same" family " of processor. When you download the 85 board files the 2313 board files come with it.  Same results from 23, 1 and 1.01 IDE's. I used an LPT programmer and can read the READ ALL files from the 2313 using Pony Prog. So there is a connection there. I just can not write the blink sketch to the 2313 cuz of the compile error. There is a lot of tutorials on how to program using this method, that i have read everyone i could, but to resolve the compile error i have not found an answer to. I would switch to an 85 but not available locally. Anybody come across this error before?   

Question by WWC   |  last reply

USBeDuino Project

Hi, I just want to inform you about a new project, which bring a tiny microcontroller board for your home automatication, to you. It is called "USBeDuino". What is USBeDuino? basically it is a microcontroller board with 3 shields, which, when combined make a very great platform for home automatication. Features: Processor: Attiny85 2 x 3A PWM Output sink channel 3 x Analog input channel 1 onboard poti 2 onboard Buttons Input Voltage 5-24V Small size The idea behind the board: Sometimes you need only projects with very less pins, such as light controlling or pump controll (in the garden). Then you dont want to use a full arduino, with a power or a relay shield... then you can use the USbeDuino! Please tell me, what do you think about this project? Does it have potential?

Topic by Jan_Henrik   |  last reply

Arduino code help

Hey guys first post.  I need some help with some code Im working on. What I want to do is have a pot controlled timer that moves a servo after a time dictated by the pot. The scale of delays I want is 0-3 minutes.  I eventually want to program an Attiny85 chip to do this. For now Im substituting a led in for the servo. Im a newbie with Arduino so any help with this simple project would be greatly appreciated. This is my code:  int sensorPin = 0;    // select the input pin for the potentiometer int ledPin = 13;      // select the pin for the LED int sensorValue = 0;  // variable to store the value coming from the sensor void setup() {     pinMode(ledPin, OUTPUT);    int val = analogRead(0);     val = map(val, 0, 1023, 0, 30000);       digitalWrite(ledPin, HIGH);       delay(val); delay(val); delay(val); delay(val); delay(val); delay(val);           digitalWrite(ledPin, LOW);                         } void loop() {                   }

Topic by Steven Wrigley   |  last reply

Need help with arduino code.?

Alright I asked this question on the arduino forums but nobody is giving me a straight answer, and it's getting annoying. I am using the capsense library on an attiny85, I want to count the number of times an even happens, in this case the capacitive censor exceeding a certain amount. Then based on that number I want it to turn on one led, or two, and so forth, to keep count. Can someone tell me how the f*****g get this to work? I try to use serial to debug and just get "Serial" not defined in this scope. Heres the code: #include #include CapacitiveSensor   cs_1_2 = CapacitiveSensor(1,2);        // 10M resistor between pins 4 & 2, pin 2 is sensor pin, add a wire and or foil if desired int ledpin = 0; int countnumber = 0; void setup()                    {   cs_1_2.set_CS_AutocaL_Millis(0xFFFFFFFF);     // turn off autocalibrate on channel 1 - just as an example   pinMode (ledpin, OUTPUT); } void loop()                    {   long start = millis();   long total1 =  cs_1_2.capacitiveSensor(30);   if (total1 < 99) {    countnumber == 1;   }   if (countnumber = 1) {     digitalWrite(ledpin, HIGH);   } }

Question by XOIIO   |  last reply