Attiny85

Pinouts

attiny_pinout

attiny85_pinout

Programmer via USBTinyISP

Je me suis fabriqué un petit circuit pour faciliter la programmation des attiny85 via l’USBTinyISP :

programmer_usbtinyisp

J’utilise PlatformIO sur Visual Code Studio.

platformio.ini

[env:attiny85]
platform = atmelavr
board = attiny85
framework = arduino
upload_protocol = usbtiny

main.cpp

#include <Arduino.h>

#define PIN_POTAR A1
#define PIN_PWM 0
#define PIN_LED 1


void setup() {
  pinMode(PIN_POTAR, INPUT);
  pinMode(PIN_PWM, OUTPUT);
  pinMode(PIN_LED, OUTPUT);

}

void loop() {
  long potar = analogRead(PIN_POTAR);
  long pwm = map(potar, 0, 1023, 0, 255);
  analogWrite(PIN_PWM, pwm);
  analogWrite(PIN_LED, pwm);
  delay(100);
}

Y’a plus qu’à compiler et uploader :)

Controleur de pompe pour mon Van

attiny85_pump_controller