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 https://photo.cloud.naver.com/v2/# please help me

Posted by kclook 7 months ago


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  http://naver.me/GkO2S4ik

Posted by kclook 7 months ago


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 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?

Asked by DELETED_MakiY2 9 months ago


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) : http://macetech.com/blog/?q=node/46 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!

Asked by DELETED_MakiY2 10 months ago


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     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   }     if(average       digitalWrite(ledPin, LOW);  // fan turns off if sensor value below threshold     }                             // or stays on until it is below threshold     } http://youtu.be/cm_uuEXd8HM thanks in advance!

Asked by earthtown 5 years ago


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.

Asked by wesm4 1 year ago


add an external crystal to attiny85?

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

Asked by fossilshark 2 years ago


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.

Asked by fossilshark 2 years ago


attiny85

Hi everybody just wanted to make a simple blinking led circuit with a attiny85 I saw some instructables and videos online but nothing could help me this is what i did. 1. make the wire connections to attiny85 2. upload arduinoISP sketch 3. put a 10uf cap between reset and gnd 4. make a file in sketchbook folder called "hardware" 5. copy and paste the attiny85.exe file which i found online into the hardware folder 6. Go into preference and restart the arduino program. after this i was expecting the file pop up in arduino board selection but it didnt it just unaffected  Can anybody please help me? If more information is need please ask.

Posted by robo10302 4 years ago


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   digitalWrite(LED1,HIGH); } else { digitalWrite(LED1,LOW); } //Serial.print(dist); //Serial.print("cm."); //Serial.println(""); delay(20); }

Asked by WWC 5 years ago


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.

Asked by rtalley 5 years ago


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?

Asked by sathees31 2 years ago


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?

Posted by aliasjanedoe 4 years ago


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? 

Posted by aliasjanedoe 3 years ago



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.

Asked by Geniusdude 5 years ago


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??

Asked by Soumojit 1 year ago


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!

Posted by HavocRC 4 years ago


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

Asked by printrbot932 2 years ago


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?

Asked by Spaceman Spiff 6 years ago


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!

Posted by HavocRC 4 years ago


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

Posted by dudes 2 years ago


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; http://highlowtech.org/?p=1695   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

Posted by dudes 2 years ago


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.  

Asked by stino66 5 years ago


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.

Posted by aliasjanedoe 3 years ago


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?

Asked by 4lifenerdfighter 6 years ago


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   pinMode(potentiometer, INPUT);    //pinMode(led1, OUTPUT);  // Works if this led1 setup is after pinMode(potentiometer, INPUT); } void analog_input() {   voltage = analogRead(potentiometer);   if (voltage     digitalWrite(led0, HIGH);     digitalWrite(led1, LOW);   }   else   {     digitalWrite(led0, LOW);     digitalWrite(led1, HIGH);   } } void loop() {   analog_input(); }

Posted by PaavoM 1 year ago


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: http://hlt.media.mit.edu/?p=1695). 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. :(

Asked by pyates1 4 years ago


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...?

Posted by blinkyblinky 6 years ago


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...?

Asked by blinkyblinky 6 years ago


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

Asked by robot1398 6 years ago


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 :)

Posted by dudes 3 years ago


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 programming.at 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();   strip.show(); // 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     {       digitalWrite(Speaker, HIGH);       delay(1);       digitalWrite(Speaker, LOW);       delay(1);     } }

Asked by gada888 2 years ago


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

Asked by BenK6 2 years ago


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.

Posted by Sooncheng 11 months ago


CANT GET SKETCH TO WORK ON ATTINY 85 ONLY WORKS WITHOUT AM I WIRING IT WRONG?

HI GUYS. I HAVE A LDR light sensor I would like to use to turn on a light bulb through a attin85. when I upload the sketch to the Arduino it works fine. but when I upload to the attiny, I can't get it to work. am I'm wiring it wrong? when I put my signal from my ldr sensor to AO and 2 to the led it works on Arduino, but when I do that with the Attiny85 it doesn't do anything. The sketch did upload correctly though so it has to be me wiring it wrong or I need to change the code maybe to cater to the attiny85?my sketch is int LDR = 0; int LDRValue = 0; void setup() { pinMode(2, OUTPUT); void loop() { LDRValue = analogRead(LDR); delay(50); if (LDRValue { digitalWrite(2, HIGH); } else { digitalWrite(2, LOW); } }

Asked by jman2018 8 weeks ago


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.

Asked by codongolev 4 years ago


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   }   } }

Asked by meanbean 5 years ago




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. 

Asked by fadecomic 7 months ago


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?

Asked by XOIIO 5 years ago


Attiny 85 not working

HI GUYS. I HAVE A LDR light sensor I would like to use to turn on a light bulb through a attin85. when I upload the sketch to the Arduino it works fine. but when I upload to the attiny, I can't get it to work. am I'm wiring it wrong? when I put my signal from my ldr sensor to AO and 2 to the led it works on Arduino, but when I do that with the Attiny85 it doesn't do anything. The sketch did upload correctly though so it has to be me wiring it wrong or I need to change the code maybe to cater to the attiny85?my sketch is int LDR = 0; int LDRValue = 0; void setup() {pinMode(2, OUTPUT); void loop() { LDRValue = analogRead(LDR); delay(50); if (LDRValue { digitalWrite(2, HIGH); } else { digitalWrite(2, LOW); } }

Asked by jman2018 8 weeks ago


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

Asked by zootsuitman 5 years ago


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!

Asked by BeerCzar 3 years ago


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?

Asked by tpdasf 5 years ago


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.

Posted by aliasjanedoe 3 years ago




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 http://spritesmods.com/?art=doorbell&page=1 which is a riff on this thing http://elm-chan.org/works/sd8p/report.html  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.

Posted by crapflinger 2 years ago