This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Turn commanded position -5 to +5 into 1-2 mS pulse for RC (hobby) servo | |
# gain = 1 mS (range) / 50 mS (PWM period) / 10 (units)= 0.002 | |
# offset = 1.5 mS (value) / 50 mS (PWM period) = 0.03 | |
# Resulting PWM values should be between 0.02 and 0.04, representing a | |
# 1 mS to 2 mS wide pulse | |
def rc_servo(thread, name, range_ms, offset_ms, period_ms, min_step, max_step, in_signal, out_signal): | |
gain = range_ms / pwm_ms / (max_step - min_step) | |
offset = value_ms / pwm_ms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[connection] | |
id=Hotspot | |
uuid=bd4058b4-f99e-48f9-ac88-26513b9ac517 | |
type=wifi | |
autoconnect=true | |
permissions= | |
[wifi] | |
hidden=false | |
mac-address=00:0F:60:06:EE:BE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Number format] | |
post_decimals = 3 | |
pre_decimal_zero_padding = 0 | |
signed_values = 0 | |
pre_decimals = 4 | |
decimal_seperator = . | |
post_decimal_zero_padding = 1 | |
[Program] | |
cutter_comp_left = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
fileid="$1" | |
destination="$2" | |
# try to download the file | |
curl -c /tmp/cookie -L -o /tmp/probe.bin "https://drive.google.com/uc?export=download&id=${fileid}" | |
probeSize=`du -b /tmp/probe.bin | cut -f1` | |
# did we get a virus message? | |
# this will be the first line we get when trying to retrive a large file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
def download_file_from_google_drive(id, destination): | |
def get_confirm_token(response): | |
for key, value in response.cookies.items(): | |
if key.startswith('download_warning'): | |
return value | |
return None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library IEEE; | |
use IEEE.std_logic_1164.all; -- defines std_logic types | |
use IEEE.STD_LOGIC_ARITH.ALL; | |
use IEEE.STD_LOGIC_UNSIGNED.ALL; | |
-- Copyright (C) 2007, Peter C. Wallace, Mesa Electronics | |
-- http://www.mesanet.com | |
-- | |
-- This program is is licensed under a disjunctive dual license giving you | |
-- the choice of one of the two following sets of free software/open source |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
def exportPin(id): | |
try: | |
with open('/sys/class/gpio/export', 'w') as f: | |
f.write('%i' % id) | |
except IOError as e: | |
print(str(e)) | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Copyright 2014 Marta Rodriguez. | |
# | |
# Licensed under the Apache License, Version 2.0 (the 'License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo Building Google Protobuf for Mac OS X / iOS. | |
echo Use 'tail -f build.log' to monitor progress. | |
( | |
VERSION=2.6.1 | |
DARWIN_RELEASE=`uname -r` | |
CORES=`sysctl hw.ncpu | awk '{print $2}'` | |
#PREFIX=`pwd`/protobuf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Program to demonstrate time taken by function cos() */ | |
#include <stdio.h> | |
#include <time.h> | |
#include <math.h> | |
// The main program calls fun() and measures time taken by fun() | |
int main() | |
{ | |
// Calculate the time taken by fun() | |
clock_t start; |