Browse Source

first commit

master
Bin ohne name geboren 2 years ago
commit
4cdbb6303a
9 changed files with 128 additions and 0 deletions
  1. +34
    -0
      Config/HardwareControl.json
  2. +13
    -0
      Config/Regal0.json
  3. +13
    -0
      Config/Regal1.json
  4. +13
    -0
      Config/Regal2.json
  5. +1
    -0
      Config/StructContainer.go
  6. +3
    -0
      README.md
  7. BIN
      RP2_Pinout.png
  8. BIN
      servertest
  9. +51
    -0
      servertest.go

+ 34
- 0
Config/HardwareControl.json View File

@@ -0,0 +1,34 @@
{
//########################
//Servo
//#########################
"ServoControlBus":1,
"ServoRollChannel":5,
"ServoRollMax":500,
"ServoRollMin":140,
"ServoRollMid":310,

"ServoRotateChannel":14,
"ServoRotateMax":500,
"ServoRotateMin":140,
"ServoRotateMid":307,

//########################
//Sangu-3D-Controller
//########################
"3DControlPort":"/dev/ttyUSB0",
"3DControlCustomLogger":false,

//########################
//Movment Config
//########################
"Speed":600,
"SpeedXOffset":0,
"SpeedYOffset":0,
"SpeedZOffset":900,

//########################
//Storage Config
//########################
"RegalAnzahl":3
}

+ 13
- 0
Config/Regal0.json View File

@@ -0,0 +1,13 @@
{
"RegalID":0,
"ServoRotateOffset":0,
"RegalstartX":0,
"RegalstartY":0,
"RegalstartZ":0,
"fachary":0,
"fachoffset":0,
"pickupoffset":0,
"pickupMove":{"XOffset":0,"YOffset":0},
"pickupSpeed":{"XspeedOffset":0,"YspeedOffset":0,"ZspeedOffset":0},
"faecher":[]
}

+ 13
- 0
Config/Regal1.json View File

@@ -0,0 +1,13 @@
{
"RegalID":1,
"ServoRotateOffset":0,
"RegalstartX":0,
"RegalstartY":0,
"RegalstartZ":0,
"fachary":0,
"fachoffset":0,
"pickupoffset":0,
"pickupMove":{"XOffset":0,"YOffset":0},
"pickupSpeed":{"XspeedOffset":0,"YspeedOffset":0,"ZspeedOffset":0},
"faecher":[]
}

+ 13
- 0
Config/Regal2.json View File

@@ -0,0 +1,13 @@
{
"RegalID":2,
"ServoRotateOffset":0,
"RegalstartX":0,
"RegalstartY":0,
"RegalstartZ":0,
"fachary":0,
"fachoffset":0,
"pickupoffset":0,
"pickupMove":{"XOffset":0,"YOffset":0},
"pickupSpeed":{"XspeedOffset":0,"YspeedOffset":0,"ZspeedOffset":0},
"faecher":[]
}

+ 1
- 0
Config/StructContainer.go View File

@@ -0,0 +1 @@
package Config

+ 3
- 0
README.md View File

@@ -0,0 +1,3 @@
Complete_Hardware_Control_for everything
----------------------------------------


BIN
RP2_Pinout.png View File

Before After
Width: 1006  |  Height: 600  |  Size: 541KB

BIN
servertest View File


+ 51
- 0
servertest.go View File

@@ -0,0 +1,51 @@
package main

import (
"fmt"
"log"
"net/http"
"strings"
)

type httphandlerrework struct {
}

// formatRequest generates ascii representation of a request
func formatRequest(r *http.Request) string {
// Create return string
var request []string
// Add the request string
url := fmt.Sprintf("%v %v %v", r.Method, r.URL, r.Proto)
request = append(request, fmt.Sprintf("%v", r.URL.Query()))
request = append(request, url)
// Add the host
request = append(request, fmt.Sprintf("Host: %v", r.Host))
// Loop through headers
for name, headers := range r.Header {
name = strings.ToLower(name)
for _, h := range headers {
request = append(request, fmt.Sprintf("%v: %v", name, h))
}
}

// If this is a POST, add post data
if r.Method == "POST" {
r.ParseForm()
request = append(request, "\n")
request = append(request, r.Form.Encode())
}
// Return the request as a string
return strings.Join(request, "\n")
}

func (h *httphandlerrework) ServeHTTP(writer http.ResponseWriter, req *http.Request) {
// fmt.Println("s%", formatRequest(req))
fmt.Fprint(writer, formatRequest(req))
}

func main() {
err := http.ListenAndServe("localhost:33949", &httphandlerrework{}) // set listen port
if err != nil {
log.Fatal("ListenAndServe: ", err)
}
}

Loading…
Cancel
Save