Skip to content

Instantly share code, notes, and snippets.

psbots /
Created Jul 13, 2017 — forked from dbehnke/
Python AsyncIO Client and Server Example using StreamReader and StreamWriter
""" - AsyncIO Server using StreamReader and StreamWriter
This will create 200 client connections to a server running
It will handshake and run similar to this:
Server: HELLO
Client: WORLD
psbots / accbot.js
Created Jan 21, 2014
Android Accelerometer controlled bot via WebSockets. For more info visit :
View accbot.js
var webSocket = require('ws'),
ws = new webSocket('ws://'),
five = require('johnny-five'),
board = new five.Board();
board.on("ready", function() {
var xspeed, turnspeed, motors;
var i1=new five.Pin(8),
i2=new five.Pin(10),
psbots /
Last active Dec 13, 2015
Bisection method to find roots of a non-linear equation
#Bisection Method to find roots of a non linear equation
#Praveen Sridhar
def bisection(function,lower_bound,upper_bound,error_tolerance=1.0e-4):
if fu==0.0 : return upper_bound
if fl==0.0 : return lower_bound
if fu*fl > 0.0: #if the product of the function values at the two bounds is positive, then they do not bracket a root
return None
psbots / avoidobstacle.pde
Last active Feb 6, 2020
Obstacle Avoiding Robot- Arduino code
View avoidobstacle.pde
//Obstacle Avoiding robot
//Praveen Sridhar
const int left=1,mid=2,right=3;
const int i1=8,i2=10,ea=9,i3=5,i4=7,eb=6;
const int cthres=600,rthres=600,lthres=600;
int s1=0;
int s2=0;
int s3=0;
int r;