Skip to content
Snippets Groups Projects
Commit 8b38aa9f authored by emorgan's avatar emorgan
Browse files

VizBlock rebranding

parent 5f3c4d0f
No related branches found
No related tags found
No related merge requests found
# Wallvis Framework
# VizBlocks Framework
This is an Arduino library that lets you easily create nodes to stick on the wall. Each node will listen on an MQTT channel, and respond to commands. So a node with a servo motor in might respond to:
* `wiggle 30` - wiggle by 30 degrees a few times
......@@ -7,9 +7,9 @@ These commands can be put in via NodeRED, or through the USB Serial connection f
## Installation
One way to install this is put it in you personal Arduino libraries directory. On a mac, this is `~/Documents/Arduino/libraries`. It is best to check it out with a capitalised name, i.e. `WallvisFramework` not `wallvisframework`. To do this, you can use:
One way to install this is put it in you personal Arduino libraries directory. On a mac, this is `~/Documents/Arduino/libraries`. It is best to check it out with a capitalised name, i.e. `VizBlocksFramework` not `vizblocksframework`. To do this, you can use:
`git clone https://git.ecdf.ed.ac.uk/design-informatics/wallvis/wallvisframework.git WallvisFramework`
`git clone https://git.ecdf.ed.ac.uk/design-informatics/vizblocks/vizblocksframework.git VizBlocksFramework`
The library will then appear in your list of Arduino libraries, along with examples.
......@@ -26,18 +26,18 @@ Because this is not a single sketch, development needs a bit of thinking about.
# Usage
The library is designed to be used within normal Arduino sketches. It wraps up most of the business of connecting to MQTT etc. in a `WallVis` class, and you then give it a bunch of `Behaviours` that do interesting things.
The library is designed to be used within normal Arduino sketches. It wraps up most of the business of connecting to MQTT etc. in a `VizBlocks` class, and you then give it a bunch of `Behaviours` that do interesting things.
## Setup
The node is set up with all of the connection information for the WiFi network and for NodeRE, e.g.:
```arduino
#include <WallVis.h>
#include <VizBlocks.h>
WallVis node(
VizBlocks node(
"new001", // Our ID
"WallVisNet", //Wifi Access Point
"wallvisAP", //WiFi Password
"VizBlocks", //Wifi Access Point
"dataisfun", //WiFi Password
"192.168.4.1",//IP address of Node RED server
1883 //Port for Node RED server
);
......
File moved
#ifndef WALLVIS_H
#define WALLVIS_H
#ifndef VIZBLOCKS_H
#define VIZBLOCKS_H
#include "Arduino.h"
#include "Behaviours.h"
#include "ServoBehaviours.h"
......@@ -14,7 +14,7 @@
class WallVis {
class VizBlocks {
char* _ssid;
char* _wifi_pass;
char* _id;
......@@ -32,7 +32,7 @@ class WallVis {
boolean _wifi;
public:
WallVis(char* id, char* ssid="WallVisNet", char* wifi_pass="wallvisAP",
VizBlocks(char* id, char* ssid="VizBlocks", char* wifi_pass="dataisfun",
char* server="192.168.4.1",int port=1883) : _id(id), _server(server), _port(port), _ssid(ssid), _wifi_pass(wifi_pass) {} ;
void command_callback(char *data, uint16_t len) {
......@@ -44,12 +44,12 @@ public:
/*
* Set up the WallVis node - WiFi, MQTT
* Set up the VizBlocks node - WiFi, MQTT
*/
void init() {
Serial.setTimeout(100);
Serial.println();
Serial.println(F("WallVis Node starting up"));
Serial.println(F("VizBlocks Node starting up"));
Serial.println("Initialising " + String(_id));
if( _wifi ) {
......@@ -235,12 +235,12 @@ public:
/* Left here temporarily - can't use a member function as a callback
So this was the start of a way to create a static function that would work
void* current_wallvis;
void* current_vizblocks;
void test_callback(char *data, uint16_t len) {
Serial.println("Callback: ");
Serial.println(data);
((WallVis*)current_wallvis)->process(String(data));
((VizBlocks*)current_vizblocks)->process(String(data));
}
*/
......
#include <WallVis.h>
#include <VizBlocks.h>
#include <Behaviours.h>
WallVis node(
VizBlocks node(
"new001", // Our ID
"WallVisNet", //Wifi Access Point
"wallvisAP", //WiFi Password
"VizBlocks", //Wifi Access Point
"dataisfun", //WiFi Password
"192.168.4.1",//IP address of Node RED server
1883 //Port for Node RED server
);
......
#include <Servo.h>
#include <WallVis.h>
#include <VizBlocks.h>
WallVis node(
VizBlocks node(
"new001", // Our ID
"WallVisNet", //Wifi Access Point
"wallvisAP", //WiFi Password
"VizBlocks", //Wifi Access Point
"dataisfun", //WiFi Password
"192.168.4.1",//IP address of Node RED server
1883 //Port for Node RED server
);
......
#include <WallVis.h>
#include <VizBlocks.h>
#include <Behaviours.h>
WallVis node(
VizBlocks node(
"new001", // Our ID
"WallVisNet", //Wifi Access Point
"wallvisAP", //WiFi Password
"VizBlocks", //Wifi Access Point
"dataisfun", //WiFi Password
"192.168.4.1",//IP address of Node RED server
1883 //Port for Node RED server
);
......
#include <Servo.h>
#include <WallVis.h>
#include <VizBlocks.h>
WallVis node(
VizBlocks node(
"new001", // Our ID
"WallVisNet", //Wifi Access Point
"wallvisAP", //WiFi Password
"VizBlocks", //Wifi Access Point
"dataisfun", //WiFi Password
"192.168.4.1",//IP address of Node RED server
1883 //Port for Node RED server
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment