Results for “Serial protocols”
Small, practical examples. Search by task or narrow things down below.
Deserialize a JSON object into a dictionary
C#: Specify the value type expected from a known JSON shape.
C#✓ Tested
Keep a serial message in flash memory
Arduino / C: The F macro keeps a literal out of scarce SRAM.
Arduino / C✓ Tested
Print a message to the Serial Monitor
Send a line once when the sketch starts.
Serial✓ Tested
Read a button in the Serial Monitor
Arduino / C: Use a pull-up input and if/else to report three button readings.
Arduino / C✓ Tested
Read one character from serial input
Wait for an incoming byte without blocking the main loop.
Serial.available✓ Tested
Repeat a serial message three times
Arduino / C: Repeat a serial message three times on an Uno with the Serial Monitor set to 9600 baud.
Arduino / C✓ Tested
Run a first sketch and read serial output
Arduino / C: Run a first sketch and read serial output on an Uno with the Serial Monitor set to 9600 baud.
Arduino / C✓ Tested
Serialize a 16-bit integer in big-endian order
C: Explicit shifts make a byte format independent of the CPU’s native byte order.
C✓ Tested
Serialize a hashtable as JSON
Produce compact JSON for a small data object.
JSON✓ Tested
Serialize an object
Turn a JavaScript object into JSON text.
JavaScript✓ Tested
Serialize an object to JSON
Serialize a small anonymous C# object with System.Text.Json.
C#✓ Tested
Serialize nested objects with an explicit depth
PowerShell: Select a sufficient depth so nested data is retained instead of converted into a descriptive string.
PowerShell✓ Tested