title: TSL237 sensor on ESP8266 Wemos D1 Mini
body: <p>I'm trying to read a <a href="https://ams.com/en/tsl237" rel="nofollow noreferrer">TSL237</a> light sensor using my ESP8266 Wemos D1 Mini board. I have got code for an Arduino Uno from <a href="https://stackoverflow.com/questions/70206816/how-can-i-get-raspberry-pi-4b-to-read-a-tsl237-lf-sensor">here</a> (see copied below) and loaded it on my board. I first tried pin D0 on my board (GPIO 16) for the sensor data input, then pin D1 (GPIO5). In both cases I get the same useless output; I've copied one loop of this output below. Any ideas what I'm doing wrong?</p>
  <p><strong>CODE:</strong></p>
  <pre><code>#define TSL237  2
  volatile unsigned long pulse_cnt = 0;
  
  
  void setup() {
   attachInterrupt(0, add_pulse, RISING);
   pinMode(TSL237, INPUT);
   Serial.begin(9600);
  }
  
  void add_pulse(){
    pulse_cnt++;
    return;
  }
  
  unsigned long Frequency() { 
      
   pulse_cnt = 0;
   delay(10000);// this delay controlls pulse_cnt read out. longer delay == higher number
     // DO NOT change this delay; it will void calibration.
   unsigned long frequency = pulse_cnt;
   return (frequency);
   pulse_cnt = 0;    
   }
  void loop() {
     unsigned long frequency = Frequency();
     Serial.println(frequency);
     delay(5000);
        
  }
  </code></pre>
  <p><strong>OUTPUT:</strong></p>
  <pre><code>14:26:59.605 -&gt;  ets Jan  8 2013,rst cause:2, boot mode:(3,6)
  14:26:59.605 -&gt; 
  14:26:59.605 -&gt; load 0x4010f000, len 3460, room 16 
  14:26:59.605 -&gt; tail 4
  14:26:59.605 -&gt; chksum 0xcc
  14:26:59.605 -&gt; load 0x3fff20b8, len 40, room 4 
  14:26:59.605 -&gt; tail 4
  14:26:59.605 -&gt; chksum 0xc9
  14:26:59.605 -&gt; csum 0xc9
  14:26:59.605 -&gt; v00041fe0
  14:26:59.605 -&gt; ~ld
  </code></pre>