Skip to content

Instantly share code, notes, and snippets.

View kashimAstro's full-sized avatar
🔒
busy

Dario Longobardi kashimAstro

🔒
busy
View GitHub Profile
@kashimAstro
kashimAstro / sem_multithread.cpp
Created October 18, 2017 09:49
simple multithreading with semaphore posix c++
#include <iostream>
#include <unistd.h>
#include <thread>
#include <vector>
#include <signal.h>
#include <semaphore.h>
using namespace std;
vector<thread*> th;
@kashimAstro
kashimAstro / tcp.ino
Created March 13, 2017 14:54
TCP server for ESP-07
#include <ESP8266WiFi.h>
const char* ssid = "************";
const char* password = "************";
WiFiServer server(5055);
int pinLeft = 13;
int pinRight = 12;
bool ValLeft = false;
@kashimAstro
kashimAstro / google_image.cpp
Created March 3, 2017 18:26
search image by google for popular trainer dlib
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <stdio.h>
#include <regex>
#include <fstream>
#include <curl/curl.h>
void write_file(std::string p, std::string d)
@kashimAstro
kashimAstro / UART3_enable.md
Last active November 16, 2022 12:09
sunxi H3 enable UART3

#simple step for enable UART3 H3 allwinner sunxi
download suite sunxi:
git clone https://github.com/linux-sunxi/sunxi-tools
compile:
make
convert /boot/script.bin in .fex ascii file for editing:
./bin2fex /boot/script.bin ~script.fex

@kashimAstro
kashimAstro / README.md
Last active May 5, 2021 17:47
H3 / Mali GPU driver and openframeworks armv7 ES / ES2

#A small guide to compile openFrameworks armv7 with driver OpenGL ES / ES2 sunxi for H3 / Mali GPU on ARMBIAN OS, compatible with orangepi and bananapi.

tested on: orangepi one banana pi M2

dependencies:

apt-get install libx11-dev libxext-dev xutils-dev libdrm-dev \ 
           x11proto-xf86dri-dev libxfixes-dev x11proto-dri2-dev xserver-xorg-dev \
 build-essential automake pkg-config libtool ca-certificates git cmake subversion
@kashimAstro
kashimAstro / fhogOF.cpp
Created January 25, 2017 11:46
extract fhog with dlib and openframeworks
void drawFHOG(ofPixels store, int x, int y)
{
ofPixels pix;
ofImage debug;
ofPushMatrix();
array2d<matrix<float,31,1> > hog;
array2d<rgb_pixel> img;
toDLib(store,img);//<-- view ofxDLib
@kashimAstro
kashimAstro / imglab_commandline.cpp
Last active March 2, 2017 16:26
dlib imglab command line, tool for train machine learning with dlib
/*
http://dlib.net/train_object_detector.cpp.html
Usage:
first step create positive train:
./bin/imglab_commandline positive/ "30,20,520,520" "person"
second step create negative train in append positive train previously created:
@kashimAstro
kashimAstro / OLEDpi.cpp
Created January 24, 2017 14:30
OLED i2c 128x64 script test
#include <iostream>
#include "ofxGPIO.h"
#define OLED 0x3C
#define WIDTH_OLED 128
#define HEIGHT_OLED 64
int main(int argc, char *argv[])
{
if(argc > 2)
@kashimAstro
kashimAstro / main.cpp
Last active February 22, 2019 13:08
Simple Motion blur by (Keijiro Takahashi) rewritten in c++
/*
Rewritten Code by Keijiro Takahashi
source:
https://github.com/keijiro/sketches2016/blob/master/Moblur/Moblur.pde
*/
#include "ofMain.h"
@kashimAstro
kashimAstro / ofLogAudio.h
Last active January 23, 2018 21:07
simple script audio synth for openframeworks
class ofLogAudio : public ofThread{
public:
bool startSpeak = false;
string msg;
string speak;
void start(string _c="/usr/bin/espeak -v mb-it3")
{
speak = _c;
startThread(true);