Post topics, source code that relate to the Arduino Platform

User avatar
By Savassan
#69378 So I've been trying to implement a rgb LED controller that uses FHT, everything was fine until I compiled my 'frankesteinic' code (a mix of a many codes found in the web), I know that might get me some trouble, but I just want to give it a try.

My problem right now is this part of my code:
Code: Select all  TIMSK0 = 0; // turn off timer 0
  ADCSRA = 0xe5; // set adc to 'free running mode'
  ADMUX = 0x40; // adc0 as A0
  DIDR0 = 0x01; // turn off digital input for adc0


Which, I presume it works for a typical Arduino board, which (I thought) would work with my D1 Mini (ESP8266 Board); well, guess what? it didn't work as I thought. Anyways the error Arduino IDE shows is this:

m1:41: error: 'TIMSK0' was not declared in this scope

TIMSK0 = 0; // turn off timer0 for lower jitter

^

m1:42: error: 'ADCSRA' was not declared in this scope

ADCSRA = 0xe5; // set the adc to free running mode

^

m1:43: error: 'ADMUX' was not declared in this scope

ADMUX = 0x40; // use adc0 as A0

^

m1:44: error: 'DIDR0' was not declared in this scope

DIDR0 = 0x01; // turn off the digital input for adc0

^

exit status 1
'TIMSK0' was not declared in this scope


I've been looking for answers for 2 days now, and so far I found that you can't use the ESP8266 timers (I may be wrong), but, is it possible to change the syntax of that part of my code to suit the characteristics of my board?

Any kind of help would be more than welcomed, even if it's just some info about the ESP8266 that I seem to be missing, thaanks everyone, and sorry if this isn't the correct place to post this! :mrgreen:
Last edited by Savassan on Wed Aug 23, 2017 3:16 am, edited 1 time in total.