I am really confused, I cannot seem to figure this out.
I am ready to build a project that involves collecting data on a form, then sending to the imp to do things with the data. Example, move motor this many steps… etc.
I am very new at this and was confident I could figure it out like arduino, but I need help. I have spent the entire night trying this with no resolution.
I am trying to learn step by step, starting with basic functions. The first task was getting the time. Done. The second task was getting a variable from a form, not done.
No matter what I change, if I am trying to assign a variable in the function set I get: “ERROR: trying to set ‘class’”.
The planner: I have HTTP IN pointed to my device(variable test) and pointed to Show Input. Whatever I type in the form shows on the show input. But the log gives me an error and seems to pause the imp.
`// variable test code
x <- 0; // set default
value <- 0; // set default
function display() //function to show on log and planner that value has been received
server.log(x); //fuction shows on code log
server.show(x); //fuction shows on planner
imp.wakeup(0.5, display); // loop
class value extends InputPort // import
name = “value” //the name I have the form field
type = “number” // the type of field I have the form set as
function set(value) // set function
x = value; // set "x" to equal whatever value I typed in on the form //imp.wakeup(0.5, display);
imp.configure(“Variable Test”, [value], ); //configure
display(); // run
Screenshot of planner attached.