Commit bea206ec authored by Chris Prince's avatar Chris Prince

minor fix to provide service response to website; fix for button clicks;

parent 822e9cd5
...@@ -223,4 +223,9 @@ void loop() { ...@@ -223,4 +223,9 @@ void loop() {
// add if..else here to countdown before turning off laser? // add if..else here to countdown before turning off laser?
Serial.print("random State="); Serial.print("random State=");
Serial.println(randomState); //debugging Serial.println(randomState); //debugging
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: application/json");
client.println(""); // do not forget this one
client.println("{ Success: true }")
} }
{ {
"/move*": { "/move*": {
"target": "http://IP:80", "target": "http://192.168.0.131:80",
"secure": false, "secure": false,
"logLevel": "debug" "logLevel": "debug"
}, },
"/random*": { "/random*": {
"target": "http://IP:80", "target": "http://192.168.0.131:80",
"secure": false, "secure": false,
"logLevel": "debug" "logLevel": "debug"
}, },
"/start": { "/start*": {
"target": "http://IP:80", "target": "http://192.168.0.131:80",
"secure": false, "secure": false,
"logLevel": "debug" "logLevel": "debug"
}, },
"/stop": { "/stop*": {
"target": "http://IP:80", "target": "http://192.168.0.131:80",
"secure": false, "secure": false,
"logLevel": "debug" "logLevel": "debug"
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<div class="centered"> <div class="centered">
<div class="btn-block"> <div class="btn-block">
<button (click)="triggerLaser()" class="btn" [ngClass]="{ 'btn-outline-danger': laserState === 'on', 'btn-outline-info': laserState === 'off'}">Turn {{ laserState }} Laser</button> <button (click)="triggerLaser()" class="btn" [ngClass]="{ 'btn-outline-danger': laserState === 'on', 'btn-outline-info': laserState === 'off'}">Turn {{ laserState }} Laser</button>
<button class="btn btn-warning" [disabled]="randomRuns">Start Random Patterns</button> <button class="btn btn-warning" [disabled]="randomRuns" (click)="randomizeLaser()">Start Random Patterns</button>
</div> </div>
<div class="btn-block"> <div class="btn-block">
<div class="inline"> <div class="inline">
......
...@@ -39,7 +39,7 @@ export class AppComponent { ...@@ -39,7 +39,7 @@ export class AppComponent {
public moveLaser() { public moveLaser() {
const xy = this.form.value; const xy = this.form.value;
this.esp.move(xy.xPosition, xy.yPosition); this.esp.move(xy.xPosition, xy.yPosition).subscribe();
} }
public randomizeLaser() { public randomizeLaser() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment