First commit

This commit is contained in:
Andriy Malyshenko
2022-12-11 22:09:57 +01:00
commit ae2ab1f016
9 changed files with 23805 additions and 0 deletions

5
firmware/t1616-starter/.gitignore vendored Normal file
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,32 @@
[env]
platform = atmelmegaavr
framework = arduino
monitor_speed = 115200
monitor_port = /dev/ttyUSB1
upload_port = /dev/ttyUSB0
board_build.f_cpu = 16000000ul
build_flags =
-D ws2812_port=A
-D ws2812_pin=7
lib_deps =
SPI
adafruit/Adafruit NeoPixel @ 1.10.7
bodmer/TFT_eSPI @ ^2.3.70
; [env:tiny1616-jtag2updi]
; board = ATtiny1616
; upload_protocol = jtag2updi
[env:tiny1616-serialupdi]
board = ATtiny1616
upload_speed = 57600
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,35 @@
#include <Arduino.h>
#include <Adafruit_NeoPixel.h>
#define PIN_LED PIN_PB4 // 5
#define PIN_RGB PIN_PA7
uint8_t seq = 0;
Adafruit_NeoPixel pixels(1, PIN_RGB, NEO_GRB + NEO_KHZ800);
void setup() {
pinMode(PIN_LED, OUTPUT);
delay(1000);
Serial.begin(115200);
Serial.printf("Started at %d MHz\n", F_CPU);
pixels.begin();
}
void loop() {
seq++;
Serial.print('.');
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(250);
}