1

#define F_CPU 1200000UL #define LED PB2 // PB2 #define BUTTON1 PB1 // INT0 #define BUTTON0 PB0 // PCINT0 #define HIGH 1 #define LOW 0 #define INPUT 0 #define OUTPUT 1 #define INPUT_PULLUP 2 #define FALSE 0 #define TRUE 1 #define _BV(bit) (1 << (bit)) #include <avr/io.h> #include <avr/...


1

The mapping can be found in the io.h file but also in Arduino core files. Below is the pin mapping: ATtinyX4 +----U----+ (VCC)-------------1-|VCC GND|-14------------(GND) (D10)-------------2-|PB0 PA0|-13----------(D0/A0) (D9)--------------3-|PB1 PA1|-12----------(D1/A1) (/RESET)----------4-|PB3 ...


1

In this article the following steps are used when using an LED as a light detector: Light up the LED by making the anode positive (logic one) and the cathode negative (logic zero) - this fully discharges the LED as a capacitor. Charge up the capacitor by making the anode negative and the cathode positive, as this is a small capacitor it will take no time at ...


Only top voted, non community-wiki answers of a minimum length are eligible