temp hack to get it working good enough to build the head; will revisit
This commit is contained in:
@@ -284,7 +284,10 @@ class Strip {
|
||||
}
|
||||
};
|
||||
|
||||
volatile Strip strip = Strip(6, 144);
|
||||
volatile Strip strip1 = Strip(5, 144);
|
||||
volatile Strip strip2 = Strip(6, 144);
|
||||
volatile Strip strip3 = Strip(11, 24);
|
||||
volatile Strip strip4 = Strip(13, 144);
|
||||
|
||||
void set_wait(char data[], uint16_t len){
|
||||
String wait = "";
|
||||
@@ -293,7 +296,8 @@ void set_wait(char data[], uint16_t len){
|
||||
}
|
||||
uint16_t wait_int = wait.toInt();
|
||||
if (wait_int >= 0 && wait_int <= 200){
|
||||
strip.wait = wait_int;
|
||||
strip1.wait = wait_int;
|
||||
strip2.wait = wait_int;
|
||||
to_rx = msg_speed_changed;
|
||||
} else {
|
||||
to_rx = msg_speed_out_of_range;
|
||||
@@ -304,10 +308,12 @@ void set_pattern(char data[], uint16_t len){
|
||||
if (len != 1){
|
||||
to_rx = msg_pattern_invalid;
|
||||
} else if (data[0] == 'r'){
|
||||
strip.pattern = PATTERN_RED;
|
||||
strip1.pattern = PATTERN_RED;
|
||||
strip2.pattern = PATTERN_RED;
|
||||
to_rx = msg_pattern_rainbow;
|
||||
} else if (data[0] == 'o') {
|
||||
strip.pattern = PATTERN_OFF;
|
||||
strip1.pattern = PATTERN_OFF;
|
||||
strip2.pattern = PATTERN_OFF;
|
||||
to_rx = msg_pattern_off;
|
||||
} else {
|
||||
to_rx = msg_pattern_invalid;
|
||||
@@ -316,7 +322,8 @@ void set_pattern(char data[], uint16_t len){
|
||||
|
||||
void set_amplitude(char data[], uint16_t len){
|
||||
if (len == 1){
|
||||
strip.amplitude = data[0];
|
||||
strip1.amplitude = data[0];
|
||||
strip2.amplitude = data[0];
|
||||
//Serial.println((uint8_t)data[0]);
|
||||
Serial.println(255 - (uint8_t)data[0]);
|
||||
} else {
|
||||
@@ -358,12 +365,15 @@ void setup(void) {
|
||||
Serial.begin(115200);
|
||||
}
|
||||
bluetooth_setup();
|
||||
strip.wait = 50;
|
||||
strip3.wait = 30;
|
||||
Serial.println(F("Ready"));
|
||||
}
|
||||
|
||||
void loop(void) {
|
||||
ble.update(BT_SCAN_MS);
|
||||
do_rx_send();
|
||||
strip.update();
|
||||
strip1.update();
|
||||
strip2.update();
|
||||
strip3.update();
|
||||
strip4.update();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user