Skip to content

Instantly share code, notes, and snippets.

View six519's full-sized avatar

Ferdinand E. Silva six519

View GitHub Profile
@six519
six519 / test.c
Created April 22, 2018 01:08
Pure C Language In Arduino Uno (Sample Code 2)
/*
Compiling and uploading to Arduino Uno (Sample Code 2)
======================================================
avr-gcc -Os -mmcu=atmega328p -c test.c
avr-gcc -mmcu=atmega328p -o test.elf test.o
avr-objcopy -O ihex -R .eeprom test.elf test.hex
avrdude -F -V -c arduino -p ATMEGA328P -P /dev/cu.usbmodem1421 -b 115200 -U flash:w:test.hex
*/
@six519
six519 / test.c
Last active April 21, 2018 08:32
Pure C Language In Arduino Uno
/*
Compiling and uploading to Arduino Uno
======================================
avr-gcc -Os -mmcu=atmega328p -c test.c
avr-gcc -mmcu=atmega328p -o test.elf test.o
avr-objcopy -O ihex -R .eeprom test.elf test.hex
avrdude -F -V -c arduino -p ATMEGA328P -P /dev/cu.usbmodem1421 -b 115200 -U flash:w:test.hex
*/
@six519
six519 / MainActivity.java
Created January 30, 2018 08:49
Connecting Android Device To HC-05 Bluetooth Module Sample Code (Java)
package com.ferdinandsilva.bluetoothtest;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothSocket;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
@six519
six519 / main.go
Created December 30, 2017 02:40
Simple IRC Bot (Go Programming Language Sample Code)
package main
import (
"fmt"
"net"
"bufio"
"strings"
"net/textproto"
)
@six519
six519 / gpio.go
Created December 29, 2017 06:55
(Go Programming Language) Write To Raspberry Pi GPIO Pins
/*
Install the library
-------------------
go get github.com/six519/gpio
Sample usage
------------
Go to https://github.com/six519/gpio
@six519
six519 / opencv_test.js
Last active February 29, 2020 10:42
(Node.js Sample Code) Basic Motion Detection With OpenCV
var cv = require('./node_modules/opencv/lib/opencv');
var sleep = require('sleep');
var camera = new cv.VideoCapture(0); //open camera
//set the video size to 512x288
camera.setWidth(512);
camera.setHeight(288);
var window = new cv.NamedWindow('Camera');
var firstFrame, frameDelta, gray, thresh;
@six519
six519 / opencv_test.rb
Created December 12, 2017 08:50
(Ruby Sample Code) Basic Motion Detection With OpenCV
require 'opencv'
include OpenCV
camera = CvCapture.open #open camera
#set the video size to 512x288
camera.width = 512
camera.height = 288
window = GUI::Window.new 'Camera'
@six519
six519 / OpenCVTest.java
Created December 4, 2017 10:50
Basic Motion Detection With OpenCV Java Sample Code
package com.ferdinandsilva;
import java.util.ArrayList;
import java.util.List;
import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.core.MatOfPoint;
import org.opencv.core.Point;
import org.opencv.core.Size;
@six519
six519 / opencv_test2.cpp
Created December 1, 2017 09:49
Basic Motion Detection With OpenCV C++ Sample Code
/*
* To compile: g++ opencv_test2.cpp -o opencv_test2 $(pkg-config --cflags --libs opencv)
*/
#include <opencv2/opencv.hpp>
#include <opencv2/tracking.hpp>
#include <opencv2/core/ocl.hpp>
#include <unistd.h>
using namespace cv;
using namespace std;
@six519
six519 / opencv_test.cpp
Last active November 28, 2017 08:31
OpenCV Object Tracking Using Kernelized Correlation Filters C++ Sample Code
/*
* To compile: g++ opencv_test.cpp -o opencv_test $(pkg-config --cflags --libs opencv)
*/
#include <opencv2/opencv.hpp>
#include <opencv2/tracking.hpp>
#include <opencv2/core/ocl.hpp>
#include <unistd.h>
#define WINDOW_NAME "Camera"
using namespace cv;