Skip to content

Commit

Permalink
fix nt set
Browse files Browse the repository at this point in the history
  • Loading branch information
Ellery Newcomer committed Dec 16, 2018
1 parent ea3e1d8 commit 9c445ef
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
14 changes: 14 additions & 0 deletions test_nt_read.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from networktables import NetworkTables
import time

import logging
logging.basicConfig(level=logging.DEBUG)

NetworkTables.initialize("127.0.0.1")


table = NetworkTables.getTable("LEDS")
time.sleep(.2)
nacho = table.getString("nacho", None)
time.sleep(.2)
print("nacho: %s" % (nacho,))
9 changes: 7 additions & 2 deletions test_nt_set.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from networktables import NetworkTables
import time
import sys

import logging
logging.basicConfig(level=logging.DEBUG)
Expand All @@ -8,5 +9,9 @@


table = NetworkTables.getTable("LEDS")
table.putString("nacho", "nacho")
time.sleep(1)
time.sleep(0.2)
key = "nacho"
val = sys.argv[1] if len(sys.argv) > 1 else key
print("setting %r to %r" % (key, val))
table.putString(key, val)
time.sleep(0.2)

0 comments on commit 9c445ef

Please sign in to comment.