Page 1 of 1

about using math

Posted: Wed Jan 31, 2018 10:16 am
by tinhaode
hello!
I would like to use some of math related function calls like pow, sin, sqrt...
But it seems math function doesn't work with SDK.
Either #include<math.h> on user_main or -lm on the Linker doesn't work too.
Do you have any idea to work them out?

Re: about using math

Posted: Thu Feb 01, 2018 8:20 am
by AgentSmithers
That's funny. I was just reading this today.
http://moishelettvin.blogspot.com/2005/ ... posed.html

Indirectly it may relate to your question.

Re: about using math

Posted: Mon Feb 05, 2018 9:11 am
by tinhaode
sorry I can't open the url. could you copy some word?

Re: about using math

Posted: Fri Feb 09, 2018 12:37 am
by AgentSmithers
tinhaode wrote:sorry I can't open the url. could you copy some word?


What math functions would you like, How fast do they need to be?

Functions like Sin I think is 1 = x^2 + y^2 so I think if you take an argument you just do 1 - (arg)^2 = Value then SquareRoot that I think. Sorry I took trig like a year ago and it's already gone XD

Re: about using math

Posted: Sat Mar 24, 2018 1:02 am
by Pato
Hey,

@AgentSmithers: Indeed a kind of last resort solution would be to re-write the math functions (e.g. with Taylors series approximations, it's in the idea of what you proposed :) )

@tinhaode: did you managed to fin a solution ? I'm also trying to experiment with math functions, but I got linker errors. Maybe try using the limirom.a from the RTOS_SDK, it seemed to work for some folks...
https://bbs.espressif.com/viewtopic.php ... math#p3215
(failed with same error for me. I use a custom toolchain inspired from esp-open-sdk)

Re: about using math

Posted: Tue May 15, 2018 11:59 pm
by Pato
It may help, I was able to link against the math lib after some tweaking:

https://bbs.espressif.com/viewtopic.php?f=7&t=9432

about using math

Posted: Fri May 25, 2018 2:12 pm
by andreysnug
You could use GetAsyncKeyState from windows.h to detect key presses and program your own macros using SendInput.

Re: about using math

Posted: Mon Oct 05, 2020 5:52 pm
by neilwalker
MCian wrote:

Could you please explain more about GetAsyncKeyState? Can I use nodemcu-build for the ESP8266 WiFi SOC? I'm a student from Meycauayan College and I'm doing a project and need to use a math library buyessays tasks.


Full math library on nodemcu-build.com >>
github.com/nodemcu/nodemcu-firmware/issues/2403

As for the GetAsyncKeyState function, here it is described:

docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getasynckeystate