Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
7 years, 3 months ago.
thread , sticker , how to do multitasking ??
hello
Im new to kl25z and cpp as well
this is my 1st project. its just few sensors and push buttons , and Im using esp8266.
Im not using any libraries for the wifi but I have code that run the wifi and everything is working good
my problem is that the wifi data are sent to the website and I have function inside the main loop that take two parameters from the main loop and this function send the data to the website. this takes more than 10 seconds to be done , so when I press push button for example I have to wait more than 10 seconds for the program to finish the wifi process and then respond to the button.
so what I need is that making the wifi process working on while loop and at the same time the main loop running.
so I need something like multitasking or parallel tasking. what should I use like i.e thread or whatever, BTW the wifi function call is inside the main function and it takes two parameters from the main function