This commit is contained in:
antopoid 2022-11-16 11:39:07 +01:00
parent c17a6bb850
commit 56c5b81810

View File

@ -179,7 +179,7 @@ void vScanTask(void *pvParameters){
adc_chars = calloc(1, sizeof(esp_adc_cal_characteristics_t)); adc_chars = calloc(1, sizeof(esp_adc_cal_characteristics_t));
esp_adc_cal_value_t val_type = esp_adc_cal_characterize(unit, atten, width, DEFAULT_VREF, adc_chars); esp_adc_cal_value_t val_type = esp_adc_cal_characterize(unit, atten, width, DEFAULT_VREF, adc_chars);
char text[100];
uint16_t measuredValues; uint16_t measuredValues;
int v; int v;
@ -195,9 +195,9 @@ void vScanTask(void *pvParameters){
printf("V = %d mV\n", measuredValues); printf("V = %d mV\n", measuredValues);
// Send message // Send message
char text[100];
sprintf(text, "%d\r\n", measuredValues); sprintf(text, "%d\n", measuredValues);
// Write data back to the UART // Write data back to the UART
int length = uart_write_bytes(UART_PORT_NUM, (const char *) text, strlen(text)); int length = uart_write_bytes(UART_PORT_NUM, (const char *) text, strlen(text));
@ -239,12 +239,13 @@ void vUpdateLedTask(void *pvParameters) {
/* duty cycle according to the color LED */ /* duty cycle according to the color LED */
if (strncmp(WHITE_LED_CMD, data, cmp_length) == 0) { if (strncmp(WHITE_LED_CMD, data, cmp_length) == 0) {
ledc_set_duty_and_update(LEDC_LOW_SPEED_MODE,LEDC_CHANNEL_1,0,0);
ledc_set_duty_and_update(LEDC_LOW_SPEED_MODE,LEDC_CHANNEL_0,1024,0);
} }
else if (strncmp(BLUE_LED_CMD, data, cmp_length) == 0) { else if (strncmp(BLUE_LED_CMD, data, cmp_length) == 0) {
ledc_set_duty_and_update(LEDC_LOW_SPEED_MODE,LEDC_CHANNEL_1,1024,0);
ledc_set_duty_and_update(LEDC_LOW_SPEED_MODE,LEDC_CHANNEL_0,0,0);
} }