Add some example scripts for pyboard (some can run on PC).

This commit is contained in:
Damien George
2014-01-07 17:14:05 +00:00
parent 7b21c2d8f0
commit fd04bb3bac
6 changed files with 146 additions and 12 deletions

11
examples/pyb.py Normal file
View File

@@ -0,0 +1,11 @@
# pyboard testing functions for PC
def delay(n):
pass
rand_seed = 1
def rand():
global rand_seed
# for these choice of numbers, see P L'Ecuyer, "Tables of linear congruential generators of different sizes and good lattice structure"
rand_seed = (rand_seed * 653276) % 8388593
return rand_seed