#define PIN6 6
int potentioPin = A0;
void setup() {
// put your setup code here, to run once:
DDRD = 1 < PIN6;
pinMode(6, OUTPUT);
TCCR0A = (1 << COM0A1);
TCCR0A |=(1 << WGM00);
TCCR0B = (1 << CS01);
OCR0A = analogRead(potentioPin);
}
void loop() {
// put your main code here, to run repeatedly:
int nilaiPotentio = analogRead(potentioPin);
int kecerahan = map(nilaiPotentio, 0, 1023, 0, 255);
//int kecerahan1 = map(nilaiPotentio, 1023, 0, 0, 255);
analogWrite(PIN6, kecerahan);
//analogWrite(ledPin1, kecerahan1);
delay(30);
}
//int main(){
//setup();
//while(1){
//}
//}