-->
Page 1 of 1

Need some help with (probably) just syntaxis related

PostPosted: Mon Aug 21, 2017 7:09 pm
by Savassan
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:

Re: Need some help with (probably) just syntaxis related

PostPosted: Wed Aug 23, 2017 3:16 am
by johnhu22
Same issue here, free running code works on my Arduino UNO but not on my D1 mini...
:? :? :?

Re: Need some help with (probably) just syntaxis related

PostPosted: Sun Aug 27, 2017 4:28 am
by schufti
Since "standard-ARDUINO" and ESP-ARDUINO are based on different cpu's direct register or peripheral access is not possible. Had you only used ARDUINO code it would be mostly compatible but by using hw specific "tricks" there is no easy way.