mirror of
https://gitlab.com/zwirbel/illucat.git
synced 2025-12-19 11:15:51 +01:00
Compare commits
8 Commits
color-pot
...
release-1.
| Author | SHA1 | Date | |
|---|---|---|---|
| 7df62eb791 | |||
| 4e12242a15 | |||
| 61ff9f146a | |||
| 42016b8e53 | |||
| 226a72261b | |||
| 3f0439a683 | |||
| 92bc03ec21 | |||
| b93b0eb5d7 |
@@ -1,9 +1,13 @@
|
|||||||
image: python:2.7-stretch
|
image: python:2.7-stretch
|
||||||
|
|
||||||
|
variables:
|
||||||
|
S3_BUCKET_NAME: "wirelos"
|
||||||
|
PROJECT_NAME: "illucat"
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- test
|
|
||||||
- build
|
- build
|
||||||
- production
|
- test
|
||||||
|
- release
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
key: ${CI_COMMIT_REF_SLUG}
|
key: ${CI_COMMIT_REF_SLUG}
|
||||||
@@ -22,11 +26,16 @@ firmware:
|
|||||||
- pio run -t buildfs
|
- pio run -t buildfs
|
||||||
|
|
||||||
release:
|
release:
|
||||||
stage: production
|
stage: release
|
||||||
|
only:
|
||||||
|
- /^release-.*$/
|
||||||
|
image: python:latest
|
||||||
script:
|
script:
|
||||||
- mkdir release
|
- pip install awscli
|
||||||
- mv .pioenvs/build/firmware.bin release
|
- mkdir -p ${PROJECT_NAME}/${CI_COMMIT_TAG}
|
||||||
- mv .pioenvs/build/spiffs.bin release
|
- mv .pioenvs/build/firmware.bin ${PROJECT_NAME}/${CI_COMMIT_TAG}
|
||||||
|
- mv .pioenvs/build/spiffs.bin ${PROJECT_NAME}/${CI_COMMIT_TAG}
|
||||||
|
- aws s3 --endpoint-url=https://$DO_SPACE_ENDPOINT cp ./ s3://$S3_BUCKET_NAME/ --recursive --exclude "*" --include "*.bin"
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- release
|
- ${PROJECT_NAME}/${CI_COMMIT_TAG}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"pin": 4,
|
"pin": 4,
|
||||||
"length": 300,
|
"length": 32,
|
||||||
"brightness": 64,
|
"brightness": 64,
|
||||||
"updateInterval": 50,
|
"updateInterval": 50,
|
||||||
"defaultColor": 100
|
"defaultColor": 100
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
#include <plugins/WebServerPlugin.cpp>
|
#include <plugins/WebServerPlugin.cpp>
|
||||||
#include <plugins/WebConfigPlugin.cpp>
|
#include <plugins/WebConfigPlugin.cpp>
|
||||||
#include "PixelPlugin.h"
|
#include "PixelPlugin.h"
|
||||||
#include "PotPlugin.h"
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace std::placeholders;
|
using namespace std::placeholders;
|
||||||
@@ -81,7 +80,6 @@ class IlluCat : public MeshSprocket {
|
|||||||
addPlugin(new WebServerPlugin(webConfig, server));
|
addPlugin(new WebServerPlugin(webConfig, server));
|
||||||
addPlugin(new WebConfigPlugin(server));
|
addPlugin(new WebConfigPlugin(server));
|
||||||
addPlugin(new PixelPlugin(pixelConfig, pixels));
|
addPlugin(new PixelPlugin(pixelConfig, pixels));
|
||||||
addPlugin(new PotPlugin());
|
|
||||||
defaultAnimation();
|
defaultAnimation();
|
||||||
|
|
||||||
String softApPrt = "SoftAP IP: " + WiFi.softAPIP().toString();
|
String softApPrt = "SoftAP IP: " + WiFi.softAPIP().toString();
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
#ifndef __POT_PLUGIN_H__
|
|
||||||
#define __POT_PLUGIN_H__
|
|
||||||
|
|
||||||
#include <FS.h>
|
|
||||||
#include "TaskSchedulerDeclarations.h"
|
|
||||||
#include "ArduinoOTA.h"
|
|
||||||
#include "Plugin.h"
|
|
||||||
#include "utils_print.h"
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
using namespace std::placeholders;
|
|
||||||
|
|
||||||
class PotPlugin : public Plugin {
|
|
||||||
public:
|
|
||||||
Task inputTask;
|
|
||||||
int currentVal = 0;
|
|
||||||
PotPlugin(){
|
|
||||||
}
|
|
||||||
void activate(Scheduler* userScheduler, Network* network){
|
|
||||||
inputTask.set(TASK_MILLISECOND * 50, TASK_FOREVER, bind(&PotPlugin::checkInput, this));
|
|
||||||
userScheduler->addTask(inputTask);
|
|
||||||
inputTask.enable();
|
|
||||||
PRINT_MSG(Serial, SPROCKET_TYPE, "PotPlugin activated");
|
|
||||||
}
|
|
||||||
long toRange(long x, long in_min, long in_max, long out_min, long out_max){
|
|
||||||
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
|
|
||||||
}
|
|
||||||
void checkInput(){
|
|
||||||
//Serial.println(String("Pot:") + String(analogRead(A0)));
|
|
||||||
int newVal = toRange(analogRead(A0), 0, 1024, 0, 255);
|
|
||||||
if(newVal > 0 &&
|
|
||||||
(newVal >= currentVal + 5 || newVal <= currentVal - 5)){
|
|
||||||
publish("pixels/colorWheel",String(newVal));
|
|
||||||
currentVal = newVal;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
Reference in New Issue
Block a user