Blocks Area

SerialPort

πŸ“‘ SerialPort – Your β€œDirect Chat with the PC”.

What it is: Blocks that allow the robot to communicate with the computer via cable.

What it does: Sends messages between your D1 R32 board and the computer.

Example: Sending a message to the serial monitor: β€œHello world!”

πŸ‘‰ It’s the direct chat between your robot and the PC.

🧩 Fun Guide to SerialPort Blocks (Clu-blocks Pro)

πŸ“‘ Important! Serial blocks let your robot send and receive messages through wires β€” like chatting with your computer or another robot. It’s how your robot says β€œHello!” or listens for commands.

#BlockWhat it doesDropdown optionsWhat the options mean
1print "Clu-Bots"Sends a message to the serial monitorβ€”Prints text without a line break β€” good for short messages
2println "Hello" "Clu-Bots"Sends a message with a line breakβ€”Prints text and moves to the next line β€” great for clean logs
3print "Clu-Bots" endsWith "Clu-Bots"Checks if a message ends with a wordβ€”Useful for filtering or matching incoming messages
4Receive string input: promptAsks the user to type somethingβ€”Great for interactive programs β€” like entering a name or command
5Serial uart1 RX# 2 TX# 3 baud rate 115200Sets up a serial connectionβ€”RX = receive pin, TX = transmit pin, baud rate = speed of communication
6Serial uart1 print "Clu-Bots"Sends a message through UARTβ€”Sends text to another device β€” like a second robot or sensor
7Serial uart1 println "Clu-Bots"Sends a message with a line break through UARTβ€”Same as above, but cleaner formatting
8Serial uart1 println hex: 0xFF00FFSends a number in hex formatbinary, octal, decimal, hexChoose how the number looks β€” hex is great for colors or codes
9Serial uart1 Read other mode tooltherMPdeviceData repeat yesReads data from another device repeatedlyβ€”Keeps listening for new info β€” great for sensors or modules
10Serial uart1 ReadDataOtherMPDeviceDataReads a chunk of data from another deviceβ€”Use this to grab info like temperature, distance, or status
11Serial uart1 write(byte) transfer.byte "Clu-Bots"Sends raw byte dataβ€”Sends low-level info β€” great for advanced communication
12Serial uart1 isAvailable?Checks if new data has arrivedβ€”Returns true if there’s something to read β€” like a message waiting
13Serial uart1 Read a rowReads a full line of incoming dataβ€”Useful for commands or sensor logs β€” reads until a line break

🧠 Quick Tips for Students

  • Use print/println to send messages to your computer β€” great for debugging or chatting.
  • Use RX/TX setup before sending or receiving β€” it’s like plugging in the walkie-talkie.
  • Use hex/binary formats when working with colors, codes, or advanced devices.
  • Use isAvailable + Read to listen for messages β€” like checking your inbox.
On this page