add monitor speed

This commit is contained in:
interfisch 2021-08-13 10:30:22 +02:00
parent f838530a04
commit a1caad6b12
2 changed files with 11 additions and 0 deletions

View File

@ -24,6 +24,11 @@ lib_deps =
platform = teensy
board = teensy31
framework = arduino
monitor_speed = 256000
build_flags =
-D USB_SERIAL_HID
-D PIN_DATA=0

View File

@ -177,15 +177,18 @@ void setup(){
FastLED.show();
#endif
Serial.begin(SerialSpeed);
Serial.print("Ada\n"); // Send ACK string to host
lastByteTime = lastAckTime = millis(); // Set initial counters
}
void loop(){
t = millis(); // Save current time
// If there is new serial data
if((c = Serial.read()) >= 0){
lastByteTime = lastAckTime = t; // Reset timeout counters
@ -274,6 +277,7 @@ void dataMode(){
uint8_t g=leds[i].g;
uint8_t b=leds[i].b;
/* Simple 255,255,255 = White approach
uint8_t w=min(r,min(g,b)); //get white content and use for white
r-=w; //subtract white content
@ -281,6 +285,7 @@ void dataMode(){
b-=w;
*/
// Calibration 20201207. These RGB values match the Neutral White color with calibW brightness.
uint8_t calibR=255;
uint8_t calibG=175;
@ -300,6 +305,7 @@ void dataMode(){
uint8_t w=calibW*whitecontent;
int inew = i;
#ifdef LED_OFFSET
inew = (i+LED_OFFSET)%Num_Leds; //if offset defined, move led 1 around and wrap around at the end