Split function Arduino or Esp

Hello everybody,
Hope you are doing well,
I have a question about how to split a string,
I'm using Arduino and ESP to send data from Arduino (see the wiring Figure 1).
I want to separate the numbers 1234567890 one by one i.e. 1 2 3 4 .....
Is there an idea to do this?

The code of Arduino is :

#include <Wire.h>

void setup() {
 Wire.begin(8);                /* join i2c bus with address 8 */
 Wire.onReceive(receiveEvent); /* register receive event */
 Wire.onRequest(requestEvent); /* register request event */
 Serial.begin(9600);           /* start serial for debug */

void loop() {

// function that executes whenever data is received from master
void receiveEvent(int howMany) {
 while (0 <Wire.available()) {
    char c = Wire.read();      /* receive byte as a character */
    Serial.print(c);           /* print the character */
 Serial.println();             /* to newline */

// function that executes whenever data is requested from master
void requestEvent() {
 Wire.write("1234567890");  /*send string on request */

And the ESP code is :

#include <Wire.h>

void setup() {
 Serial.begin(9600); /* begin serial for debug */
 Wire.begin(D1, D2); /* join i2c bus with SDA=D1 and SCL=D2 of NodeMCU */

void loop() {
 Wire.beginTransmission(8); /* begin with device address 8 */

 Wire.requestFrom(8, 13); /* request & read data of size 13 from slave */
    char c = Wire.read();

Did not work to split the characters?

The strtok() function will do what you want

Do you have an exemple of code?

I did not understand your question (I am new to arduino and esp coding)

The function above. You wrote it. It's yours. It receives ONE character at a time. Right?

If it receives one character at a time, then your characters are split out for you, no?

The Uno is a 5V device, the ESP32 a 3.3V device. Are the latter's I/O pins 5V tolerant?

Also, given the resources and processing power of the ESP32, why are you using an UNO at all?

No, when I open the serial monitoring it looks like this 1234567890 without separation, I think i should split it at the ESP level

I use arduino for massive processing (fuzzy logic) and ESP just to send data to HTTP.

Right there see the receipt of one character at a time? Goes out split and comes in split.

That is backwards thinking. Compare the capabilities of each processor and then try to tell us that the Uno is better for "massive processing".

Which Arduino are you using to process massive fuzzy logic with better capabilities than an ESP32?

Why do you need the number split?
If you want each character separated by a space or newline, then print the space or newline after each received character.

Integrating two massive codes (processing + data sending) in ESP will be difficult I think that's why I separated the tasks what do you think?

Try that code see the things are now split?

Arduino Mega

A MEGA is better able to process fuzzy logic then a ESP32? Do tell.


First I developed a code in fuzzy logic and it worked well in Arduino, when I tested the same code on ESP it didn't work, so I thought maybe it's good to use arduino for the processing and an ESP for the sending.

This is what i'm triying to do but a Fuzzy logic code while be integrated in Arduino and using ESP just to send Data