Newer
Older
"VizBlocks", //Wifi Access Point
"dataisfun", //WiFi Password
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
"192.168.4.1",//IP address of Node RED server
1883 //Port for Node RED server
);
/*
* Class that defines a custom behaviour
*/
class CustomBehaviour : public Behaviour {
public:
CustomBehaviour(String name) : Behaviour(name) {}
/*
* This is the bit that actually does something!
* args has all of the information that you are given in it, i.e. if
* your command is called 'custom', and the command was "custom 50",
* args would be "50"
*/
String start(String args) {
//This is where you do your stuff for a simple behaviour
return "Test behaviour " + _name + " with (" + args + ")";
}
};
void setup()
{
//Get the serial port ready
Serial.begin(115200);
//Add in three different versions of the servo wiggling, with different speed parameters
node.add(new CustomBehaviour("custom") );
//Initialise the whole infrastructure
node.init();
}
void loop()
{
//Should be all we have to do
node.vis_loop();
}