microsoft / microsoft/pxt

String to buffer converter API

Open
#10,251 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.3k
Forks
641
Avg merge
12h 4m
Merged PRs (30d)
57

Description

There is no way to convert a string to a buffer. An example use is when someone is sending a string over I2C, to a display for example. UART today has the option to take a string directly, I2C does not. We could just send a buffer to I2C but there is no way to convert a string to a buffer.

So, to send a string to an I2C display:

  1. There is no I2C API to take strings.
  2. There is no API to convert a string to a buffe, to then send the buffer to I2C.

The only way today is to manually loop and create a buffer from the string. This is a difficult use for teachers/students, plus this string to buffer can be used in other cases.

Btw, I believe the system has buffer to string, but not a string to buffer!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing buffer-to-string API and the UART and I2C APIs mentioned in the issue. Compare their inputs and outputs, then define the string-to-buffer behavior needed for sending text through I2C; done means the conversion is available and can be used instead of a manual loop.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
embedded-iot
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.