about using math

tinhaode
Posts: 2
Joined: Tue Jan 30, 2018 5:42 pm

about using math

Postby tinhaode » Wed Jan 31, 2018 10:16 am

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?

AgentSmithers
Posts: 123
Joined: Sat Apr 01, 2017 1:21 am
Contact:

Re: about using math

Postby AgentSmithers » Thu Feb 01, 2018 8:20 am

That's funny. I was just reading this today.
http://moishelettvin.blogspot.com/2005/ ... posed.html

Indirectly it may relate to your question.

tinhaode
Posts: 2
Joined: Tue Jan 30, 2018 5:42 pm

Re: about using math

Postby tinhaode » Mon Feb 05, 2018 9:11 am

sorry I can't open the url. could you copy some word?

AgentSmithers
Posts: 123
Joined: Sat Apr 01, 2017 1:21 am
Contact:

Re: about using math

Postby AgentSmithers » Fri Feb 09, 2018 12:37 am

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

Pato
Posts: 32
Joined: Sat Mar 24, 2018 12:52 am

Re: about using math

Postby Pato » Sat Mar 24, 2018 1:02 am

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)

Pato
Posts: 32
Joined: Sat Mar 24, 2018 12:52 am

Re: about using math

Postby Pato » Tue May 15, 2018 11:59 pm

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

andreysnug
Posts: 21
Joined: Wed May 16, 2018 12:33 pm

about using math

Postby andreysnug » Fri May 25, 2018 2:12 pm

You could use GetAsyncKeyState from windows.h to detect key presses and program your own macros using SendInput.

Who is online

Users browsing this forum: No registered users and 16 guests