I saw at FarmBot JS | FarmBot Developer Documentation that I can work with farmbot with javascript, or JS. There I saw a link “See the annotated type definitions for available methods and properties. – github. com/FarmBot/farmbot-js/blob/main/dist/farmbot.d.ts”
It redirected me to github into document farmbot.d.ts. But there were nothing that could help me (or I just didn’t saw it helpfull) - there were no commands like in this example:
bot
.home({ axis: "x", speed: 800 })
.then(function (ack) {
console.log("X Axis is now at 0.");
})
.catch(function (err) {
console.log("Failed to bring X axis home.");
})
In his example there was return farmbot123.togglePin({ pin_number: 7 }); command.
From where can I access these commands? Or where can I get documentation about FarmBot JS?
Thank you, @jsimmonds ! One more question - I saw lines 139-142 with this code:
/** Bring a particular axis (or all of them) to position 0 in Z Y X order. */
this.home = function (args) {
return _this.send((0, util_1.rpcRequest)([{ kind: "home", args: args }]));
};
If I am right, it sends all XYZ to their home position, that is 0,0,0. The code from example sends only X to its home position:
bot
.home({ axis: "x", speed: 800 })
.then(function (ack) {
console.log("X Axis is now at 0.");
})
.catch(function (err) {
console.log("Failed to bring X axis home.");
})
How can I understand, how many parameters and which I have that I should input? In current example, I am calling .home({ axis: "x", speed: 800 }) - I have axis and speed in current example.