mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Initial checkin of unified hierarchy of WPILib 2015
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
//============================================================================
|
||||
// Name : Robot.cpp
|
||||
// Author :
|
||||
// Version :
|
||||
// Copyright :
|
||||
// Description : Hello World in C++, Ansi-style
|
||||
//============================================================================
|
||||
|
||||
#include <networktables/NetworkTable.h>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
// This is a simple robot program
|
||||
int main() {
|
||||
NetworkTable::SetServerMode();
|
||||
NetworkTable::SetTeam(190);
|
||||
NetworkTable* table = NetworkTable::GetTable("SmartDashboard");
|
||||
cout << "Started up" << endl;
|
||||
|
||||
long i = 0;
|
||||
while (true) {
|
||||
cout << i << endl;
|
||||
table->PutNumber("i", i);
|
||||
i++;
|
||||
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package $package;
|
||||
|
||||
/**
|
||||
* Simplest possible robot program
|
||||
*
|
||||
* @author Team $team-number
|
||||
*/
|
||||
public class Robot {
|
||||
|
||||
/**
|
||||
* @param args Input....
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
// Do stuff here!
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<examples>
|
||||
<tagDescription>
|
||||
<name>Simple Robot</name>
|
||||
<description>Examples for simple robot programs.</description>
|
||||
</tagDescription>
|
||||
<tagDescription>
|
||||
<name>Network Tables</name>
|
||||
<description>Examples of how to use Network Tables to accomplish a
|
||||
variety of tasks such as sending and receiving values to both
|
||||
dashboards and co-processors..</description>
|
||||
</tagDescription>
|
||||
|
||||
<example>
|
||||
<name>Simple Robot Example</name>
|
||||
<description>The simplest possible program that compiles. This
|
||||
shows the structure of a simple program that does nothing at
|
||||
all.</description>
|
||||
<tags>
|
||||
<tag>Simple Robot</tag>
|
||||
</tags>
|
||||
<packages>
|
||||
<package>src</package>
|
||||
</packages>
|
||||
<files>
|
||||
<file source="examples/Simple Robot Example/Robot.java" destination="src/Robot.cpp" />
|
||||
</files>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<name>Network Table Counter</name>
|
||||
<description>A simple program that increments a network table
|
||||
variable once every second. This shows the structure of a simple
|
||||
program that only uses network tables.</description>
|
||||
<tags>
|
||||
<tag>Simple Robot</tag>
|
||||
<tag>Network Tables</tag>
|
||||
</tags>
|
||||
<packages>
|
||||
<package>src</package>
|
||||
</packages>
|
||||
<files>
|
||||
<file source="examples/Network Table Counter/Robot.cpp" destination="src/Robot.cpp" />
|
||||
</files>
|
||||
</example>
|
||||
|
||||
</examples>
|
||||
Reference in New Issue
Block a user