I’m a terrible programmer but i’m looking to put a server in a specific position bij doing a HTTP POST.
When compling my code i get this error: servo_over_the_internet.cpp:16:22: error: invalid user-defined conversion from ‘String’ to ‘int’ [-fpermissive]
This is the code on the Core.
Servo myservo;
int pos = 0;
void setup()
{
Spark.function("pos",setPosition);
myservo.attach(D0);
}
void loop()
{
}
int setPosition(String pos) {
myservo.write(pos);
}
And i’m going to use this url to post the position:
https://api.particle.io/v1/devices/53ff6cxxxxxxxxxxx42467?access_token=c7xxxxxxxxxxxxxxxxxxx21&pos=90
If anyone can give a little help… Thanks.
With kind regards,
Just Vervaart