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
// Freq is not the frequency in hertz but the time constant RC | |
int lowpass(int portinput, int freq, int samplerate, int prev){ | |
int RC = samplerate/(samplerate+freq); | |
int returnd = RC*portinput+(1-RC)*prev; | |
return returnd; | |
} | |
int highpass(int portinput, int freq, int samplerate, int prevport, int prevproc){ | |
int RC = samplerate/(samplerate+freq); | |
int returnd = RC*(prevproc+portinput-prevproc); | |
return returnd; |
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
[1, 2, 3, 5, 7, 11, 15, 22, 30, 42, 56, 77, 101, 135, 176, 231, 297, 385, 490, 627, 792, 1002, 1255, 1575, 1958, 2436, 3010, 3718, 4565, 5604, 6842, 8349, 10143, 12310, 14883, 17977, 21637, 26015, 31185, 37338, 44583, 53174, 63261, 75175, 89134, 105558, 124754, 147273, 173525, 204226, 239943, 281589, 329931, 386155, 451276, 526823, 614154, 715220, 831820, 966467, 1121505, 1300156, 1505499, 1741630, 2012558, 2323520, 2679689, 3087735, 3554345, 4087968, 4697205, 5392783, 6185689, 7089500, 8118264, 9289091, 10619863, 12132164, 13848650, 15796476, 18004327, 20506255, 23338469, 26543660, 30167357, 34262962, 38887673, 44108109, 49995925, 56634173, 64112359, 72533807, 82010177, 92669720, 104651419, 118114304, 133230930, 150198136, 169229875, 190569292, 214481126, 241265379, 271248950, 304801365, 342325709, 384276336, 431149389, 483502844, 541946240, 607163746, 679903203, 761002156, 851376628, 952050665, 1064144451, 1188908248, 1327710076L, 1482074143L, 1653668665L, 1844349560L, 2056148051L, 2291320912L, 2552338241L, |
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
int pwm_a = 3; //PWM control for motor outputs 1 and 2 is on digital pin 3 | |
int pwm_b = 11; //PWM control for motor outputs 3 and 4 is on digital pin 11 | |
int dir_a = 12; //direction control for motor outputs 1 and 2 is on digital pin 12 | |
int dir_b = 13; //direction control for motor outputs 3 and 4 is on digital pin 13 | |
int val = 0; | |
void setup(){ | |
pinMode(pwm_a, OUTPUT); | |
pinMode(pwm_b, OUTPUT); | |
pinMode(dir_b, OUTPUT); | |
pinMode(dir_a, OUTPUT); |
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
M[16],X=16,W,k; | |
main(){ | |
T(system("stty cbreak")); | |
puts(W&1?"WIN":"LOSE"); | |
} | |
K[]={2,3,1}; | |
s(f,d,i,j,l,P){ | |
for(i=4;i--;){ | |
for(j=k=l=0;k<4;){ |
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
#include <uspeech.h> | |
signal voice(A0); | |
char option = 0; | |
void setup(){ | |
voice.calibrate(); | |
voice.f_enabled = true; | |
Serial.begin(9600); | |
} | |
void loop(){ | |
//voice.sample(); |
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
------------------------------- MODULE hanoi ------------------------------- | |
EXTENDS Integers, Sequences | |
\* Towers of hanoi problem | |
VARIABLES tower1, tower2, tower3 | |
\* Initiallize the towers | |
Init == /\ tower1 = <<3,2,1,0>> | |
/\ tower2 = <<0>> | |
/\ tower3 = <<0>> | |
\* Transition rules |
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
def conjugation(self, vector): | |
"""Conjugation of vector by self. | |
@param self unit quaternion. | |
@param vector 3-vector, aka pure quaternion. | |
@return pure quaternion of result: self *vector*self. | |
""" | |
self.x,self.y,self.z = self.v | |
Q = np.array([[self.w, -self.z, self.y, self.x], | |
[ self.z, self.w, -self.x, self.y], | |
[-self.y, self.x, self.w, self.z], |
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 rospy | |
from sensor_msgs.msg import * | |
from cv_bridge import CvBridge | |
import cv2 | |
import numpy as np | |
bridge = CvBridge() | |
rospy.init_node("Redmasker") | |
image_pub = rospy.Publisher("RedMasked",Image) | |
def img_handler(msg): |
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 | |
# This is the most important shell utility... remember to place it in your PATH | |
# chmod +x mamama | |
echo "Ototototo" |
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
std_msgs/Header header | |
std_msgs/String source_id | |
std_msgs/String message |
OlderNewer