2025-04-15 1:34 AM
hii everyone
i would like to send an integer number that i get from the user on html webpage to the stm32 controller
lets say in the controller i just want to print the number that received from the webpage
what is the method that i need to use in order to receive an integer number from a web page
i saw once a method to send a string called CGI but i need to transfer an integer number not a char or a string how can i do this
2025-05-12 6:45 AM - edited 2025-05-13 12:58 AM
Surely, HTML is inherently text based?
(the clue is in the name - the 'T' stands for "Text")
So everything is just a char or a string.
It's not difficult to convert from a char or string to a number - there are standard library functions for that ...
2025-05-14 12:28 AM
hii thanks for your help can you give me the name of the library to use and the function to the conversion fro char to integer
2025-05-14 1:04 AM
@abeba.1 wrote:function to the conversion fro char to integer
Go on - it's in the Standard C Library.
See any C reference or textbook; eg, https://en.cppreference.com/w/c/string/byte
2025-05-14 10:50 AM
How about web sockets?
2025-05-14 11:03 AM
Perhaps look at atoi() or sscanf() ?
The conversion is pretty basic stuff, using decimal math.
Perhaps look more broadly at text and string handling and parsing.
2025-05-15 12:55 AM
hii thanks a lot for help :)