Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rev. 2.0 ALS not functioning, TSC2004 library buffer blocks BBQ10 #1

Open
S0U1SB4N3 opened this issue Sep 16, 2021 · 3 comments
Open

Comments

@S0U1SB4N3
Copy link

the ALS does not work when doing analogRead(A5)
the hello_feather.ino
if loaded onto a Adafruit Huzzah 32 feather
the touch screen buffer is the same buffer as the BBQ10 keyboard so you type and nothing happens but if you touch the screen then during the pressing of the screen it will type what you keyed in.

if i disable the touchscreen then the keyboard functions as desired but you lose the touchscreen capabilities.

@KCNilssen
Copy link

Same problem here. I cant seem to get the ALS working as well

@arturo182
Copy link

Hi, sorry I missed the original issue, somehow I had notifications for all solder party repos turned off by default (???)

I have pushed a fix for the TSC issue just now: https://github.com/solderparty/arduino_tsc2004

For the ALS, I have verified it using a SAMD51 Feather and an RP2040 Feather. Unsure about the ESP32 Feather, but I do have a vague memory that you can't use ADC and Wi-Fi at the same time?
https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/peripherals/adc.html

image

@KCNilssen
Copy link

KCNilssen commented Jan 3, 2022

I am using the Unexpected Maker FeatherS2 board. This is a basic example of what I used to get the ALS working for me. Since this also uses ADC1 instead of ADC2, this approach will also work with wifi enabled on the ESP32-s2.

#include <driver/adc.h>

void setup() {
  // put your setup code here, to run once:
  esp_err_t config_width_response, config_channel_atten_responce;

  config_width_response = adc1_config_width(ADC_WIDTH_BIT_13);

  if ( config_width_response == ESP_OK ) {
    Serial.println(F("adc1_config_width(ADC_WIDTH_BIT_13): ESP_OK"));
    config_channel_atten_responce = adc1_config_channel_atten(ADC1_CHANNEL_4, ADC_ATTEN_DB_0);

    if ( config_channel_atten_responce == ESP_OK ) {
      Serial.println(F("adc1_config_channel_atten(ADC1_CHANNEL_4, ADC_ATTEN_DB_0): ESP_OK"));
    } else {
      Serial.println(F("adc1_config_channel_atten(ADC1_CHANNEL_4, ADC_ATTEN_DB_0):  ESP_ERR_INVALID_ARG Parameter error"));
    }
  } else {
    Serial.println(F("adc1_config_width(ADC_WIDTH_BIT_13): ESP_ERR_INVALID_ARG Parameter error"));    
  }
}

void loop() {
  // put your main code here, to run repeatedly:
  Serial.println(adc1_get_raw(ADC1_CHANNEL_4));
} 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants