This the first episode of my series called ESPSMS. In this blog I will tell you how you can ask you assistant some basic questions and also do some basic calculations in it.So lets get started……
You can ask ESPSMS on those questions, which are inbuilt in its code. You can check out the questions which you can ask in the library called constants.h. I have taught esp some questions regarding its origin, it’s teacher etc….. You can asks questions like
who are you?
where are you from?
who is your teacher?
what is your aim?
etc… Now the question is how to do this.First we will learn making calculator because this doesn’t require any API and afterwards we will see how to made espsms answer basic questions.
At first I thought to make calculator by API but why to make it complicated while we can make it simple by just using our arduino code. For Calculator, I just compared the string starting with “Calculate” and then given the string to a function called calci();
Inside that function, we are just separating first number, the sign and the second number on the basis of space between them. As you will study the library you will come to know everything.
In this calculator I have also attached the text of the maths sign along with sign itself. I mean to say is this,
so that you can write “Calculate 322 + 233” or “Calculate 322 plus 233” the result will be the same. So this is the most basic trick of our personal assistant ESPSMS. Moving towards the second trick.
Answering basic questions
This is something which involves making an API and than requesting it through our board.So first I decided some questions which may get asked to this new born assistant like who are you, where are you from etc…. So I already wrote its answer somewhere on the internet and then I made their API using thingspeak.com. Now if you don’t know how to make an API then kindly visit my blog on Fetching data from any website to know how to make an API. In that article I have shown step by step making an API.
Everytime you watch or read a new episode kindly upgrade your code as to access the tricks discussed in the episode.
You can download the code from here