User Ratings
Rate This Project
Login To Rate This Project
User Reviews
-
I used this code to test: int ledPin = 0; // led PB0 int inPin = 3; // button PB3 int val = 0; // variable for reading the pin status void setup() { pinMode(ledPin, OUTPUT); // declare LED as output pinMode(inPin, INPUT); // declare pushbutton as input } void loop(){ val = digitalRead(inPin); // read input value if (val == HIGH) { // check if the input is HIGH (button released) digitalWrite(ledPin, LOW); // turn LED OFF } else { digitalWrite(ledPin, HIGH); // turn LED ON } } compile succesfull but digitalRead is not working on attiny13A :/
-
Thanks a lot for your works.... If you like, i have do a full support for the micros() function (that i need in 1 of my project)!!! If you use only the micros(), it use less space!!! Here is the code to add in the Wiring.C : unsigned long micros(){ unsigned long x; asm("cli"); /*Scale number of timer millisecondoverflows tos*/ #if F_CPU == 128000 x = ovrf * 2000; #elif F_CPU == 600000 x = ovrf * 427; #elif F_CPU == 1000000 x = ovrf * 256; #elif F_CPU == 1200000 x = ovrf * 213; #elif F_CPU == 4000000 x = ovrf * 64; #elif F_CPU == 4800000 x = ovrf * 53; #elif F_CPU == 8000000 x = ovrf * 32; #elif F_CPU == 9600000 x = ovrf * 27; #elif F_CPU == 10000000 x = ovrf * 26; #elif F_CPU == 12000000 x = ovrf * 21; #elif F_CPU == 16000000 x = ovrf * 16; #else #error This CPU frequency is not defined #endif asm("sei"); return x; }
-
thanks for great work! but currently I'm not able to run ATtiny13V if any analogRead or digitalRead occurs in the code.
- Previous
- You're on page 1
- Next