From 1f5e57112b18970a1862f103b1b50b0770f12de3 Mon Sep 17 00:00:00 2001
From: Pascal Serrarens <pse@pale.blue>
Date: Wed, 12 Mar 2025 14:55:55 +0100
Subject: [PATCH] Added BB2B example script

---
 Examples/BB2B/BB2B.cs | 31 +++++++++++++++++++++++++++++++
 README.md             |  6 +++---
 2 files changed, 34 insertions(+), 3 deletions(-)
 create mode 100644 Examples/BB2B/BB2B.cs

diff --git a/Examples/BB2B/BB2B.cs b/Examples/BB2B/BB2B.cs
new file mode 100644
index 0000000..9429ddc
--- /dev/null
+++ b/Examples/BB2B/BB2B.cs
@@ -0,0 +1,31 @@
+using System.Threading;
+using RoboidControl;
+
+class BB2B {
+    static void Main() {
+        // The robot's propulsion is a differential drive
+        DifferentialDrive bb2b = new();
+        // Is has a touch sensor at the front left of the roboid
+        TouchSensor touchLeft = new(bb2b);
+        // and other one on the right
+        TouchSensor touchRight = new(bb2b);
+
+        // Do forever:
+        while (true) {
+            // The left wheel turns forward when nothing is touched on the right side
+            // and turn backward when the roboid hits something on the right
+            float leftWheelSpeed = touchRight.touchedSomething ? -600.0f : 600.0f;
+            // The right wheel does the same, but instead is controlled by
+            // touches on the left side
+            float rightWheelSpeed = touchLeft.touchedSomething ? -600.0f : 600.0f;
+            // When both sides are touching something, both wheels will turn backward
+            // and the roboid will move backwards
+            bb2b.SetWheelVelocity(leftWheelSpeed, rightWheelSpeed);
+
+            // Update the roboid state
+            bb2b.Update(true);
+            // and sleep for 100ms
+            Thread.Sleep(100);
+        }
+    }
+}
\ No newline at end of file
diff --git a/README.md b/README.md
index a094cee..de163e8 100644
--- a/README.md
+++ b/README.md
@@ -5,6 +5,6 @@ Includes support for the Unity game engine.
 
 # Basic components
 
-- Passer::RoboidControl::Thing
-- Passer::RoboidControl::Participant
-- Passer::RoboidControl::SiteServer
\ No newline at end of file
+- RoboidControl::Thing
+- RoboidControl::LocalParticipant
+- RoboidControl::SiteServer
\ No newline at end of file