Skip to content

Instantly share code, notes, and snippets.

//////////////////////CONFIGURATION///////////////////////////////
#define chanel_number 8 //set the number of chanels
#define default_servo_value 1500 //set the default servo value
#define PPM_FrLen 22500 //set the PPM frame length in microseconds (1ms = 1000µs)
#define PPM_PulseLen 300 //set the pulse length
#define onState 1 //set polarity of the pulses: 1 is positive, 0 is negative
#define sigPin 10 //set PPM signal output pin on the arduino
//////////////////////////////////////////////////////////////////
@FLYBYME
FLYBYME / dsm.ino
Created November 18, 2017 21:49
decode dsm packet
#define BUFFER_SIZE 14
#define MAX_CHANS 8
int ledPin = 13;
int count = 0;
int chan[MAX_CHANS];
bool state = false;
bool sync = false;
byte chanBuffer[BUFFER_SIZE];
@FLYBYME
FLYBYME / main.cpp
Created November 16, 2017 19:54
menu system
#include <iostream>
#include <string>
#include "sub_menu.h"
#include "menu.h"
using namespace std;
MenuHelper menu;
void searchMenuHandler() {
cout << "searchMenuHandler" << endl;
#include <Wire.h>
#include <mavlink.h>
struct STREAM_DATA {
uint16_t battVoltage = 0;
float altitude = 0;
float climb = 0;
float roll = 0;
float pitch = 0;
/*
*
* (C) 2013, MangoRaft.
*
*/
require('sugar');
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var Mixed = mongoose.Schema.Types.Mixed;
var _ = require("underscore");
var mongoose = require('mongoose'), Schema = mongoose.Schema, Mixed = mongoose.Schema.Types.Mixed;
var options = {
db : {
native_parser : true
},
server : {
poolSize : 15
}
};
/**
* Module dependencies and config.
*/
var express = require('express')
var rTorrent = require('rtorrent')
var rt = new rTorrent({
host : 'localhost',
port : 80,
Error: error:24064064:random number generator:SSLEAY_RAND_BYTES:PRNG not seeded
at Object.exports.uid (/node_modules/connect/lib/utils.js:133:17)
at MemoryStore.store.generate (/node_modules/connect/lib/middleware/session.js:204:27)
at generate (/node_modules/connect/lib/middleware/session.js:288:13)
at Object.session [as handle] (/node_modules/connect/lib/middleware/session.js:297:7)
at next (/node_modules/connect/lib/proto.js:190:15)
at Object.cookieParser [as handle] (/node_modules/connect/lib/middleware/cookieParser.js:60:5)
at next (/node_modules/connect/lib/proto.js:190:15)
at Object.favicon [as handle] (/node_modules/connect/lib/middleware/favicon.js:78:7)
at next (/node_modules/connect/lib/proto.js:190:15)
var bouncy = require('bouncy');
var http = require('http');
var net = require('net');
function connect(cb) {
var options = {
hostname : 'localhost',
port : 8000,
path : '/',
method : 'GET'
};
^C[bob@bob-workstation calipso]$ npm install node-expat
npm http GET https://registry.npmjs.org/node-expat
npm http 304 https://registry.npmjs.org/node-expat
> [email protected] install /home/bob/Documents/node/calipso/node_modules/node-expat
> node-waf configure build
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar