View Single Post
  #4   Spotlight this post!  
Unread 27-01-2014, 11:34
amreuland's Avatar
amreuland amreuland is offline
Overworked Insomniac
AKA: Austin
FRC #2583 (Westwood Robotics)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Austin TX
Posts: 18
amreuland is on a distinguished road
Re: Talk to rpi from crio

Since you are using python, you can use a NetTables implementation.
I found that Team 3574's try at it is pretty good.
https://github.com/Team3574/2013Visi...c/nt_client.py

To set values in python:
Code:
from nt_client import NetworkTableClient

nt = NetworkTableClient("Team Number")
nt.setValue("key name", data) # Data can be number, string, boolean
To get values in python:
Code:
value = nt.getValue("key name")
To get the value in java:
Code:
import edu.wpi.first.wpilibj.networktables.NetworkTable;

NetworkTable table = NetworkTable.getTable("Table Name");
table.putNumber("key name", double);
table.putBoolean("key name", boolean);
table.putString("key name", String);
To set values:
Code:
double number = table.getNumber("key name");
boolean bool = table.getBoolean("key name");
String str = table.getString("key name");