This commit is contained in:
Serge NOEL
2026-02-10 11:27:18 +01:00
parent 549c9f388e
commit 4423bb2de1
175 changed files with 238087 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch

View File

@@ -0,0 +1,10 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}

View File

@@ -0,0 +1,31 @@
[env]
platform = atmelmegaavr
framework = arduino
monitor_speed = 115200
monitor_port = /dev/ttyUSB1
upload_port = /dev/ttyUSB0
board_build.f_cpu = 20000000ul
build_flags =
-D ws2812_port=A
-D ws2812_pin=7
lib_deps =
SPI
adafruit/Adafruit NeoPixel @ 1.10.7
[env:tiny1616-jtag2updi]
board = ATtiny1616
upload_protocol = jtag2updi
[env:tiny1616-serialupdi]
board = ATtiny1616
upload_speed = 230400
upload_flags =
--tool
uart
--device
attiny1616
--uart
$UPLOAD_PORT
--clk
$UPLOAD_SPEED
upload_command = pymcuprog write --erase $UPLOAD_FLAGS --filename $SOURCE

View File

@@ -0,0 +1,45 @@
#include <Arduino.h>
#include <Adafruit_NeoPixel.h>
#define PIN_LED PIN_PB4 // 5
#define PIN_RGB PIN_PA7
#define PIN_BTN PIN_PA0
uint8_t seq = 0;
Adafruit_NeoPixel pixels(1, PIN_RGB, NEO_GRB + NEO_KHZ800);
void setup() {
pinMode(PIN_LED, OUTPUT);
pinMode(PIN_BTN, INPUT);
delay(1000);
Serial.begin(115200);
Serial.printf("Started at %d MHz\n", F_CPU);
pixels.begin();
}
uint8_t btn_state = HIGH;
void loop() {
seq++;
Serial.print('.');
if (btn_state != digitalRead(PIN_BTN)) {
btn_state = !btn_state;
Serial.print("Button state is ");
Serial.println(btn_state);
}
digitalWrite(PIN_LED, seq % 2);
pixels.clear();
if (seq % 2 == 0)
pixels.setPixelColor(0, pixels.Color((0xff - seq) % 0xff, seq % 0xff, seq % 0x7f + (0xff - seq) % 0x7f));
pixels.show();
delay(500);
}