# Coding

**URL:** https://xrp.discourse.group/c/coding/13.md?page=1

[Latest](https://xrp.discourse.group/latest.md) · [Categories](https://xrp.discourse.group/categories.md) · [Tags](https://xrp.discourse.group/tags.md)

**Page:** 2

---

## [How XRP Code Editor interact with firmware?](https://xrp.discourse.group/t/how-xrp-code-editor-interact-with-firmware/660)

<div class="topic-metadata">

**Author:** [@csunwc](https://xrp.discourse.group/u/csunwc)\
**Replies:** 3\
**Last updated:** [March 28, 2025, 4:41pm UTC](https://xrp.discourse.group/t/how-xrp-code-editor-interact-with-firmware/660 "2025-03-28T16:41:55Z")

</div>

Is there any documentation about how XRP Code Editor interacts with XRP firmware? I am new to XRP. In other ST-based controllers, I see a USB drive to upload Python codes when I connect the controller via USB. However…

---

## [XRP Blockly dictionary](https://xrp.discourse.group/t/xrp-blockly-dictionary/648)

<div class="topic-metadata">

**Author:** [@bamiller](https://xrp.discourse.group/u/bamiller)\
**Replies:** 0\
**Last updated:** [March 21, 2025, 5:25pm UTC](https://xrp.discourse.group/t/xrp-blockly-dictionary/648 "2025-03-21T17:25:41Z")

</div>

I just added a dictionary of all the blocks available in XRP Blockly. The blocks are arranged in tabs, the same as in XRPCode, with an explanation for each block. Over the next few weeks I hope to add more detail or exam…

---

## [All available python Methods](https://xrp.discourse.group/t/all-available-python-methods/637)

<div class="topic-metadata">

**Author:** [@dwhite](https://xrp.discourse.group/u/dwhite)\
**Replies:** 3\
**Last updated:** [March 11, 2025, 7:25pm UTC](https://xrp.discourse.group/t/all-available-python-methods/637 "2025-03-11T19:25:39Z")

</div>

Is there a single resource that gives you all available methods and attributes that can be used with drivetrains, servos, and sensors? If so, can someone share the link please.

---

## [XRPCode extensions - addressable LEDs, I2C OLED displays, sound,](https://xrp.discourse.group/t/xrpcode-extensions-addressable-leds-i2c-oled-displays-sound/356)

<div class="topic-metadata">

**Author:** [@WayneSeltzer](https://xrp.discourse.group/u/WayneSeltzer)\
**Replies:** 21\
**Last updated:** [March 9, 2025, 10:27pm UTC](https://xrp.discourse.group/t/xrpcode-extensions-addressable-leds-i2c-oled-displays-sound/356 "2025-03-09T22:27:42Z")

</div>

I’m interested in including addressable LEDs, I2C OLED displays, sound (buzzers/speakers) to add to the potential outputs available for student projects. Are there plans to extend XRPCode to support these sort of device…

---

## [Documentation for WPI Java library](https://xrp.discourse.group/t/documentation-for-wpi-java-library/488)

<div class="topic-metadata">

**Author:** [@happychriggy](https://xrp.discourse.group/u/happychriggy)\
**Replies:** 5\
**Last updated:** [March 8, 2025, 3:24am UTC](https://xrp.discourse.group/t/documentation-for-wpi-java-library/488 "2025-03-08T03:24:46Z")

</div>

I am trying to find the documentation for the XRP specific classes like XRPMotor or XRPServo on WPILib Suite · GitHub. Could anyone please point me in the right direction. Thank you!

---

## [VSCode: downloading python code to XRP robot via bluetooth](https://xrp.discourse.group/t/vscode-downloading-python-code-to-xrp-robot-via-bluetooth/624)

<div class="topic-metadata">

**Author:** [@jbenjam](https://xrp.discourse.group/u/jbenjam)\
**Replies:** 2\
**Last updated:** [March 8, 2025, 3:22am UTC](https://xrp.discourse.group/t/vscode-downloading-python-code-to-xrp-robot-via-bluetooth/624 "2025-03-08T03:22:03Z")

</div>

Hi, I’ve been using the web-based XRP code editor, which works well enough if I write all of my code in a single file. For whatever reason, however, if I have other files to hold various routines, it seems to ignore ch…

---

## [Adding a 3rd Servo to XRP](https://xrp.discourse.group/t/adding-a-3rd-servo-to-xrp/634)

<div class="topic-metadata">

**Author:** [@XRPsubmersible](https://xrp.discourse.group/u/XRPsubmersible)\
**Replies:** 1\
**Last updated:** [March 6, 2025, 10:50pm UTC](https://xrp.discourse.group/t/adding-a-3rd-servo-to-xrp/634 "2025-03-06T22:50:15Z")

</div>

We are tasked with making a submersible vehicle using the XRP board and our thruster’s ESCs use a servo style PWM. They work great off of the designated servo pins but we need to add at least 1 more thruster (XRPservo de…

---

## [Blockly examples of coding the range finder](https://xrp.discourse.group/t/blockly-examples-of-coding-the-range-finder/606)

<div class="topic-metadata">

**Author:** [@Bob](https://xrp.discourse.group/u/Bob)\
**Replies:** 1\
**Last updated:** [February 11, 2025, 8:01pm UTC](https://xrp.discourse.group/t/blockly-examples-of-coding-the-range-finder/606 "2025-02-11T20:01:52Z")

</div>

I am trying to give my students examples of the blockly coding for the range finder. a screenshot or something like that would be amazing. I am still learning this stuff and could really use a half dozen examples or so …

---

## [Programming XRP Robot Using Thonny](https://xrp.discourse.group/t/programming-xrp-robot-using-thonny/557)

<div class="topic-metadata">

**Author:** [@asb](https://xrp.discourse.group/u/asb)\
**Replies:** 0\
**Last updated:** [December 2, 2024, 6:19am UTC](https://xrp.discourse.group/t/programming-xrp-robot-using-thonny/557 "2024-12-02T06:19:12Z")

</div>

---

## [Simplify Robotics: Flask Server Control for XRP Robot](https://xrp.discourse.group/t/simplify-robotics-flask-server-control-for-xrp-robot/556)

<div class="topic-metadata">

**Author:** [@asb](https://xrp.discourse.group/u/asb)\
**Replies:** 0\
**Last updated:** [December 2, 2024, 6:15am UTC](https://xrp.discourse.group/t/simplify-robotics-flask-server-control-for-xrp-robot/556 "2024-12-02T06:15:52Z")

</div>

---

## [Deploy Python program to  XRP](https://xrp.discourse.group/t/deploy-python-program-to-xrp/268)

<div class="topic-metadata">

**Author:** [@mrmunoz](https://xrp.discourse.group/u/mrmunoz)\
**Replies:** 9\
**Last updated:** [November 24, 2024, 7:50am UTC](https://xrp.discourse.group/t/deploy-python-program-to-xrp/268 "2024-11-24T07:50:41Z")

</div>

I am following the guide Deploy Python program to roboRIO — FIRST Robotics Competition documentation to program XRP with Python and when I try to complete the Deploy Python program I get an error that the SSH connection …

---

## [Using Async on the XRP](https://xrp.discourse.group/t/using-async-on-the-xrp/541)

<div class="topic-metadata">

**Author:** [@jakeematias](https://xrp.discourse.group/u/jakeematias)\
**Replies:** 2\
**Last updated:** [November 19, 2024, 2:52am UTC](https://xrp.discourse.group/t/using-async-on-the-xrp/541 "2024-11-19T02:52:20Z")

</div>

I’m working on modifying a Spike Prime reinforcement learning example for use with the XRP. On the spike prime code the runloop library is imported to allow for asynchronous coding. I tried to substitute this for the asy…

---

## [Sample Code: XRP Logo](https://xrp.discourse.group/t/sample-code-xrp-logo/514)

<div class="topic-metadata">

**Author:** [@jrumple](https://xrp.discourse.group/u/jrumple)\
**Replies:** 5\
**Last updated:** [November 15, 2024, 9:15pm UTC](https://xrp.discourse.group/t/sample-code-xrp-logo/514 "2024-11-15T21:15:33Z")

</div>

I started building a Logo programming emulator for the XRP. My project guide is available at XRP Project Guide-Turtle Graphics IRL - Google Docs. It has links on where to find the code. I’m considering this version 0.4.…

---

## [Programs are not running](https://xrp.discourse.group/t/programs-are-not-running/546)

<div class="topic-metadata">

**Author:** [@swright](https://xrp.discourse.group/u/swright)\
**Replies:** 1\
**Last updated:** [November 15, 2024, 5:55pm UTC](https://xrp.discourse.group/t/programs-are-not-running/546 "2024-11-15T17:55:35Z")

</div>

After hitting “Run” in blockly or python, the robot does not respond. After pressing the “Run” button, the program just changes back to it’s initial state without running. This happens when my students copy the code fr…

---

## [Blockly Comment Block](https://xrp.discourse.group/t/blockly-comment-block/535)

<div class="topic-metadata">

**Author:** [@jrumple](https://xrp.discourse.group/u/jrumple)\
**Replies:** 0\
**Last updated:** [November 11, 2024, 2:33am UTC](https://xrp.discourse.group/t/blockly-comment-block/535 "2024-11-11T02:33:02Z")

</div>

In a future release, can we get a block just for comments? I know I can add comments to any block, and I like having this available. Most of the new programmers I work with don’t know to look into these comments for hel…

---

## [Sample Code: XRP Fortune Teller](https://xrp.discourse.group/t/sample-code-xrp-fortune-teller/534)

<div class="topic-metadata">

**Author:** [@jrumple](https://xrp.discourse.group/u/jrumple)\
**Replies:** 0\
**Last updated:** [November 11, 2024, 1:26am UTC](https://xrp.discourse.group/t/sample-code-xrp-fortune-teller/534 "2024-11-11T01:26:35Z")

</div>

I just finished a new Blockly example code. This one turns the XRP into a Fortune Teller. It is available at XRP Blocks - Google Drive. You can set the XRP on a standard 30" deep folding table. Then press the Reset butt…

---

## [WPILibJ and I2C](https://xrp.discourse.group/t/wpilibj-and-i2c/518)

<div class="topic-metadata">

**Author:** [@toml21](https://xrp.discourse.group/u/toml21)\
**Replies:** 5\
**Last updated:** [October 28, 2024, 1:57am UTC](https://xrp.discourse.group/t/wpilibj-and-i2c/518 "2024-10-28T01:57:49Z")

</div>

Has anyone been able to use the I2C port with the WPI firmware and Java programming? I’ve been trying and digging around and not yet figured out how to get it to connect and communicate. I’m not 100% certain that Port.k…

---

## [New Version of Pesto Link using 2 Controllers!](https://xrp.discourse.group/t/new-version-of-pesto-link-using-2-controllers/521)

<div class="topic-metadata">

**Author:** [@Advay](https://xrp.discourse.group/u/Advay)\
**Replies:** 1\
**Last updated:** [October 27, 2024, 7:15pm UTC](https://xrp.discourse.group/t/new-version-of-pesto-link-using-2-controllers/521 "2024-10-27T19:15:31Z")

</div>

Hey everyone, For some recent events, I had to make a modified version of Pesto Link that supported input from multiple controllers. You can now connect 2 controllers and have them both control the XRPs using the dual i…

---

## [Negative Math Block](https://xrp.discourse.group/t/negative-math-block/506)

<div class="topic-metadata">

**Author:** [@jrumple](https://xrp.discourse.group/u/jrumple)\
**Replies:** 2\
**Last updated:** [October 24, 2024, 11:56pm UTC](https://xrp.discourse.group/t/negative-math-block/506 "2024-10-24T23:56:50Z")

</div>

In the next update, can you add a negative block to the Math tray? When I went to build a Forward function and then a Backward function, I discovered there was no way to change the sign of the input variable. I was able…

---

## [Sample Code-Mecanum Chassis](https://xrp.discourse.group/t/sample-code-mecanum-chassis/504)

<div class="topic-metadata">

**Author:** [@jrumple](https://xrp.discourse.group/u/jrumple)\
**Replies:** 2\
**Last updated:** [October 23, 2024, 5:55pm UTC](https://xrp.discourse.group/t/sample-code-mecanum-chassis/504 "2024-10-23T17:55:55Z")

</div>

I’ve been working with the Mecanum chassis (Mecanum Chassis). I’m hoping to use it as a platform for my FIRST Tech Challenge (FTC) teams to plan and prototype their Autonomous OpModes between Team Practices. Since there…

---

## [Using wpilib PID loops on XRP in simulation mode w/ command based code](https://xrp.discourse.group/t/using-wpilib-pid-loops-on-xrp-in-simulation-mode-w-command-based-code/478)

<div class="topic-metadata">

**Author:** [@Carahegadorn](https://xrp.discourse.group/u/Carahegadorn)\
**Replies:** 1\
**Last updated:** [September 24, 2024, 3:17pm UTC](https://xrp.discourse.group/t/using-wpilib-pid-loops-on-xrp-in-simulation-mode-w-command-based-code/478 "2024-09-24T15:17:01Z")

</div>

I would like to use the XRPs as a test platform for my FRC programmers. Our team already uses them for outreach activities and to teach basic robotics programming concepts to new members. I have a command based program …

---

## [Turning Based on Bluetooth Input Causing Strange Behavior](https://xrp.discourse.group/t/turning-based-on-bluetooth-input-causing-strange-behavior/464)

<div class="topic-metadata">

**Author:** [@Advay](https://xrp.discourse.group/u/Advay)\
**Replies:** 5\
**Last updated:** [August 27, 2024, 9:01pm UTC](https://xrp.discourse.group/t/turning-based-on-bluetooth-input-causing-strange-behavior/464 "2024-08-27T21:01:15Z")

</div>

I am trying to create bluetooth based control of XRPs through a website me and a friend created. When we try to use the bluetooth to control the XRP, the data is received perfectly by the XRP: the values are all correct …

---

## [Using wpilib command based programming & XRP as a test environment](https://xrp.discourse.group/t/using-wpilib-command-based-programming-xrp-as-a-test-environment/453)

<div class="topic-metadata">

**Author:** [@Carahegadorn](https://xrp.discourse.group/u/Carahegadorn)\
**Replies:** 0\
**Last updated:** [August 2, 2024, 7:46pm UTC](https://xrp.discourse.group/t/using-wpilib-command-based-programming-xrp-as-a-test-environment/453 "2024-08-02T19:46:15Z")

</div>

Hi - my FRC team has been using the XRP with block programming & python for our outreach events and new student orientation to teach basic programming and robotics concepts. It’s been working great and now we’d like to e…

---

## [XRP Code Editor Bluetooth connection questions](https://xrp.discourse.group/t/xrp-code-editor-bluetooth-connection-questions/443)

<div class="topic-metadata">

**Author:** [@WayneSeltzer](https://xrp.discourse.group/u/WayneSeltzer)\
**Replies:** 5\
**Last updated:** [July 27, 2024, 10:13am UTC](https://xrp.discourse.group/t/xrp-code-editor-bluetooth-connection-questions/443 "2024-07-27T10:13:04Z")

</div>

Looking forward to Bluetooth support in the XRP Code Editor some day. Last week, my students built quite a few “USB cord winders” as they attempted to debug their projects via the USB cable. :wink: For classroom use wi…

---

## [Drive straight with IMU but not distance](https://xrp.discourse.group/t/drive-straight-with-imu-but-not-distance/441)

<div class="topic-metadata">

**Author:** [@AkaMrBill](https://xrp.discourse.group/u/AkaMrBill)\
**Replies:** 1\
**Last updated:** [July 26, 2024, 10:31pm UTC](https://xrp.discourse.group/t/drive-straight-with-imu-but-not-distance/441 "2024-07-26T22:31:48Z")

</div>

There doesn’t appear to be a drive exampple that uses the IMU to keep the robot driving straight without also giving a distance. Is there a function I am missing that will do this, or is it something we will need to crea…

---

## [Does the XRP Blockly App work?](https://xrp.discourse.group/t/does-the-xrp-blockly-app-work/370)

<div class="topic-metadata">

**Author:** [@Advay](https://xrp.discourse.group/u/Advay)\
**Replies:** 16\
**Last updated:** [July 19, 2024, 11:02am UTC](https://xrp.discourse.group/t/does-the-xrp-blockly-app-work/370 "2024-07-19T11:02:12Z")

</div>

Hi, my team is planning on using the XRP app for a stem camp. We wanted to have the kids be able to drive the robot in real time while still using block code. We researched into using web servers for this, but they were …

---

## [Glitches in webserver while accessing through Internet](https://xrp.discourse.group/t/glitches-in-webserver-while-accessing-through-internet/440)

<div class="topic-metadata">

**Author:** [@asb](https://xrp.discourse.group/u/asb)\
**Replies:** 0\
**Last updated:** [July 18, 2024, 7:05am UTC](https://xrp.discourse.group/t/glitches-in-webserver-while-accessing-through-internet/440 "2024-07-18T07:05:27Z")

</div>

Greeting fellow roboticist, I am trying to enable remote access for XRP outside the home network (outside the WiFi range) via internet. I managed to do this using Ngrok and modifying the existing webserver code a bit to…

---

## [Periodic Function](https://xrp.discourse.group/t/periodic-function/431)

<div class="topic-metadata">

**Author:** [@Advay](https://xrp.discourse.group/u/Advay)\
**Replies:** 2\
**Last updated:** [July 14, 2024, 8:27pm UTC](https://xrp.discourse.group/t/periodic-function/431 "2024-07-14T20:27:22Z")

</div>

In the XRP curriculum, there is a suggestion to use machine.Timer in micropython to update the value logged in a webserver. However, there is no equivalent for Blockly. I feel like adding a periodic function that runs w…

---

## [XRP Code Editor "prompt for number" ('raw\_input') does not accept input?](https://xrp.discourse.group/t/xrp-code-editor-prompt-for-number-raw-input-does-not-accept-input/393)

<div class="topic-metadata">

**Author:** [@WayneSeltzer](https://xrp.discourse.group/u/WayneSeltzer)\
**Replies:** 4\
**Last updated:** [June 21, 2024, 4:28pm UTC](https://xrp.discourse.group/t/xrp-code-editor-prompt-for-number-raw-input-does-not-accept-input/393 "2024-06-21T16:28:28Z")

</div>

This Blockly code: generates this Python code: n = None def text\_prompt(msg): try: return raw\_input(msg) except NameError: return input(msg) n = text\_prompt('Type a number: ') print(n) When I run this…

---

## [ImportError: can't import name EncodedMotor](https://xrp.discourse.group/t/importerror-cant-import-name-encodedmotor/367)

<div class="topic-metadata">

**Author:** [@mlambi-dover](https://xrp.discourse.group/u/mlambi-dover)\
**Replies:** 2\
**Last updated:** [May 30, 2024, 12:24pm UTC](https://xrp.discourse.group/t/importerror-cant-import-name-encodedmotor/367 "2024-05-30T12:24:41Z")

</div>

I have an XRP that works with the online block programmer. When attempting to use Python I receive this error: ImportError: can’t import name EncodedMotor The only line in the program other than the default import and…

[Previous page](https://xrp.discourse.group/c/coding/13.md)

[Next page](https://xrp.discourse.group/c/coding/13.md?page=2)
