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
""" | |
client.py - AsyncIO Server using StreamReader and StreamWriter | |
This will create 200 client connections to a server running server.py | |
It will handshake and run similar to this: | |
Server: HELLO | |
Client: WORLD |
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
var webSocket = require('ws'), | |
ws = new webSocket('ws://10.0.0.3:9000/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), |
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
#Bisection Method to find roots of a non linear equation | |
#Praveen Sridhar | |
#psbots.blogspot.com | |
def bisection(function,lower_bound,upper_bound,error_tolerance=1.0e-4): | |
fu=function(upper_bound) | |
if fu==0.0 : return upper_bound | |
fl=function(lower_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 |
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
//Obstacle Avoiding robot | |
//Praveen Sridhar | |
//psbots.blogspot.com | |
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; |