Skip to content

Instantly share code, notes, and snippets.

View deadprogram's full-sized avatar
💭
Currently available for work. Let's talk!

Ron Evans deadprogram

💭
Currently available for work. Let's talk!
View GitHub Profile
// What it does:
//
// This example opens a video capture device, then streams MJPEG from it.
// Once running point your browser to the hostname/port you passed in the
// command line (for example http://localhost:8080) and you should see
// the live video stream.
//
// How to run:
//
// mjpeg-streamer [camera ID] [host:port]
// Connects to an MCP3008 ADC via SPI.
package main
import (
"errors"
"machine"
"time"
)
var (
// Automatically generated file. DO NOT EDIT.
// Generated by gen-device-svd.py from nrf52.svd, see https://github.com/NordicSemiconductor/nrfx/tree/master/mdk
// +build nrf,nrf52
// nRF52832 reference description for radio MCU with ARM 32-bit Cortex-M4 Microcontroller
//
// Copyright (c) 2010 - 2018, Nordic Semiconductor ASA All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// Automatically generated file. DO NOT EDIT.
// Generated by gen-device-svd.py from nrf52840.svd, see https://github.com/NordicSemiconductor/nrfx/tree/master/mdk
// +build nrf,nrf52840
// nRF52840 reference description for radio MCU with ARM 32-bit Cortex-M4 Microcontroller
//
// Copyright (c) 2010 - 2018, Nordic Semiconductor ASA All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@deadprogram
deadprogram / main.go
Created November 27, 2018 16:18 — forked from nikolaiianchuk/main.go
Fixed memory leaking
package main
import (
"fmt"
"io/ioutil"
"net/http"
"runtime"
"time"
"gocv.io/x/gocv"
package main
import (
"fmt"
"time"
"gobot.io/x/gobot"
"gobot.io/x/gobot/api"
)

Activities

Activity 1 - "Hello, World" of Computer Vision

You must change directory to the directory where GoCV has been installed, then you can run the code.

Windows

chdir %GOPATH%\src\gocv.io\x\gocv

go run cmd\hello\main.go

@deadprogram
deadprogram / mqttdash.go
Last active September 20, 2017 21:43
Simple Golang dashboard to show MQTT server activity by subscribing to all messages.
// how to run:
// go run mqtt.go tcp://iot.eclipse.org:1883 /topic/name
package main
import (
"os"
mqtt "github.com/eclipse/paho.mqtt.golang"
"github.com/gizak/termui"
)
pi@raspberrypi:~ $ ./raspi_ads1015
2017/04/26 18:26:02 Initializing connections...
2017/04/26 18:26:02 Initializing connection RaspberryPi-77EEC3CB ...
2017/04/26 18:26:02 Initializing devices...
2017/04/26 18:26:02 Initializing device ADS1x15-6235DFBD ...
2017/04/26 18:26:02 Robot ads1015bot initialized.
2017/04/26 18:26:02 Starting Robot ads1015bot ...
2017/04/26 18:26:02 Starting connections...
2017/04/26 18:26:02 Starting connection RaspberryPi-77EEC3CB...
2017/04/26 18:26:02 Starting devices...
package main
import "fmt"
type tableServer struct {
table int
}
type TableServer interface {
SetTable(table int)