We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5b3b62f commit 3a86c1dCopy full SHA for 3a86c1d
gui/demos/vtest.py
@@ -1,11 +1,11 @@
1
# vtest.py Test/demo of VectorDial
2
3
# Released under the MIT License (MIT). See LICENSE.
4
-# Copyright (c) 2019 Peter Hinch
+# Copyright (c) 2019-2020 Peter Hinch
5
6
# Updated for uasyncio V3
7
8
-import urandom
+import os
9
import time
10
from cmath import rect, pi
11
import uasyncio as asyncio
@@ -51,7 +51,7 @@ async def ptr_test(dial):
51
ptr = Pointer(dial)
52
v = 0j
53
steps = 20 # No. of interpolation steps
54
- grv = lambda : urandom.getrandbits(16) / 2**15 - 1 # Random: range -1.0 to +1.0
+ grv = lambda: (int.from_bytes(os.urandom(1), 1) -128) / 128 # Random: range -1.0 to +1.0
55
while True:
56
v1 = grv() + 1j * grv() # Random vector
57
dv = (v1 - v) / steps # Interpolation vector
0 commit comments