text:
Incorrect data received on serial communication
I have two Arduino UNO connected with two wires, and ground, that exchange informations through serial data.
The communication is working with INT, but I am having troubles to receive correct characters. Instead of characters I'm only receiving numbers.
I tried every possible combination of Serial.write() or Serial.println(), with HEX and ascii, but it wouldn't work.
I do not know what I am doing wrong, if anyone could help me, I will appreciate.
Transmitter :
#include <SoftwareSerial.h>
#define TX 2
#define RX 3
#define ask 3
#define ER_LED 12

String dataline = "605030";
const byte code = 60;

SoftwareSerial syserial(RX, TX); // RX, TX

void setup() {
  // put your setup code here, to run once:
  syserial.begin(57600);
  Serial.begin(57600);
}

void loop() {
  // put your main code here, to run repeatedly:
  //syserial.println(dataline); //NO
  //syserial.println(28, DEC); //ok for numbers

  Serial.println(dataline.length());
  for (int i = 0; i < dataline.length(); i++)
  {
    syserial.print((char)dataline[i]);
  }
  syserial.println();
  //syserial.write(234);
  //syserial.print('<');
  delay(4000);
}

Receiver :
#include <SoftwareSerial.h>
#define TX 2
#define RX 3
const byte ask = 3;
bool com_end;
#define ER_LED 7
#define AC_LED 5

SoftwareSerial syserial(RX, TX); // RX, TX

void setup() {
  // put your setup code here, to run once:
  syserial.begin(57600);
  Serial.begin(57600);
}

void loop() {
  // put your main code here, to run repeatedly:
  while (syserial.available())
  {
    Serial.println(syserial.read());
  }
  delay(100);
}

Serial monitor on whatev b/s:
21:19:36.408 -> 253
21:19:36.408 -> 255
21:19:40.421 -> 253
21:19:40.421 -> 255
21:19:44.495 -> 253
21:19:44.495 -> 255

Monitor with SySerial on 57600 b/s:
21:23:29.317 -> 241
21:23:33.308 -> 241
21:23:37.338 -> 241
21:23:41.328 -> 241

Monitor with SySerial on 300 b/s:
21:27:03.444 -> 255
21:27:07.731 -> 255
21:27:12.095 -> 255
21:27:16.335 -> 255
21:27:20.635 -> 255

Update :
I changed the pins on the UNO (TX ->2)(RX -> 3), and now i'm getting different numbers again. I must be doing something bad, but I can't understand what.

I get different numbers, instead of characters

please  open the content of the serial monitor window and paste it into your post ... format as code ... please no pictures

Yes, but they do not appear as characters

What numbers do you get at 9600 b/s?

Updated code with monitor output

Pins 0 and 1 on the Uno are for the HW serial. Perhaps if you used pins 3 and 4 for the SW serial, it may work as intended.

Changed it, doesn't work. I used to have pins 2 and 3

Are you swapping the wires? ie. RX on one Uno to TX on the other. Try using a lower baud rate for the software serial, 57600 is probably pushing it.

Hi, thanks for your reply. Swapping the wires gives nothing on the monitor, so I think that the wires are in the right positions. I tried using both 300 b/s, and 9600 b/s for syserial, but it only changes a few numbers (52 on 300 b/s, gives 53 on 9600 b/s). The numbers seems to change when I use different baud rates

Don't you have an oscilloscope or logic analyzer at hand to measure instead of guessing?

@the busybee I do not have any oscilloscopes, or logic analyzers. I would have tried with those if I could.

Well, then, double-check each SW/HW component and do baby-steps: for example, check by local loop-back that you have the right pins and software, transmit single bytes of clear patterns (0x01 to 0x80) with enough interval, and so on. It is always quite hard to do development without appropriate tools.

What do you mean each ""SW/HW"" component ? At the moment I checked pins correspondence, I tried using different pins, and tried standard codes I could find online, but no luck so far...

Correct, the pins you use, the functions you call, the parameters of these functions. Did you try the suggestions? Please add new information to your question by [edit]ing it.

I would try using the hardware serial ports instead. And yes: the receiver can use the hardware port both for receiving from the other Arduino and for sending to the serial monitor.

The communication is working with INT, but I am having troubles to receive correct characters. Instead of characters I'm only receiving numbers.
Suggest you take a step back because you have code that has not been updated with what you have stated in subsequent comments and it is quickly becoming less clear what is going on.
On each UNO Use pins 2,3 and GND. Don't connect anything else to either UNO.
UNO ONE pin 2 connects to UNO TWO pin 3
UNO ONE pin 3 connects to UNO TWO pin 2
UNO ONE GND to UNO TWO GND
on UNO ONE run this code:
// RECEIVER
#include <SoftwareSerial.h>
SoftwareSerial SSerial(2,3); // RX, TX
void setup() {
  Serial.begin(9600); // Arduino monitor hardware Serial
  SSerial.begin(9600);
}
void loop() {
  // display whatever comes in on the software serial to the Arduino monitor (the hardware serial)
  if (SSerial.available()) {
    Serial.write(SSerial.read());
  }
}

on UNO TWO run this code
// SENDER
    #include <SoftwareSerial.h>
    SoftwareSerial SSerial(2, 3); // RX, TX
    void setup() {
      SSerial.begin(9600);
    }
    void loop() {
      SSerial.println("Simple Arduino SoftwareSerial Test");
      delay(1000);
    }

Open the serial monitor on UNO ONE and you will see "Simple Arduino SoftwareSerial Test" printed every second.
If you can't get that far, you have some other problem.
Are you using two UNOs on two different computers?
Are you using two UNOs on one computer, that is; running two instances of the IDE (may depend on OS - I do that all the time on Win 7 but I don't know about other OSs)?
See if you can get this far first and I think it will be easier to get the rest fixed.

Thanks for answering, the setup you gave seems to be working, I will try to understand what was wrong in my previous code...


text:
LEDs controlled by PHONE on ESP32
I am having doubts with a project I'm making.
My project involves a sets of LEDs stripes, among which some are controlled from a smartphone, and some automated. The LED strips are connected to an Arduino, that would receive commands from a phone.
Here is a scheme, with essentials elements I marked for my project :

A development board, with wifi support
a framework/program allowing the smartphone to communicate with the board
And an Android app with a color interface, to change LEDs colors

I made some research:

I found a lot of boards, and eventually choose ESP32 boards (Good ones).
I found a WLED system, that meet my requirements
I know Home assistant, that offers more possibility than WLED
I won't use local server, since it is not easy to use for other people (family members for example).

WLED seems to be very useful, and easy to use. But, from what I understood, if I installed WLED on my board, I would have to dedicate the entire board to the WLED program, and therefore i wouldn't be able to upload any other custom code to my board. Since I want some LEDs to be remotely controlled, and the others to run on an programmed loop, I don´t know if it´s a good idea
Home assistant is more complete, and shouldn't have the problem mentioned above. It can also support several devices, and can have many boards registered on it. I would like, later, to expand Home Assistant to other projects, this is why starting Home assistant now is a good idea.
Thus, I believe I will go for Home Assistant

I now struggle with the following issues:

I am unsure if i understood correctly, but I read some people complaints about certains ESP32 boards which need complete wifi configuration (networking stack), and are complicated to install. This is why I wanted adafruit boards, supposing that their chip has already an uploaded code. Is that right ?
I also read on the internet that after compiling the networking stack on ESP8266 boards, there isn't much space left for the program to run. Given that I choose the ESP32, with more space, do I have plenty of space for my code, or is it still limited ?
WLED seemed fine, but as I said, I'm not sure if I can upload code. Can I upload custom code and WLED system to the board, or is it entirely focused on WLED ?

Thanks to anyone who could bring some clarification to me, I will appreciate it !

You have a lot going in this single post.You'll probably have better luck asking single specific question that could be clearly answered.

I am unsure if i understood correctly, but I read some people complaints about certains ESP32 boards which need complete wifi configuration (networking stack), and are complicated to install. This is why I wanted adafruit boards, supposing that their chip has already an uploaded code. Is that right ?

I don't know what complaints you have seen (since you didn't like to them), so that I cannot talk about the context. I have used several different ESP boards. The ones, that are a bit difficult to program, were the boards without a USB interface. That is mostly the case with the very small boards.
Yes, Adafruit is a reputable source for such boards. Though I also never had problems with typical ESP dev boards from other sources, like the company named like the big river in south america. Install the ESP32 core in the Arduino IDE, connect the board via USB and program it.

I also read on the internet that after compiling the networking stack on ESP8266 boards, there isn't much space left for the program to run. Given that I choose the ESP32, with more space, do I have plenty of space for my code, or is it still limited ?

The ESP8266 is smaller, yes, but I still used it and could still write quite big programs while using Wifi. Here one fact is also important: The number after the ESP describes the chip itself, but most boards use an external flash memory chip. Thus the maximum program size depends on how big of a flash chip the board manufacturer uses for the board. You can find that information wherever you buy your board.
Either way, with an ESP32 you are in every case good to go and you will have plenty of resources for whatever you want to do (including enough free pins). If you want to use WLED, you can check for compatible boards in their wiki at github.

WLED seemed fine, but as I said, I'm not sure if I can upload code. Can I upload custom code and WLED system to the board, or is it entirely focused on WLED ?

Only one program can run at the ESP at a time (technically the ESP has 2 cores, so executes 2 things simultaneously, but one core is used for handling Wifi, so for user code only one core is left). WLED is meant as a ready to use firmware, so no writing of custom code.
You should first think about, what you would want to do with your code. You haven't specified, what exactly your custom code should do while WLED handles the LED strips. Maybe the functionality of WLED is enough for you.
Otherwise you can loop for 2 things with WLED:

Search in the WLED code/documentation for a place to plug your own code into a function. WLED might give you that possibility (cannot search that myself now, since the official documentation site fails with a certificate problem for me and I cannot open it, even if I accept the risk in my browser).
If the above is not possible, you can try changing the source code of WLED to also handle your own code. That might be rather difficult, especially for a beginner. Digging in someone elses code while being a beginner is a very steep learning curve.

If both of this is not fitting for you and you still want to execute your own code, then you will have to write the code yourself entirely.

Besides my answers above, I would suggest, that you think about what features you need and which you don't need exactly. The options, that you listed, are vastly different.
Home Assistent especially is a very big project, which is powerful, but also complex and difficult to setup. Also keep in mind, that Home Assistent is a program, that needs to run somewhere, and it will not run on the ESP. So you need something like a Raspberry Pi (or any other small home server, which you run 24/7), where you install and configure Home Assistent, before you can even start with the ESPs.
If all you want to do is controlling some LED strips, then Home Assistent is overkill. If you plan to automate your home further, then Home Assistent can be a good choice. Though then your project isn't only about LED strips.

Hi, thank you for the explanations. For the ESP32, there are a few videos on the internet, on how to compile esp32 firmware, for example this one : Compiling esp32 lua. Maybe that is only needed for the ChiliPeppr Workspace ?

What I need to do with my board, is to have a sets of LEDs that have a certain behavior, that is programmed in the code, and then another sets of LEDs that is controlled by smartphone. This is why having the board only running WLED won't work, right ?

Lua is a different programming language. Either you need to refer to the WLED documentation on how to compile it (if you want to use it) (or maybe just upload a precompiled binary of WLED via the Arduino IDE), or you learn how to program the ESP with the Arduino IDE in C++ (for which you can find numerous tutorials online).

I don't know, what features WLED has. Please refer to the documentation for this. If it doesn't fit for your project, then start writing your own code in the Arduino IDE (or any other IDE, that supports programming ESPs)

I'm planning to use Home Assistant for more project (temperature, sound, communication, monitoring). Starting now would allow me to understand Home assistant and practice a bit. I know that Home assistant runs on a server, but I believed that there could be a direct connection with a single board, if no other devices are used.

There is no reference to multiple code running in the documentation, this is why I'll go for home assistant. There is a WLED integration available with Home Assistant, I will use that one. I'm now trying to get raspberry pi alternatives, as those boards aren't cheap anymore ...

The connection between home assistant and the devices is done through a communication network (by default an IP network, like LAN or Wifi, with extra hardware also something like Zigbee), so it doesn't matter if it is only one device or multiple

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Need help ATtiny85 not working as standalone
I have ATTiny85 that I want to drive a servo. Burned bootloader to the ATTiny85 and I am using HW-260 development board to program and to test the code. While the ATTiny85 works perfectly on the HW-260 development board, I cant get it to work as a standalone on a breadboard when testing with the servo by using the Adafruit_SoftServo library and with the blink example. Tried adding 4.7kOhm pull-up resistor to PB5 to prevent the ATTiny85 from resetting but I get the same result. Tried powering the standalone layout with 3V coin cell, USB 5V, powerbank 5V and nothing. This is the servo code I am using:
Adafruit_SoftServo myservo;
int pos = 0;
void setup() {
  myservo.attach(PB0);
}
void loop() {
  for (pos = 0; pos <= 180; pos += 1) {
    myservo.write(pos);
    myservo.refresh();
    delay(15);
  }
  for (pos = 180; pos >= 0; pos -= 1) {
    myservo.write(pos);
    myservo.refresh();
    delay(15);
  }
}

The blink code I am using is from the examples, I just change the output pin as PB1. If I connect the PB5 briefly to ground, I get the servo to turn a bit in random direction. Measured and the breadboard is not the problem, everything seems to be connected correctly.
This is the bootloader I used https://github.com/ashishchoudhary9998/ATtiny85-Boot-loader
Edit:
This is the schematic of the HW-260 board

This is my layout

Welcome to SE/Arduino! Please take the [tour] to learn how this site works. You might also want to read "[ask]" and some of the [help]. -- If the same program works on the development board, but not on your board, you need to find out the differences. Please [edit] your question and add schematics (or at least relevant parts of them)for both.

thanks @thebusybee I edited the question and added the schematics.

Concerning the Blinky example, working on the HW-260, but not on your board, there is only just one difference: PB3 is pulled up by 1k5. Would you mind to add this to your board, and retry, please? And what do you see with Blinky on your board, a completely off LED, a completely on LED, or something in-between? BTW, do you have an oscilloscope?

@thebusybee sure, i will try pulling PB3 up right away and i will let you know what will be the result. i dont have an oscilloscope :(
thanks for trying to help me.

@thebusybee it works :) adding a pull-up resistor to PB3 fixes the issue and the code is working perfectly. thanks allot. btw the current firmware (bootloader) has some kind of delay, i measured like 5-6 seconds delay before the code starts working. can you please add your comment as an answer so i can mark it as solution?

After adding the schematics, a difference can be spotted:
PB3 needs a pull-up, on the development board it has 1,5 kΩ. This resistor is part of the USB standard and signals "low speed device". Presumably (because the source of it is not provided) the bootloader needs this to start at all, too.
The delay mentioned in a comment is typical for ATtiny85 development. Because of the low number of pins, the bootloader starts and waits for some seconds for a PC to connect. If no connection is established, the user program is started. It can then use all pins for its own purposes.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
I don't understand what's wrong with this code
int ledy = 5 ;
int leds = 4 ;
int ledk = 3;
int button = 2 ;
int count = 0 ;

void setup()
{
  pinMode(ledy, OUTPUT);
  pinMode(leds, OUTPUT);
  pinMode(ledk, OUTPUT);
  pinMode(button,INPUT);
  randomSeed(analogRead(A0));
}

void loop()
{
  if(digitalRead(button)== HIGH)
  {
  count = count++ ;
  }
    if (count==1)
  {
    digitalWrite(ledk, HIGH);
    digitalWrite(leds, LOW);
    digitalWrite(ledy, LOW);

   }
    else if (count==2)
   {
    digitalWrite(ledk, LOW);
    digitalWrite(leds, HIGH);
    digitalWrite(ledy, LOW);

    }

   else if (count==3)
   {
    digitalWrite(ledk, LOW);
    digitalWrite(leds, LOW);
    digitalWrite(ledy, HIGH);
   }

     delay(1000);

}

I don't undertstand why it isn't working.
I want it three leds to light up one by one as loop. But none of them lights up.

Please tell us what you want to achieve and what happens instead.

I want it three leds to light up one by one as loop. But none of them lights up.

You also could use the serial port to print some messages to the arduino serial monitor to see if the button press is detected and the right if-condition gets triggered. Also show your circuit - there could also be something wrong. Depending on how your button is wired a pull-down resistor might be needed. If the button pulls the pin to GND you could use pinMode(button,INPUT_PULLUP); and then need to test for digitalRead(button)== LOW...

@gruesome, please add that information to your question. This is probably caused by count = count++ which (I guess) does not do what you think it does. Replace it with either count++ or count = count + 1. It might also be a good idea to reset the counter after it reaches 3.

@gruesome Please "edit" your original question and add additional information there and not to the comments.

forget your code for now ... write a simple sketch that lights one of the LEDs for one second, turns off LED for one second, and repeats ... test all three LEDs this way ... update your question with results of the test

One thing that jumps out to me as a possible cause of your issue here is that many push buttons require a pull-up resistor, which is provided as an internal component of most microcontrollers, but needs to be specifically requested in the pinMode instantiation of the button. Try changing your setup() function to the following:
void setup()
{
  pinMode(ledy, OUTPUT);
  pinMode(leds, OUTPUT);
  pinMode(ledk, OUTPUT);
  pinMode(button,INPUT_PULLUP);
  randomSeed(analogRead(A0));
}

however if you do this, you must also change your if statement to if(digitalRead(button) == LOW), as a pullup resistor will make it so that when the button is not pressed, the pin is pulled high, and vice-versa.
Another way to troubleshoot this is to see if the LEDs light up when you remove the reliance on the button altogether by removing the
if(digitalRead(button)== HIGH)
  {
  count = count++ ;
  }

and changing it to
count++;
delay(1000);

and see if the LED changes every 1 second (delay requires a millisecond value). I agree with @StarCat that count = count++; possibly isn't doing what you think it is.


text:
WS2812b - Interpolate pixels on neopixel matrix with mask
simplified my goal is to display a transitional Background and some shapes. This shapes are not moving hard rasterized by 1 pixel, more like .1 each cycle. So I need a way to interpolate the movement between the surrounding Neopixels.
Background works fine, so it's not relevant for now.
For the shapes the first try was to show a smooth movement of a square hardcoded. This works suitable, even its not bug free. I put the Code of the first attempt at the very end.
After that I wanted to implement an bitmap mask to show something more complex . That's where I am at currently. First of this attempt is to assume the whole mask is completly filled (again hardcoded).
The LEDs mostly keep completely on or off.
How do I get them fade them in an out at the outer sides?
I use an AI Thinker ESP 32 and 200 WS2812Bs.
Please ask any more infos that are required. Of course if you spot that my approach is unsuitable to begin with, pls tell me.
Infos for the Code: don't get lost on the "circle" variables. At the eary steps I showed a circle and soon realized its easier to step back to a Circle while working at the interpolation.
My Code with the bitmap
#include <Adafruit_NeoPixel.h>

#define PIN_NEO_PIXEL  13
#define NUM_PIXELS     400
#define num_row 20
#define num_col 20
#define circle_size_body 4
#define circle_size_border 5
#define circle_size_corona 7
#define DELAY_INTERVAL  100

float circle_PosX = 10;
float circle_PosY = 10;
int circle_direction = 1;
enum eIntersectingPart { None, Body, Border, Corona };

Adafruit_NeoPixel NeoPixel(NUM_PIXELS, PIN_NEO_PIXEL, NEO_GRB + NEO_KHZ800);

void setup()
{
  NeoPixel.setBrightness(100);
  NeoPixel.begin();
  Serial.begin(115200);           // set up Serial library at 9600 bps
}

float backgroundShift = 0;
float worldSpeed = .05;

void loop()
{
  if(circle_PosY <= 0 && circle_direction < 0
     || circle_PosY >= 10 && circle_direction > 0)
    circle_direction *= -1;
  circle_PosY += worldSpeed * circle_direction;
  circle_PosX += worldSpeed * circle_direction;
    Serial.print("circle_PosX ");
    Serial.print(circle_PosX);
    Serial.print(", circle_PosY ");
    Serial.print(circle_PosY);
    NeoPixel.clear();
    //Hintergrund setzen
    // setBackgroundColor();

    //Kreis malen
    drawCircle();

  // Serial.print("bgShift: ");
  // Serial.flush();
  NeoPixel.show(); // send the updated pixel colors to the NeoPixel hardware.
  // Serial.println(backgroundShift);
  backgroundShift += worldSpeed;
  delay(100);     // off time
}

uint32_t setBackgroundColor() {

  for(int led = 0; led < NUM_PIXELS; led++) {
    int coordinates[2];
    coordinateByLed(coordinates, led);

    byte ambientColors[3] = { 0, 0, 255 };
    int ambientCcolorS = (int)( sin( 0.3 * coordinates[0] + backgroundShift) * 127.0 );
    int ambientCcolorC = (int)( cos( 0.3 * coordinates[1] + backgroundShift) * 128.0);
    int amberC = (ambientCcolorS + ambientCcolorC + 255) / 2;

    NeoPixel.setPixelColor(
        led,
        NeoPixel.Color(amberC, amberC ,255));
  }
}

bool firstIteration = false;
void drawCircle() {
    //          x                   y                           Anteil
    byte bitmap[circle_size_corona + 1][circle_size_corona + 1];

    float startPositonX = circle_PosX - .5f * (float)circle_size_corona;
    float startPositonY = circle_PosY - .5f * (float)circle_size_corona;

    int lowerStartX = floor(startPositonX);
    int upperStartX = ceil(startPositonX);
    int lowerStartY = floor(startPositonY);
    int upperStartY = ceil(startPositonY);

    float proportionForLowerX = abs(upperStartX - startPositonX);
    float proportionForUpperX = 1 - proportionForLowerX;
    float proportionForLowerY = abs(upperStartY - startPositonY);
    float proportionForUpperY = 1 - proportionForLowerY;

    firstIteration = true;

    for(byte x = 0; x < circle_size_corona; x++) {
        for(byte y = 0; y < circle_size_corona; y++) {
            float proportion = 0;

            int lowerLedX = lowerStartX + x;
            int lowerLedY = lowerStartY + y;
            int upperLedX = upperStartX + x;
            int upperLedY = upperStartY + y;

            if(lowerLedX >= 0 || lowerLedX < num_col
                &&
                lowerLedY >= 0 || lowerLedY < num_row) {
                byte currentX = x;
                byte currentY = y;
                proportion = proportionForLowerX * proportionForLowerY;
                bitmap[currentX][currentY] += (byte)(proportion * 100);
                bitmap[currentX][currentY] = min(bitmap[currentX][currentY], (byte)100);

                if(lowerLedX == 6 && lowerLedY == 6) {
                    Serial.print(", x ");
                    Serial.print(x);
                    Serial.print(", y ");
                    Serial.print(y);
                    Serial.print(", partialProportion ");
                    Serial.print(proportion);
                    Serial.print(", newBitmapVal ");
                  byte newBitmapVal = bitmap[currentX][currentY];
                    Serial.print(newBitmapVal);
                    Serial.print(" || ");
                }
            }
            if(upperLedX >= 0 || upperLedX < num_col
                &&
                lowerLedY >= 0 || lowerLedY < num_row) {
                byte currentX = x + 1;
                byte currentY = y;
                proportion = proportionForUpperX * proportionForLowerY;
                bitmap[currentX][currentY] += (byte)(proportion * 100);
                bitmap[currentX][currentY] = min(bitmap[currentX][currentY], (byte)100);
                if(upperLedX == 6 && lowerLedY == 6) {
                    Serial.print(", x ");
                    Serial.print(x);
                    Serial.print(", y ");
                    Serial.print(y);
                    Serial.print(", partialProportion ");
                    Serial.print(proportion);
                    Serial.print(", newBitmapVal ");
                  byte newBitmapVal = bitmap[currentX][currentY];
                    Serial.print(newBitmapVal);
                    Serial.print(" || ");
                }
            }
            if(lowerLedX >= 0 || lowerLedX < num_col
                &&
                upperLedY >= 0 || upperLedY < num_row) {
                byte currentX = x;
                byte currentY = y + 1;
                proportion = proportionForLowerX * proportionForUpperY;
                bitmap[currentX][currentY] += (byte)(proportion * 100);
                bitmap[currentX][currentY] = min(bitmap[currentX][currentY], (byte)100);
                if(lowerLedX == 6 && upperLedY == 6) {
                    Serial.print(", x ");
                    Serial.print(x);
                    Serial.print(", y ");
                    Serial.print(y);
                    Serial.print(", partialProportion ");
                    Serial.print(proportion);
                    Serial.print(", newBitmapVal ");
                  byte newBitmapVal = bitmap[currentX][currentY];
                    Serial.print(newBitmapVal);
                    Serial.print(" || ");
                }
            }
            if(upperLedX >= 0 || upperLedX < num_col
                &&
                upperLedY >= 0 || upperLedY < num_row) {
                byte currentX = x + 1;
                byte currentY = y + 1;
                proportion = proportionForUpperX * proportionForUpperY;
                bitmap[currentX][currentY] += (byte)(proportion * 100);
                bitmap[currentX][currentY] = min(bitmap[currentX][currentY], (byte)100);
                bitmap[currentX][currentY] = min(bitmap[currentX][currentY], (byte)100);
                if(upperLedX == 6 && upperLedY == 6) {
                    Serial.print(", x ");
                    Serial.print(x);
                    Serial.print(", y ");
                    Serial.print(y);
                    Serial.print(", partialProportion ");
                    Serial.print(proportion);
                    Serial.print(", newBitmapVal ");
                  byte newBitmapVal = bitmap[currentX][currentY];
                    Serial.print(newBitmapVal);
                    Serial.print(" || ");
                }
            }

            firstIteration = false;
        }
    }

    firstIteration = true;
    for(int x = 0; x < circle_size_corona + 1; x++) {
        for(int y = 0; y < circle_size_corona + 1; y++) {
            int lowerLedX = lowerStartX + x;
            int lowerLedY = lowerStartY + y;
            int upperLedX = upperStartX + x;
            int upperLedY = upperStartY + y;

            if(
            // firstIteration
                lowerLedX == 6 && lowerLedY == 6
                  ||
                    upperLedX == 6 && lowerLedY == 6) {
                Serial.print(", startPositonX ");
                Serial.print(startPositonX);
                Serial.print(", x ");
                Serial.print(x);
                Serial.print(", y ");
                Serial.print(y);
                Serial.print(", lowerLedX ");
                Serial.print(lowerLedX);
                Serial.print(", lowerLedY ");
                Serial.print(lowerLedY);
            }

            if(lowerLedX >= 0 || lowerLedX < num_col
                &&
                lowerLedY >= 0 || lowerLedY < num_row) {
                setLedColorWithProportion(lowerLedX,lowerLedY, .01f * bitmap[x][y]);
            }

            firstIteration = false;
        }
    }

    Serial.print(" ");
    Serial.println();
}

void setLedColorWithProportion(
    int coordX, int coordY,
    float proportion)
{
    int led = ledByCoordinate(coordX, coordY);
    uint32_t ledColor = NeoPixel.getPixelColor(led);
    uint8_t partialColor = (uint8_t)((proportion ) * 255.0f );

    uint8_t white = (ledColor>>24) & 255;
    uint8_t red = (uint8_t)((1.0f - proportion) * ((ledColor>>16) & 255))
        + partialColor;
    uint8_t green = (ledColor>>8) & 255;
    uint8_t blue = ledColor & 255;

    if(
    // firstIteration
    coordX == 6 && coordY == 6
    ) {
        Serial.print(", prop ");
        Serial.print(proportion);
        Serial.print(", redValOld ");
        Serial.print(((ledColor>>16) & 255));
        Serial.print(", redValNew ");
        Serial.print(red);
    }

    ledColor = white;
    ledColor = (ledColor<<8) + red;
    ledColor = (ledColor<<8) + green;
    ledColor = (ledColor<<8) + blue;
    NeoPixel.setPixelColor(
        led,
        ledColor);
}

int ledByCoordinate(byte column, byte row) {
  return (row  * num_col) + (column);
}

void coordinateByLed(int coordinates[2], int led) {
  coordinates[0] = led % num_col;
  coordinates[1] = led / num_col;
}

First attempt without bitmap
#include <Adafruit_NeoPixel.h>

#define PIN_NEO_PIXEL  13
#define NUM_PIXELS     400
#define num_row 20
#define num_col 20
#define circle_size_body 4
#define circle_size_border 5
#define circle_size_corona 7
#define DELAY_INTERVAL  100

float circle_PosX = 10;
float circle_PosY = 10;
int circle_direction = 1;
enum eIntersectingPart { None, Body, Border, Corona };

Adafruit_NeoPixel NeoPixel(NUM_PIXELS, PIN_NEO_PIXEL, NEO_GRB + NEO_KHZ800);

void setup()
{
  NeoPixel.setBrightness(100);
  NeoPixel.begin();
  Serial.begin(9600);           // set up Serial library at 9600 bps
}

float backgroundShift = 0;
float worldSpeed = .01;

void loop()
{
  if(circle_PosY <= 0 && circle_direction < 0
     || circle_PosY >= 10 && circle_direction > 0)
    circle_direction *= -1;
  circle_PosY += worldSpeed * circle_direction;
  circle_PosX += worldSpeed * circle_direction;
    // Serial.print("circle_PosX ");
    // Serial.print(circle_PosX);
    // Serial.print(", circle_PosY ");
    // Serial.print(circle_PosY);
    NeoPixel.clear();
    //Hintergrund setzen
    // setBackgroundColor();

    //Kreis malen
    drawCircle();

  // Serial.print("bgShift: ");
  // Serial.flush();
  NeoPixel.show(); // send the updated pixel colors to the NeoPixel hardware.
  // Serial.println(backgroundShift);
  backgroundShift += worldSpeed;
  //delay(100);     // off time
}

uint32_t setBackgroundColor() {

  for(int led = 0; led < NUM_PIXELS; led++) {
    int coordinates[2];
    coordinateByLed(coordinates, led);

    byte ambientColors[3] = { 0, 0, 255 };
    int ambientCcolorS = (int)( sin( 0.3 * coordinates[0] + backgroundShift) * 127.0 );
    int ambientCcolorC = (int)( cos( 0.3 * coordinates[1] + backgroundShift) * 128.0);
    int amberC = (ambientCcolorS + ambientCcolorC + 255) / 2;

    NeoPixel.setPixelColor(
        led,
        NeoPixel.Color(amberC, amberC ,255));
  }
}

bool firstIteration = false;
void drawCircle() {
    float startPositonX = circle_PosX - .5f * (float)circle_size_corona;
    float startPositonY = circle_PosY - .5f * (float)circle_size_corona;

    int lowerStartX = floor(startPositonX);
    int upperStartX = ceil(startPositonX);
    int lowerStartY = floor(startPositonY);
    int upperStartY = ceil(startPositonY);

    float proportionForLowerX = abs(upperStartX - startPositonX);
    float proportionForUpperX = 1 - proportionForLowerX;
    float proportionForLowerY = abs(upperStartY - startPositonY);
    float proportionForUpperY = 1 - proportionForLowerY;

    // int endX = lowerStartX + circle_size_corona;
    // int endY = lowerStartY + circle_size_corona;

    firstIteration = true;

    for(int x = 0; x < circle_size_corona; x++) {
        for(int y = 0; y < circle_size_corona; y++) {
            int lowerLedX = lowerStartX + x;
            int lowerLedY = lowerStartY + y;
            int upperLedX = upperStartX + x;
            int upperLedY = upperStartY + y;

            /*if(firstIteration) {
                Serial.print(", startPositonX ");
                Serial.print(startPositonX);
                Serial.print(", x ");
                Serial.print(x);
                Serial.print(", y ");
                Serial.print(y);
                Serial.print(", lowerLedX ");
                Serial.print(lowerLedX);
                Serial.print(", lowerLedY ");
                Serial.print(lowerLedY);
            }*/

            if(lowerLedX >= 0 || lowerLedX < num_col
                &&
                lowerLedY >= 0 || lowerLedY < num_row) {
                    setLedColorWithProportion(lowerLedX,lowerLedY, proportionForLowerX * proportionForLowerY);
            }
            if(upperLedX >= 0 || upperLedX < num_col
                &&
                lowerLedY >= 0 || lowerLedY < num_row) {
                    setLedColorWithProportion(upperLedX,lowerLedY, proportionForUpperX * proportionForLowerY);
            }
            if(lowerLedX >= 0 || lowerLedX < num_col
                &&
                upperLedY >= 0 || upperLedY < num_row) {
                    setLedColorWithProportion(lowerLedX,upperLedY, proportionForLowerX * proportionForUpperY);
            }
            if(upperLedX >= 0 || upperLedX < num_col
                &&
                upperLedY >= 0 || upperLedY < num_row) {
                    setLedColorWithProportion(upperLedX,upperLedY, proportionForUpperX * proportionForUpperY);
            }

            firstIteration = false;
        }
    }
    // Serial.print(" ");
    // Serial.println();
}

void setLedColorWithProportion(
    int coordX, int coordY,
    float proportion)
{
    int led = ledByCoordinate(coordX, coordY);
    uint32_t ledColor = NeoPixel.getPixelColor(led);
    uint8_t partialColor = (uint8_t)((proportion ) * 255.0f );

    uint8_t white = (ledColor>>24) & 255;
    uint8_t red = (uint8_t)((1.0f - proportion) * ((ledColor>>16) & 255))
        + partialColor;
    uint8_t green = (ledColor>>8) & 255;
    uint8_t blue = ledColor & 255;

    ledColor = white;
    ledColor = (ledColor<<8) + red;
    ledColor = (ledColor<<8) + green;
    ledColor = (ledColor<<8) + blue;
    NeoPixel.setPixelColor(
        led,
        ledColor);
}

int ledByCoordinate(byte column, byte row) {

    /*if(firstIteration) {
        Serial.print(", column ");
        Serial.print(column);
        Serial.print(", row ");
        Serial.print(row);
        Serial.print(", ergebis ");
        Serial.print(((row  * num_col) + (column)));
    }*/
  return (row  * num_col) + (column);
}

void coordinateByLed(int coordinates[2], int led) {
  coordinates[0] = led % num_col;
  coordinates[1] = led / num_col;
}

What exactly do you mean with bitmap and mask here? Have you tried interpolating by moving the each component linearly with the position of the rectangle? Where exactly do you have problems?

it may be easier to develop code for single row first .... for example, if there are 5 fully lit pixels, and the motion is from left to right, then the 1st pixel must fade out and the 6th pixel has to fade in ... the other 4 pixels remain unchanged

It kind of sounds like you're asking about "anti-aliasing".

Probably not related to your problem, but setLedColorWithProportion() is a quite unconventional way to do alpha compositing: the foreground object is transparent in all channels but red. The usual expectation is for the opacity to be the same for all channels.

thanks for your advice. I stepped back to a 1D model, simplified, altered and it worked, with complex models (in 1D XD), a hard coded Array. So finally I went on for 2D and extended the code. Now it works.
Yes, it's kind of anti-aliasing.
For next I am thinking how to display multiple Elements with transparency (caused by anti aliasing or pregiven transparency).
Thats all for now.
For all who may be interested, heres my current Code.
#include <Adafruit_NeoPixel.h>

#define PIN_NEO_PIXEL  13
#define NUM_PIXELS     200
#define num_col 20
#define num_row 10
#define DELAY_INTERVAL  100

float circle_PosX = 6;
float circle_PosY = 6;
int circle_direction = 1;

Adafruit_NeoPixel NeoPixel(NUM_PIXELS, PIN_NEO_PIXEL, NEO_GRB + NEO_KHZ800);

void setup()
{
  NeoPixel.setBrightness(255);
  NeoPixel.begin();
  // Serial.begin(115200);           // set up Serial library at 9600 bps
}

float worldSpeed = .01;

void loop()
{
    if(circle_PosX <= 0 && circle_direction < 0
     || circle_PosX >= 20 && circle_direction > 0
     || circle_PosY <= 0 && circle_direction < 0
     || circle_PosY >= 10 && circle_direction > 0)
    circle_direction *= -1;
    circle_PosX += worldSpeed * circle_direction;
    circle_PosY += worldSpeed * circle_direction;

    NeoPixel.clear();

    //Kreis malen
    drawCircle();

    NeoPixel.show(); // send the updated pixel colors to the NeoPixel hardware.
    // delayMicroseconds(500);     // off time
    // readInput();
}
uint8_t bitmap[5][5] = {
    {0,0,1,0,0},
    {0,1,0,1,0},
    {1,0,0,0,1},
    {0,1,0,1,0},
    {0,0,1,0,0},
};

void drawCircle() {
    for(uint8_t pixelX = 0; pixelX < 5; pixelX++) {
        for(uint8_t pixelY = 0; pixelY < 5; pixelY++) {
            if(bitmap[pixelY][pixelX] == 1) {
                writeCircleToLEDs(
                    pixelX + circle_PosX,
                    pixelY + circle_PosY);
            }
        }
    }
}

uint8_t writeCircleToLEDs(float circlePosX, float circlePosY) {
    int lowerLedX = floor(circlePosX);
    int upperLedX = ceil(circlePosX);
    int lowerLedY = floor(circlePosY);
    int upperLedY = ceil(circlePosY);

    float upperLedXAmount = circlePosX - lowerLedX;
    float lowerLedXAmount = 1.0 - upperLedXAmount;
    float upperLedYAmount = circlePosY - lowerLedY;
    float lowerLedYAmount = 1.0 - upperLedYAmount;

    float amountLowerXLowerY = lowerLedXAmount * lowerLedYAmount;
    float amountUpperXLowerY = upperLedXAmount * lowerLedYAmount;
    float amountLowerXUpperY = lowerLedXAmount * upperLedYAmount;
    float amountUpperXUpperY = upperLedXAmount * upperLedYAmount;

    setColorOfLed(lowerLedX, lowerLedY, amountLowerXLowerY);

    // if(lowerLedX != upperLedX)
    {
        setColorOfLed(upperLedX, lowerLedY, amountUpperXLowerY);
    }
    // if(lowerLedY != lowerLedX )
    {
        setColorOfLed(lowerLedX, upperLedY, amountLowerXUpperY);
    }
    // if(lowerLedY != upperLedY )
    {
        setColorOfLed(upperLedX, upperLedY, amountUpperXUpperY);
    }
    /*
    Serial.print("circlePosX ");
    Serial.println(circlePosX);
    Serial.print("lowerLedX ");
    Serial.println(lowerLedX);
    Serial.print("lowerLedXAmount ");
    Serial.println(lowerLedXAmount);
    Serial.println("--------------------");*/

}

void setColorOfLed(uint8_t ledX, uint8_t ledY, float amount) {
    int ledNumber = ledByCoordinate(ledX, ledY);
    uint32_t  baseColor = NeoPixel.getPixelColor(ledNumber);
    uint8_t newRedColor = ((baseColor >> 16) & 255);
    newRedColor += (255 * amount);

    baseColor &= ~(255 << 16);
    baseColor |= (newRedColor << 16);

    NeoPixel.setPixelColor(
        ledNumber,
        baseColor);
}

uint8_t ledByCoordinate(uint8_t coordinateX, uint8_t coordinateY) {
    return coordinateX + num_col * coordinateY;
}

uint8_t rowReadPosY = 0;
void readInput() {
    bool changed = false;
    uint8_t rowReadPosX = 0;

    while(Serial.available() > 0) {
        char input = Serial.read();

        if(!isDigit(input)) continue;

        bitmap[rowReadPosY][rowReadPosX] = atoi(&input);

        rowReadPosX++;
        if(rowReadPosX >= 5) {
            rowReadPosY = ++rowReadPosY % 5;
            rowReadPosX = 0;
        }

        changed = true;
    }

    if(changed) {
        Serial.println("Ergebnis: ");

        for(uint8_t pixelX = 0; pixelX < 5; pixelX++) {
            for(uint8_t pixelY = 0; pixelY < 5; pixelY++) {
                Serial.print(bitmap[pixelY][pixelX]);
            }
            Serial.println();
        }

        Serial.print("Aktueller Cursor: (x,y) {");
        Serial.print(rowReadPosX);
        Serial.print(", ");
        Serial.print(rowReadPosY);
        Serial.println("}");
    }
}


text:
Converting more strings from serial monitor to int arrays
I want to transfer 8 lists from a python script, via Serial Monitor to the Arduino. I can get the strings to Arduino and Arduino saves them as String array, but I can't change it to integer (it shows as 0.00 - I then convert it to float, because I need to divide it by 10 to get back real numbers)
I changed the lat and long in the api link because of privacy. Change it to an actual value (example latitude=42.234, longitude=20.000).
Python code:
import requests
from datetime import datetime
import serial
import numpy as np
import time

url = "https://api.open-meteo.com/v1/forecast?latitude=xx.xxx&longitude=yy.yyy&hourly=temperature_2m&hourly=windspeed_10m&hourly=windspeed_80m&hourly=windspeed_120m&hourly=windspeed_180m&hourly=winddirection_10m&hourly=winddirection_80m&hourly=winddirection_120m&hourly=winddirection_180m"
now = datetime.now()

stavek_veter = "Vetrne karakteristike"

ser = serial.Serial("COM3", 115200)

tr_cas = int(now.strftime("%H"))-1

response = requests.get(url).json()
vremenski_podatki = response["hourly"]

temp2m = vremenski_podatki["temperature_2m"]
cas = vremenski_podatki["time"]

paket = str(ser.readline())

hitr_vetra_10m = vremenski_podatki["windspeed_10m"]
hitr_vetra_80m = vremenski_podatki["windspeed_80m"]
hitr_vetra_120m = vremenski_podatki["windspeed_120m"]
hitr_vetra_180m = vremenski_podatki["windspeed_180m"]
smer_vetra_10m = vremenski_podatki["winddirection_10m"]
smer_vetra_80m = vremenski_podatki["winddirection_80m"]
smer_vetra_120m = vremenski_podatki["winddirection_120m"]
smer_vetra_180m = vremenski_podatki["winddirection_180m"]

hitr_vetra_10m_zmn = list(np.array(hitr_vetra_10m)*10)
hitr_vetra_80m_zmn = list(np.array(hitr_vetra_80m)*10)
hitr_vetra_120m_zmn = list(np.array(hitr_vetra_120m)*10)
hitr_vetra_180m_zmn = list(np.array(hitr_vetra_180m)*10)

hitr_vetra_10m_zmn = list(map(int, hitr_vetra_10m_zmn))
hitr_vetra_80m_zmn = list(map(int, hitr_vetra_80m_zmn))
hitr_vetra_120m_zmn = list(map(int, hitr_vetra_120m_zmn))
hitr_vetra_180m_zmn = list(map(int, hitr_vetra_180m_zmn))

if stavek_veter in paket:
    time.sleep(1.7)
    ser.write((str(hitr_vetra_10m_zmn[tr_cas: (tr_cas+6)]) + "\n").encode("utf-8"))
    time.sleep(0.5)
    ser.write((str(hitr_vetra_80m_zmn[tr_cas: (tr_cas+6)])+ "\n").encode("utf-8"))
    time.sleep(0.5)
    ser.write((str(hitr_vetra_120m_zmn[tr_cas: (tr_cas+6)])+ "\n").encode("utf-8"))
    time.sleep(0.5)
    ser.write((str(hitr_vetra_180m_zmn[tr_cas: (tr_cas+6)])+ "\n").encode("utf-8"))
    time.sleep(0.5)
    ser.write((str(smer_vetra_10m[tr_cas: (tr_cas+6)])+ "\n").encode("utf-8"))
    time.sleep(0.5)
    ser.write((str(smer_vetra_80m[tr_cas: (tr_cas+6)])+ "\n").encode("utf-8"))
    time.sleep(0.5)
    ser.write((str(smer_vetra_120m[tr_cas: (tr_cas+6)])+ "\n").encode("utf-8"))
    time.sleep(0.5)
    ser.write((str(smer_vetra_180m[tr_cas: (tr_cas+6)])+ "\n").encode("utf-8"))
    time.sleep(0.5)

print("Cas ob rezultatih: \n")
print(str(cas[tr_cas: (tr_cas+6)])+ "\n")
print("Hitrost vetra 10m \n")
print(str(hitr_vetra_10m[tr_cas: (tr_cas+6)])+ "\n")
print("Hitrost vetra 80m \n")
print(str(hitr_vetra_80m[tr_cas: (tr_cas+6)])+ "\n")
print("Hitrost vetra 120m \n")
print(str(hitr_vetra_120m[tr_cas: (tr_cas+6)])+ "\n")
print("Hitrost vetra 180m \n")
print(str(hitr_vetra_180m[tr_cas: (tr_cas+6)])+ "\n")
print("Smer vetra 10m \n")
print(str(smer_vetra_10m[tr_cas: (tr_cas+6)])+ "\n")
print("Smer vetra 80m \n")
print(str(smer_vetra_80m[tr_cas: (tr_cas+6)])+ "\n")
print("Smer vetra 120m \n")
print(str(smer_vetra_120m[tr_cas: (tr_cas+6)])+ "\n")
print("Smer vetra 180m \n")
print(str(smer_vetra_180m[tr_cas: (tr_cas+6)])+ "\n")

while True:
    paket = str(ser.readline())
    print(paket.encode("utf"))

Arduino code:
#include <Wire.h>
//#include <WireIMXRT.h>
//#include <WireKinetis.h>

int hitr_vetra_10m[6], hitr_vetra_120m[6], hitr_vetra_80m[6], hitr_vetra_180m[6];
int smer_vetra_10m[6], smer_vetra_80m[6],smer_vetra_120m[6], smer_vetra_180m[6];
float hitr_vetra_10m_ko[6], hitr_vetra_120m_ko[6], hitr_vetra_80m_ko[6], hitr_vetra_180m_ko[6];

int n, k;

String ser_string[8];

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Wire.begin();
  delay(6000);

  Serial.println("Vetrne karakteristike");
  delay(2000);

  for(n = 0; n<=8; n++){
    if(Serial.available()>=14){
      ser_string[n] = Serial.readStringUntil("\n");
      Serial.flush();
      Serial.println(ser_string[n]);

      if(n==0){
        while(ser_string[n].indexOf(",")!=-1){
          hitr_vetra_10m[k] = ser_string[n].substring(0,ser_string[n].indexOf(",")).toInt();
          k++;
        }
        hitr_vetra_10m[k]=ser_string[n].toInt();
      }

      k=0;
      if(n==1){
        while(ser_string[n].indexOf(",")!=-1){
          hitr_vetra_80m[k] = ser_string[n].substring(0,ser_string[n].indexOf(",")).toInt();
          k++;
        }
        hitr_vetra_80m[k]=ser_string[n].toInt();
      }
      k=0;

      if(n==2){
        while(ser_string[n].indexOf(",")!=-1){
          hitr_vetra_120m[k] = ser_string[n].substring(0,ser_string[n].indexOf(",")).toInt();
          k++;
        }
        hitr_vetra_120m[k]=ser_string[n].toInt();
      }
      k=0;

      if(n==3){
        while(ser_string[n].indexOf(",")!=-1){
          hitr_vetra_180m[k] = ser_string[n].substring(0,ser_string[n].indexOf(",")).toInt();
          k++;
        }
        hitr_vetra_180m[k]=ser_string[n].toInt();
      }
      k=0;

      if(n==4){
        while(ser_string[n].indexOf(",")!=-1){
          smer_vetra_10m[k] = ser_string[n].substring(0,ser_string[n].indexOf(",")).toInt();
          k++;
        }
        smer_vetra_10m[k]=ser_string[n].toInt();
      }
      k=0;

      if(n==5){
        while(ser_string[n].indexOf(",")!=-1){
          smer_vetra_80m[k] = ser_string[n].substring(0,ser_string[n].indexOf(",")).toInt();
          k++;
        }
        smer_vetra_80m[k]=ser_string[n].toInt();
      }
      k=0;

      if(n==6){
        while(ser_string[n].indexOf(",")!=-1){
          smer_vetra_120m[k] = ser_string[n].substring(0,ser_string[n].indexOf(",")).toInt();
          k++;
        }
        smer_vetra_120m[k]=ser_string[n].toInt();
      }
      k=0;

      if(n==7){
        while(ser_string[n].indexOf(",")!=-1){
          smer_vetra_180m[k] = ser_string[n].substring(0,ser_string[n].indexOf(",")).toInt();
          k++;
        }
        smer_vetra_180m[k]=ser_string[n].toInt();
      }
      k=0;

      delay(500);
    }

  }
  n=0;

  for(int b = 0; b<=5;b++){
    hitr_vetra_10m_ko[b]=hitr_vetra_10m[b]/10.0;
    hitr_vetra_80m_ko[b]=hitr_vetra_80m[b]/10.0;
    hitr_vetra_120m_ko[b]=hitr_vetra_120m[b]/10.0;
    hitr_vetra_180m_ko[b]=hitr_vetra_180m[b]/10.0;
  }
}

void loop() {
  // put your main code here, to run repeatedly:
  for(int j = 0; j<=5; j++){
    Serial.println(hitr_vetra_10m_ko[j]);
  }
  delay(5000);

}

Why does it only write out 0.0 for every place in the array (example: [0.0,0.0,0.0,0.0,0.0,0.0]?
Thanks in advance for all help.
EDIT:
I've changed the last part of python code to this

while True:
    paket = str(ser.readline().decode("utf"))
    print(paket.encode("ASCII"))

and I get the following result when I print what is coming from Serial monitor (whatever data I print in python and the show it in VScode terminal.)
Cas ob rezultatih:

['2023-02-13T18:00', '2023-02-13T19:00', '2023-02-13T20:00', '2023-02-13T21:00', '2023-02-13T22:00', '2023-02-13T23:00']

Hitrost vetra 10m

[2.1, 3.1, 1.3, 1.9, 2.3, 2.6]

Hitrost vetra 80m

[0.4, 1.1, 2.5, 0.5, 1.8, 1.8]

Hitrost vetra 120m

[0.7, 0.7, 3.3, 1.1, 1.0, 1.8]

Hitrost vetra 180m

[1.3, 1.0, 4.0, 2.5, 0.8, 0.4]

Smer vetra 10m

[211, 249, 146, 248, 219, 214]

Smer vetra 80m

[360, 252, 98, 225, 217, 217]

Smer vetra 120m

[360, 180, 84, 90, 225, 217]

Smer vetra 180m

[34, 135, 85, 90, 63, 180]

b'[21,31,13,19,23,26]\n'
b'[4,11,25,5,18,18]\n'
b'[7,7,33,11,10,18]\n'
b'[13,10,40,25,8,4]\n'
b'[211,249,146,248,219,214]\n'
b'[360,252,98,225,217,217]\n'
b'[360,180,84,90,225,217]\n'
b'[34,135,85,90,63,180]\n'
b'\r\n'
b'[21,31,13,19,23,26]\n'
b'[4,11,25,5,18,18]\n'
b'[7,7,33,11,10,18]\n'
b'[13,10,40,25,8,4]\n'
b'[211,249,146,248,219,214]\n'
b'[360,252,98,225,217,217]\n'
b'[360,180,84,90,225,217]\n'
b'[34,135,85,90,63,180]\n'
b'\r\n'
b'\r\n'
b'\r\n'
b'\r\n'
b'\r\n'
b'\r\n'
b'\r\n'
b'\r\n'
b'[21,31,13,19,23,26]\n'
b'[4,11,25,5,18,18]\n'
b'[7,7,33,11,10,18]\n'
b'[13,10,40,25,8,4]\n'
b'[211,249,146,248,219,214]\n'
b'[360,252,98,225,217,217]\n'
b'[360,180,84,90,225,217]\n'
b'[34,135,85,90,63,180]\n'
b'\r\n'
b'\r\n'
b'\r\n'
b'\r\n'
b'\r\n'
b'\r\n'
b'\r\n'
b'\r\n'

please add a clear, answerable question to your post

For debugging, first change your python encoding to encode('ASCII') instead of encode('utf8') (BTW, your paket.encode("utf") doesn't seems to be correct. If you need other to help you, an example of what the data been sent by phthon code, and what you have received by the Arduino would be helpful to understand what exactly the problem you are facing.

@hcheung I've edited the post and added soma data.

Okay, if your Hitrost vetra 10m is a String representative of  floating point as [2.1, 3.1, 1.3, 1.9, 2.3, 2.6], you need to parse it with hitr_vetra_80m[k]=ser_string[n].toFloat(); instead of using toInt() method. See more about [toFloat()] method at toFloat().

@hcheung I've multiplied the numbers by 10 and will then divide it by 10 in the Arduino, so I don't read floats from Serial monitor because I've read it's very difficult to read floats.


text:
Combined code to run a 2-zone radiant floor system. Cannot get 'RadiantMain' to work. Better description in beginning of code
Trying to combine code to run a 2-zone radiant floor heating system. The menu code works perfectly. When I select MenuC 'Run main' it executes to RadiantMain prints test and then returns to menu options again. Been working on this for weeks and don't how to fix it. The RadiantMain code works ok as a stand-alone.
The second sketch starts where it says //START RUN RADIANT MAIN CODE. The menu sketch and the Radiant Main are 2 separate sketches written by 2 different developers. They do run as stand-alone sketches. I modified the menu sketch to operate my relays (MenuA and MenuB) for the manual mode it works fine. I need to be able to use the menu sketch to run 3 different functions. MenuA & MenuB to manually run the system in manual mode and a third menu item (MenuC) to run the 2nd sketch in auto mode.
I need to combine the 2 sketches together into one code
I am using a D1 ROBOT LCD KEYPAD shield. A1 through A5 are connected to temp sensors. 4 relay shield controls 2 water valves and a pump, 4th relay is unused. the menu sketch controls the 2 water valves with MenuA and MenuB. I need MenuC to run the second sketch which reads sensors sets temps and controls 2 water valves and a pump.

//MENU CODE STARTS HERE

#include <LiquidCrystal.h>
LiquidCrystal lcd(8,9,4,5,6,7);

int keypad_pin = A0;
int keypad_value = 0;
int keypad_value_old = 0;

int pinCount = 4;
int relay_1 = 12;//zone 1
int relay_2 = 11;//zone 2
int relay_3 = 3;//pump
//int relay_4 = 2;//open

char btn_push;

byte mainMenuPage = 1;
byte mainMenuPageOld = 1;
byte mainMenuTotal = 3;

void setup() {
  Serial.begin(9600);
  pinMode(relay_1, OUTPUT);//zone 1
  pinMode(relay_2, OUTPUT);//zone 2
  pinMode(relay_3, OUTPUT);//pump
  //pinMode(relay_4, OUTPUT);
    lcd.begin(16,2);  //Initialize a 2x16 type LCD

    MainMenuDisplay();
    delay(1000);
}
void loop()

{
    btn_push = ReadKeypad();

    MainMenuBtn();

    if(btn_push == 'S')//enter selected menu
    {
        WaitBtnRelease();
        switch (mainMenuPage)
        {
            case 1:
              Zone1();
              break;
            case 2:
              Zone2();
              break;
            case 3:
              Radiant();
              break;
            /*case 4:
              MenuD();
              */break;
        }

          MainMenuDisplay();
          WaitBtnRelease();
    }

    delay(10);

}//--------------- End of loop() loop ---------------------

void MainMenuDisplay()
{
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("Choose function");
    lcd.setCursor(1,1);
    switch (mainMenuPage)
    {
        case 1:
          lcd.print("Run zone 1");
          break;
        case 2:
          lcd.print("Run zone 2");
          break;
        case 3:
          lcd.print("Run main");
          break;
        case 4:
          lcd.print("4. Menu D");
          break;
    }
}

void Zone1()

{
    {
    digitalWrite(relay_1, HIGH);
    digitalWrite(relay_3, HIGH);
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print(" Running zone 1");
    lcd.setCursor(0,1);
    lcd.print(" Left to end");
    while(ReadKeypad()!= 'L');
    digitalWrite(relay_1, LOW);
    digitalWrite(relay_3, LOW);
    }
}
void Zone2()
{
    digitalWrite(relay_2, HIGH);
    digitalWrite(relay_3, HIGH);
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print(" Running zone 2");
    lcd.setCursor(0,1);
    lcd.print(" Left to end");
    while(ReadKeypad()!= 'L');
    digitalWrite(relay_2, LOW);
    digitalWrite(relay_3, LOW);
}

void Radiant()

    {
    RadiantMain();
    }

void MenuD()
{
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("Inside Menu D");

    while(ReadKeypad()!= 'L')
    {
        //Insert Task for Menu D here

    }
}

void MainMenuBtn()
{
    WaitBtnRelease();
    if(btn_push == 'U')
    {
        mainMenuPage++;
        if(mainMenuPage > mainMenuTotal)
          mainMenuPage = 1;
    }
    else if(btn_push == 'D')
    {
        mainMenuPage--;
        if(mainMenuPage == 0)
          mainMenuPage = mainMenuTotal;
    }

    if(mainMenuPage != mainMenuPageOld) //only update display when page change
    {
        MainMenuDisplay();
        mainMenuPageOld = mainMenuPage;
    }
}

char ReadKeypad()
{
  /* Keypad button analog Value
  no button pressed 1023
  select  741
  left    503
  up      326
  down    142
  right   0
  */
  keypad_value = analogRead(keypad_pin);

  if(keypad_value < 100)
    return 'R';
  else if(keypad_value < 200)
    return 'D';
  else if(keypad_value < 400)
    return 'U';
  else if(keypad_value < 600)
    return 'L';
  else if(keypad_value < 800)
    return 'S';
  else
    return 'N';

}

void WaitBtnRelease()
{
    while( analogRead(keypad_pin) < 800){}
}
//END MENU CODE

// Title: 2 zone Radiant Heat Controller
// Date:12/01/14
// Author: Chris Biblis (My First Adruino Project )

//RADIANT MAIN CODE STRTS HERE_________________________________________________________

// #include <LiquidCrystal.h>

// LiquidC//rystal lcd(8, 9, 4, 5, 6, 7);
// define some values used by the panel and buttons
int lcd_key     = 0;
int adc_key_in  = 0;
#define btnRIGHT  0
#define btnUP     1
#define btnDOWN   2
#define btnLEFT   3
#define btnSELECT 4
#define btnNONE   5
// read the buttons
int read_LCD_buttons(){
 adc_key_in = analogRead(0);
 // buttons when read are centered at these valies: 0, 144, 329, 504, 741
 // we add approx 50 to those values and check to see if we are close
 if (adc_key_in > 1000) return btnNONE;
 if (adc_key_in < 50)   return btnRIGHT;
 if (adc_key_in < 250)  return btnUP;
 if (adc_key_in < 450)  return btnDOWN;
 if (adc_key_in < 625)  return btnLEFT; //Changed value to 625 do to double read from select button Default is 650.
 if (adc_key_in < 850)  return btnSELECT;
 return btnNONE;
}
// Setup relay shield pin array.
int relayPin[] = {2, 3, 11, 12};
//int pinCount = 4;

// Set On/Off Differentials for collector/tank temperatures.
const int diffON = 5;
const int diffOFF = 2;

// Set Default Thermostat temperature
int setTemp = 60;
int setTemp2 = 60;

//Used for calibration
int offSet[] = {-2, -1, 0, 1, 2};

//Button Variables.
int select = 0;
int up = 0;
int down= 0;
int backLight = 10;
boolean BLbutton = false;

//void RadiantMain()//RadiantMain setup
{
 lcd.begin(16, 2);
 lcd.setCursor(0,0);
 //Introduction Screen
 lcd.print("2 zone");
 lcd.setCursor(0,1);
 lcd.print("Radiant floor");
 delay(2000);

  for (int thisPin = 0; thisPin < pinCount; thisPin++)
   { pinMode(relayPin[thisPin], OUTPUT);}

 }
// Read average voltage from sensors
int ReadSens(int x)
{
  int i;
  int sval = 0;
    for (i = 0; i < 10; i++)
    { sval = sval + analogRead(x); }
  sval = sval / 10;
  return sval;
}
// Calculate temperature in F from voltage of sensors.
int getTemp(int y)
{
  //Convert to Celcius
  float a = (((y / 1024.0) * 5000)/10)-273.15;
  //Convert Celcius to Fahrenheit
  float b = a * 9.0 / 5.0 + 32.0;
  return b;
}

void RadiantRun()//need RadiantRun loop
{
 // Get average Voltage
 int z1flr = ReadSens(1);//zone  1 floor temp
 int z2flr = ReadSens(2);//zone2 floor temp
 int z1line = ReadSens(3);//zone 1 return line temp
 int z2line = ReadSens(4);//zone 2 return line temp
 int pmp = ReadSens(5);
 // Get Temperatures & Apply OffSet { -2, -1 , 0, 1, 2 }
 int zone1floortemp = (getTemp(z1flr) + offSet[0]);
 int zone2floortemp = (getTemp(z2flr) + offSet[0]);
 int zone1linetemp = (getTemp(z1line) + offSet[0]);
 int zone2linetemp = (getTemp(z2line) + offSet[0]);
 int pump = (getTemp(pmp) + offSet[0]);

  //Backlight button selection...
  if (BLbutton == true){pinMode(backLight, INPUT);} //turn backlight off
    else{pinMode(backLight,OUTPUT);} //turn backlight on
 // Display screens
  if (select == 3){select = 0;}
  if (select == 0){
    lcd.clear(); lcd.setCursor(0,0);
    lcd.print("  Ambient Temp ");
    lcd.setCursor(6,1);
    lcd.print(zone1floortemp);
    lcd.print(" F");
}
  if (select == 1)
{
    lcd.clear(); lcd.setCursor(0,0);
    lcd.print("Set Ambient To:");
    lcd.setCursor(6,1);
    lcd.print(setTemp);
    lcd.print(" F");
}
  if (select == 2)
{
    lcd.clear(); lcd.setCursor(0,0);
    lcd.print("Z1F ");
    lcd.print(zone1floortemp);
    lcd.print("F");

    lcd.setCursor(9,0);
    lcd.print("Z2F ");
    lcd.print(zone1floortemp);
    lcd.print("F");

    lcd.setCursor(9,1);
    lcd.print("Z2L ");
    lcd.print(zone2linetemp);
    lcd.print("F");

    lcd.setCursor(0,1);
    lcd.print("Z1L ");
    lcd.print(zone1linetemp);
    lcd.print("F");

}

lcd_key = read_LCD_buttons();  // read the buttons
 switch (lcd_key)
 {
   case btnSELECT:{ BLbutton = !BLbutton; delay(100); break; }
   case btnUP:    { setTemp++; select = 1; delay(100); break; }
   case btnDOWN:  { setTemp--; select = 1; delay(100); break; }
   case btnRIGHT: { select++; delay(100); break; }
   case btnLEFT:  { select--; delay(100); break; }
 }

// only 1 zone at a time_____________NOT IMPLEMENTED YET____________

// zone 1
// if floor temp zone 1 = less then set temp then open valve zone 1 turn on pump
  // if(z1flr <= (setTemp + diffOFF))
  // {digitalWrite(relayPin[3], HIGH);} // pump on
  // {digitalWrite(relayPin[12], HIGH);} // valve 1 on
  // {digitalWrite(relayPin[11], LOW);} // valve 2 off

// if floor temp zone 1 = set temp then close valve zone 1 turn off pump
  // if(z1flr = (setTemp + diffOFF))
  // {digitalWrite(relayPin[3], LOW);} // pump off
  // {digitalWrite(relayPin[12], LOW);} // valve 1 off

// // if floor temp zone 2 = less then set temp and  zone 1  = less then set temp zone 2 valve off
//   if(z1flr <= (setTemp + diffOFF) && (z1flr < (setTemp)))
//   {digitalWrite(relayPin[11], LOW);} // valve 2 off

// zone 2
// if floor temp zone 1 = less then set temp then open valve zone 1 turn on pump
  // if(z1flr <= (setTemp + diffOFF))
  // {digitalWrite(relayPin[3], HIGH);} // pump on
  // {digitalWrite(relayPin[11], HIGH);} // valve 2 on
  // {digitalWrite(relayPin[12], LOW);} // valve 1 off

// if floor temp zone 1 = set temp then close valve zone 1 turn off pump
  // if(z1flr = (setTemp + diffOFF))
  // {digitalWrite(relayPin[3], LOW);} // pump off
  // {digitalWrite(relayPin[11], LOW);} // valve 2 off

// if floor temp zone 1 = less then set temp and  zone 2  = less then set temp zone 1 valve off
  // if(z1flr <= (setTemp + diffOFF) && (z1flr < (setTemp)))
  // {digitalWrite(relayPin[12], LOW);} // valve 1 off

  delay(500);

}
//RADIANT MAIN CODE ENDS HERE___________________________________________________

//relay pinouts
//Digital 12 – controls RELAY 1 COM1 pin zone 1 valve
//Digital 11 – controls RELAY 2 COM2 pin zone 2 valve
//Digital 3 – controls RELAY 3 COM3 pump
//Digital 2 – controls RELAY 4 COM4 open

//sensors:
//flr1 = floor temp zone 1 sensor
//flr2 = floor temp zone 2 sensor
//pmp = pump OFF/ON
//z1= zone 1 line temp sensor
//z2 = zone 2 line temp sensor

what is the problem? ... what were you expecting to happen? ... what actually happened?

explanation at beginning of code

"When I select MenuC 'Run main' it executes to RadiantMain prints test and then returns to menu options again". If this is what you means "explanation at beginning of code", this merely described what your code does, it doesn't explain what you are expecting it to do. Your sketch works exactly as how you code it, that it, MenuC() called RadiantMain(), which doesn't do much other than setting up some pins to OUTPUT, and then back to main menu. If it not what expecting it to do, you need to be more elaborate on what it support to do...

Changed the names in the menu from MenuA to 'Zone1' and MenuB to 'Zone2' and MenuC to 'Radinat'. Zone1 and Zone2 work as expected. Using menu selection 'Radiant' to call RadiantMain which is the second sketch.
The menu sketch will run as a stand-alone.
The RadiantMain sketch will run as a stand-alone. I need the second sketch to run complete when I select the  Radiant menu selection.
The RadiantMain code starts after the //END MENU CODE.

Your code for RadiantMain is:
void RadiantMain()

{
 //Serial.println("test");

 lcd.begin(16,2);
 lcd.setCursor(0,0);
 //Introduction Screen
 lcd.print("Solar Collection");
 lcd.setCursor(0,1);
 lcd.print("& Radiant Heater");
 delay(2000);

   Serial.println("test");
   //CODE STOPS HERE LOOPS BACK TO 'void MainMenuDisplay()'

  for (int thisPin = 0; thisPin < pinCount; thisPin++)
   { pinMode(relayPin[thisPin], OUTPUT);}
 }

You say "CODE STOPS HERE" in a comment, but all it does after printing "test" is set some pins to output mode. Is that not happening? Are you expecting something else?
If you want some of the other functions (like RadiantRun) to do something then they must be called from RadiantMain or elsewhere.

I need to be able to use the menu sketch to run 3 different functions. MenuA &MenuB to manually run the system in manual mode and a third menu item (MenuC) to run the 2nd sketch in auto mode.

You need to make that happen by calling the appropriate functions in "the second sketch" when the appropriate menu button is pressed.
Merely putting the code into the same file doesn't accomplish this.
Exactly what you want to happen "in auto mode" isn't clear to me. You need to be clear in your own mind what that is. For example, taking a reading, adjusting the water valves, waiting a minute, and doing it again.
Once you are clear what you want to happen in that mode, you call the appropriate functions to achieve that.
You haven't answered the questions in the comments under your main question. Without those answers no-one can help you.

The second sketch starts where it says //START RUN RADIANT MAIN CODE. The menu sketch and the Radiant Main are 2 separate sketches written by 2 different developers. They do run as stand-alone sketches.  I modified the menu sketch to operate my relays (MenuA and MenuB) for the manual mode it works fine. I need to be able to use the menu sketch to run 3 different functions. MenuA &MenuB to manually run the system in manual mode and a third menu item (MenuC) to run the 2nd sketch in auto mode.

@HaroldVermillion What do you mean with "2 separate sketches"? One Arduino can only run exactly one sketch, not more. You showed us one code. This code needs to handle everything, that the Arduino should do. Or do you try to ask how to combine 2 sketches?

I need to combine the 2 sketches together into one code

I am using a D1 ROBOT LCD KEYPAD shield. A1 through A5 are connected to temp sensors. 4 relay shield controls 2 water valves and a pump, 4th relay is unused. the menu sketch controls the 2 water valves with MenuA and MenuB. I need MenuC to run the second sketch which reads sensors sets temps and controls 2 water valves and a pump.

@HaroldVermillion See amended answer.

@HaroldVermillion why are you placing important information into a comment? ... it does not belong there ... this site is not a forum ... please place all info into your question at top of this page ... people read the question and move on when they see lack of information


text:
Poor Contact and Low Current Issues with Microswitches in Arduino USB Game Controller
I have made a USB game controller using the Arduino Micro and Omron microswitches (VX-01-1A3) for the buttons. The switch is wired with one end connected to a digital pin and the other end connected to GND. However, I am experiencing issues such as double-clicking, poor contact, and disconnection while using the microswitch. I have tried implementing debounce code, replacing the switch and cables, but the problem persists and often returns after only a few weeks of normal operation.
In the datasheet for the Omron VX series,  I came across a diagram:

which prompted me to measure the current through the switch when pressed, which was only about 0.3mA. Since the digital pin voltage of the Arduino Micro is 5V, this state is not within the normal operating range shown in the diagram.
Could this be the reason for the poor contact of my microswitch?
If so, how can I increase the current through the switch to bring it within the normal operating range? Would adjusting the pull-up resistor (using an external pull-up resistor instead of the Arduino's built-in pull-up resistor) be a feasible solution?
Thank you for your help.

I'm not sure, if this is really the problem, but  yes, using an external pullup resistor with a value small enough will get you a higher current through the switch. Using a 4.7kOhm resistor will give you just above 1mA.


text:
A fatal error occurred: Failed to connect to ESP32: Wrong boot mode detected (0x13)! The chip needs to be in download mode. [upload] Error 2
I have seen so many people complain about this same error and they were given a multitude of answers to help with this error, but nothing so far has worked for me.
Everything was working fine until I upgraded to Win 11 and the latest version of VS Code. I also attempted uploading with the Arduino IDE and no success.
I'm at the point of throwing the ESP32 boards into a box, and moving onto an alternative until someone comes up with a different solution.
This is my failed punch list gathered from the many postings about this error:

Followed these instructions: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html  without success.
Removed and Re-installed the CP210x & CH340 (ESP32-CAM Programming Board) Windows Drivers
Tried both VS Code & Arduino IDE with Ubuntu on two different computers.
For Ubuntu, I added "User" to dialout.
Pressed IO0 & RST to force the ESP32 into Boot Mode.
Verified USB cables were data cables.
Tested 6 ESP32 Dev Kit boards to make sure I didn't have a bad one.
Soldered a 10 uF capacitor across the EN pin and GND
Added: monitor_dtr = 0 & monitor_rts = 0 to platformio.ini
The two different Boards ESP32 DEV Kit & ESP32-CAM Boards, both appear in Device Manager.
Attempted to upload the code in Win 10, and had the same results.

I'm a beginner with this technology, so please keep this in mind when you answer my question.
Thanks,in advance, to anyone who can help me.

I would start over and bring up the simplest software development kit possible.  That means to layoff VSCode and just start with a fresh install of the Arduino software development kit.  I might even start with a real Uno (not a knock off, and not something as complex as an ESP processor).  Just to make sure everything is functioning as expected.  BTW, I recently updated many tools on one of my windows PCs and noticed that VSCode posted a note indicating a paradigm switch WRT it's Arduino software was taking place as part of the VSCode upgrade.

Thanks, I will try your suggestion.  If it doesn't work, then I'll add it to the my list of attempts.  I'm not familiar with "paradigm switch WRT".  What does that mean?

When I updated my copy of VSCode there was a message (a popup) that the Arduino feature was being changed.  I don't recall the particulars.  I use VSCode extensively for something other than Arduino development and popups usually never happen during an upgrade.  That is what I meant by a "paradigm switch WRT ... (With Respect To)".

I purchased a NodeMCU clone ESP32 board and encountered this error.

A fatal error occurred: Failed to connect to ESP32: Wrong boot mode detected (0x13)! The chip needs to be in download mode. [upload] Error 2

There were 2 separate problems, and I was stumped by their combined effect:

Normally such boards automatically go into program upload mode using the RTS/CTS pins on the USB serial. This self-resetting mechanism did not work on my board. I had to manually press the BOOT button on GPIO0 in order to upload code.

I guessed the above problem correctly, but there was an additional quirk: ESPTool sends a RESET command just before uploading the code. So you have to press the BOOT button when you see the message 'Connecting..' on the Arduino IDE. Normally we will hold the BOOT button and press reset in order to put the board in boot mode. This did not work with this board. Pressing the button at the time of power up/ connecting the USB cable etc. all failed. You have to press the BOOT button at the right time!

In addition to the Arduino IDE, I observed the same behavior with other tools like Tasmotizer. In all cases, the solution was the same.


text:
Incorrect IP address when using Ethernet library with Arduino Uno and WizNet 5500 ethernet module
I'm trying to get an ethernet module with the W5500 chipset to connect to my network on an Arduino Uno, but whatever I do, I always get an incorrect IP address.
The module is connected as default SPI, with the CS pin on pin 10.
Initially I was using the wrong libraries (those meant for the ENC28J60), until Juraj pointed out to me that I had the W5500 chipset.
So I loaded the Ethernet WebServer example sketch in my Arduino IDE (1.8.13), changed the IP value, compiled it, and tried to run it. In my code, I set the IP to 192.168.123.225, but the serial monitor showed me IP 192.80.239.132 .
After some Googling I found a post called Ethernet library not initializing IP correctly, as well as several other pages each stating that the Ethernet2 library should be used for the W5500 chipset instead of Ethernet.
I've tried installing the Ethernet2 library from within the Arduino IDE, with the exact same result. I loaded the example sketch of this library, same result. After downloading the library from GitHub (as found on another page describing the same problem), I got some errors and commented out some sections as seen in my code below, but still with the same result.
In the commented code you can also see that I've added a check to see whether my module is actually recognized as a W5500, and it is...
So my question, while elaborate, is very simple: how can I set the IP correctly on a W5500 chipset module connected to an Arduino Uno?
Here is my code (I've left out the loop, obviously):
#include <SPI.h>
#include <Ethernet2.h>

// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192, 168, 123, 225);

// Initialize the Ethernet server library
// with the IP address and port you want to use
// (port 80 is default for HTTP):
EthernetServer server(80);

void setup()
{
  // You can use Ethernet.init(pin) to configure the CS pin
  Ethernet.init(10);  // Most Arduino shields

  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial)
  {
    ; // wait for serial port to connect. Needed for native USB port only
  }
  Serial.println("Ethernet WebServer Example");

  // start the Ethernet connection and the server:
  Ethernet.begin(mac, ip);

  // Check for Ethernet hardware present
  /*
  if (Ethernet.hardwareStatus() == EthernetNoHardware)
  {
    Serial.println("Ethernet shield was not found.  Sorry, can't run without hardware. :(");
    while (true)
    {
      delay(1); // do nothing, no point running without Ethernet hardware
    }
  }
  else
  {
    if (Ethernet.hardwareStatus() == EthernetW5500)
    {
      Serial.println("Ethernet shield is a W5500");
    }
  }

  if (Ethernet.linkStatus() == LinkOFF)
  {
    Serial.println("Ethernet cable is not connected.");
  }
  */

  // start the server
  server.begin();
  Serial.print("server is at ");
  Serial.println(Ethernet.localIP());
}

Is your network using DHCP? Perhaps the network is trying to assign the IP address "it wants" to your device. Is there a test sketch with the W5500 library that uses DHCP to connect to the network? Maybe this sketch could help to narrow down the issue... https://github.com/RoboCore/Ethernet_W5500/blob/master/examples/DhcpAddressPrinter/DhcpAddressPrinter.ino

try the WebClient example of the Ethernet library version 2.0.0+. it has enhanced diagnostics (don't comment it out)

@VE7JRO Yes, my network is using DHCP, but if the address was a DHCP address, it would be in the range 192.168.123.x . I'll give the sketch you mentioned a try to find out what IP I get when using DHCP, I'm curious to find out if DHCP does work.

@Juraj Thanks for the pointer, I'll give it a go and update accordingly. And no, I won't comment out the diagnostics ;)

@VE7JRO Well, I downloaded the Ethernet_W5500 library from your link, replaced all files under "Ethernet" with those files and tried the WebServer example client again after verifying in the source code that the W5500 was active, but unfortunately I still get the wrong IP address (192.80.239.132).

@Juraj I've checked and (prior to testing VE7JRO's answer) I had the 2.0.2 version of the Ethernet library. I loaded the WebClient example, but as it was, I never got a DHCP address (I changed the MAC address in the code to one which is allowed on my network). I gave up on DHCP and set a static IP (same as above), but just like the code VE7JRO pointed to, I ended up with the same erroneous IP address...

check the wiring

@Juraj The wiring is correct as far as I can tell. Vcc to 3.3V (from a separate supply), gnd combined with the Arduino, SCK to pin 13 of the Arduino, Mi (miso) to 12, Mo (mosi) to 11, SC (ss) to 10 (as stated in the code, the only variable pin). Int pin is not connected, Reset pin is not connected (these are never mentioned in the articles I found).

should the module be powered with 3.3 V? some Ethernet modules have a converter from 5 V to 3.3 V for the W5500, because some Arduinos can't provide enough current on the 3.3 V pin

@Juraj Yes, this particular module should be powered by 3.3V. Also, I'm not powering the module from the Arduino but from a separate (lab) power supply, and yes, both grounds (Arduino and lab power supply) are connected.

if begin hangs it is a problem with communication with the module

@Juraj Begin doesn't hang, the entire setup gets executed, and the final Serial.println prints an incorrect IP address.

I meant begin using DHCP. begin with static IP never fails but if it didn't work, reading the IP address back gives you a random value.

@Juraj I'm afraid I'm a bit confused now, I'm not using DHCP. Or are you telling me to begin by using DHCP as a test? Because I already tested using DHCP and I never get an IP address, whether or not the MAC address I assign is explicitly allowed in my network.

I am still at the WebClient example of the Ethernet library as a basic troubleshooting tool

@Juraj That's the sketch I was trying on March 29, but I never got a DHCP address. That's why I switched to using a static IP address. Any idea on how to figure out why the DHCP begin hangs?

W5500 works fine with IP ranges upto xxx.127.xxx.xxx But with the second octect 128 or higher, the IP becomes some random numbers ie gets corrupt . Unable to resolve the problem. For other IP ranges, there no issue

I had the same issue: a strange IP was shown. Also the LEDs of the Lan connection had a rather strange blinking: green went on for a second then off and then orange did the same. The solution for me: an external power supply with 7 V at the Vin. Apparently the Lan shield is drawing too much power for the usb power supply...
Also it is working with the standard ethernet library

something is wrong with your hardware if USB doesn't provide enough power for Uno with Ethernet shield


text:
How can i use a TFT Screen shield along with other sensors and transmitters
I want to use Arduino as described in this instructable:
http://www.instructables.com/id/Uber-Home-Automation-w-Arduino-Pi/
But i thought i would give it a little twist by adding a TFT monitor to some devices. I have bought and got the following tft shield to work:
http://www.banggood.com/UNO-R3-ATmega328P-Board-2_4-Inch-TFT-LCD-Screen-Module-For-Arduino-p-945755.html
But now it strikes me:
How can i combine the screen on an arduino where i also have a sensor and a radio transmitter?

You need another layer! A breadboard shield - from the same source if you like - would seem the obvious answer.
Alternatively, take flying leads from the pins you are using to the screen & mount it elswhere, then connect the sensors.
LCD's use quite a few pins, you'll probably need to be creative with an Uno. I have one on a Mega, & have been there with the same problem!

Link seems to be incorrect. I think you mean something like this. Also, I don't think there is enough room in between the two shield for an breadboard, and associated wires. Soldering would an a good option here.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Converting live vocals to discrete signals
I would like to augment a live music performance by displaying an specific LED for any given musical note.
For vocals:
Rather than attempt to process the audio using the Arduino board, I'd like to use something like an auto-tune box to do the heavy lifting.
For digital instruments: Would like to drive the Arduino board with some kind of digital signal (for example midi)
I'm having trouble finding out which (if any) consumer audio device can provide the pre-processing. Are there any comparable projects or insights?

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Multithreading Leds and Joystick
I'm trying to made a program that turn on and turn off leds with an input and send the coordinates of joystick, but, in the loop, the arduino makes one at a time, and i want make this in the same time. How can i make that?

It isn't clear what you're asking. Can you describe what you've already tried? One processor can only do one thing at a time but it can do things in very a fast sequence, as long as the individual tasks have not (or only very short) delays. Have you tried to do this?

I tried to sent an input to control the leds and send at the same time one joystick, but, the loop is something like this:
loop() {
controlleds();
joystickevent();
}
but he runs, controlleds first, and joystickevent next, i want at the same time.

My answer to question 9752 shows code to handle multiple actions independently.

One way to do this is to use the millis() function.
millis() returns the current value of a timer that is incremented once per millisecond (hence the function name). You can compare the value of millis() at some past time with the current value to determine how many milliseconds have passed. By having multiple compare registers you can have multiple independent delays operating. (There is also micros() which increments at the 1 uS rate (with a "granularity" of 4uS on some processors).
This code is an example only. It MAY run but has not been tested and probably contains silly mistakes which do not affect its example purposes.
A function ToggleLED(n) is assumed which toggles the specified LED n from 1->0 or 0->1  as required.
LED1 will flash 200 mS on, 200 mS off, ...
LED2 will flash 333 mS on, 333 mS off, ...
The two loops are essentially independent.

unsigned long delay1; delay2;

void setup(){

int FlashTime1 = 200; / LED 1 will have a 200 on 200 off cycle
int FlashTime2 = 333; / LED 2 will have a 333 on 333 off cycle

delay1 = millis() + FlashTime1;  / Init LED timers
delay2 = millis() + Flashtime2;
}

void loop()
{
  if (millis() == delay1){ / Not until delay expired.

    ToggleLED(1);
    delay1= millis() + FlashTime1; / Reinit flash timer}

  if (millis() == delay2){

       ToggleLED(2);
       delay2= millis() + FlashTime2;}

}

the loop is something like this:
loop() {
controlleds();
joystickevent();
}

but he runs, controlleds first, and joystickevent next, i want at the
  same time.

There are typically two ways to read a simple potentiometer joystick: Connect it in a voltage divider and measure the analog voltage; and connect it in an R-C circuit and measure the time for the capacitor to charge.
The first way is faster and you should not be able to notice the time difference between controlling the LEDs and reading the joystick.
The second way takes longer and you might be able to notice. If this is how your joystick controller works, you would need to separately start the joystick reading, continue to poll the buttons control the LEDs, and check whether the joystick reading is ready yet. The joystick routine must not delay, waiting for the measurement to finish.


text:
MQTT Arduino add quality of service
I'm making a project with MQTT Arduino, but on publish messages i read that it's not possible to publish with qos 1 and 2? It is true? If is not, how can i put qos on publish messages?

What MQTT client are you using?
Paraphrased from the MQTT spec http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718099

The MQTT protocol provides three qualities of service for delivering
  messages between clients and servers: "at most once", QOS0; "at least
  once" QOS1; and "exactly once" QOS2. For QOS 1&2: The message must be
  stored locally at the publisher, until the publisher receives
  confirmation that the message has been delivered to the receiver.
  However, for QOS0 there is no storage requirement.

The problem with the Arduino is that there is no large quantity of storage available. If the client is disconnected from the broker while using a QOS of 1 or 2 the client must store the messages until a connection is reestablished and the message transfers are acknowledged. On an Arduino there is no guarantee all the messages can be saved. Consider a sensor node collecting 16-bits (int value) every second. Then supposed the broker goes down over the weekend and a repair person isn’t paid to work on the weekend. That’s two days’ worth of data or 172800 readings or about 1/3 MB (without overhead). The Arduino does not have that much storage.


text:
MQTT vs Tinkerkit sensor Shield
I'm working with this http://knolleary.net/arduino-client-for-mqtt/. I'm using Arduino Uno + Ethernet shield + Tinkerkit Shield. But, if i have only Arduino Uno + Ethernet Shield, i can connect my arduino with MQTT and make publish/subscribe, but, when i put the tinkerkit shield, i lost the connection and i cannot connect any more. Any idea? Tinkerkit sensor shield is incompatible with mqtt?
Thanks.

I think your problem is in wiring. Ethernet shield is using SPI communication, it requires pins: SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). Those pins must be left for the Ethernet shield. Information is from Arduino Uno description.
Does your Arduino communicates with you after you plug-in Tinkerkit? If not, maybe you have a short in Tinkerkit shield.

The problem was that. Thank you so much. I'm with one led plug in 10.


text:
RGB LED blinks when analogWrite is low
I have set up an LED who's brightness is controlled by a sonar sensor.  The sonar works well and I can see the values coming from it through the serial monitor.  The LED fades until about 700 using analogWrite
#include <NewPing.h>

#define TRIGGER_PIN  12
#define ECHO_PIN     11
#define MAX_DISTANCE 5000

int LED_PIN = 3;

NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE);

void setup() {
    pinMode(LED_PIN, OUTPUT);
    Serial.begin(9600);
}

void loop() {
    delay(50);
    int uS = sonar.ping();
    long int max_uS = 8000;
    float brightness = (1-(((float)uS/(float)max_uS)))*1024;
    if(brightness < 0){
        brightness = 0;
    }
    Serial.print("Distance: ");
    Serial.print(uS / US_ROUNDTRIP_IN);
    Serial.print("\" ");
    Serial.print(uS);
    Serial.print(" ");
    Serial.println(brightness, 5);

    analogWrite(LED_PIN, brightness);
}

When I view the serial monitor, I've made it output a line that looks like this:
Distance: 10" 1500 830.00000

830 is the number I'm using for my analogWrite.  I can move my hand farther and closer to the distance sensor and when I do, the light fades, but after 13" (which is brightness = 774) the LED looks like it turns back on high.
Between 1"-13" it fades very smoothly, except at 13" the light is almost out, then at about 14" it turns on again almost at full brightness and is very hit or miss from there.  Even though the numbers in the serial monitor are holding steady.
Any reason for this?

The maximum value you can pass to analogWrite() is 255, not 1024, unless you are using something that isn't an Arduino.

well that explains a lot!  What am I think that takes 1024?

The ADC can return a value between 0 and 1023 - that's analogRead(). That may be what you are thinking of.

Ah yes! You're correct.  I just got back into doing Arduino stuff after a years absence. Thank you!

To be fair, analogWrite() on a ESP8266 takes values up to 1023 by default, but then I suppose that falls under "isn't an Arduino".

@Majenko, If you'd like to place your comment as an answer, I'd be happy to upvote and accept!

The maximum value you can pass to analogWrite() is 255. Anything higher than that will wrap around back to 0.
You should scale your value to fit into 0-255 instead of 0-1024.


text:
Mic input and Speaker output using arduino
I am trying to make a small project. Firstly, I want to record voice using a small microphone(electret) for the time button is pressed and on releasing the button, the speaker of my laptop should output the recorded voice or a speaker attached to the arduino should output.
Note: I don't want to use any shield to do so. Simply Arduino

Which Arduino do you intend to use? Most of them don't have enough built-in storage for any significant amount of audio.

You will not be able to do this without adding support components such as a pre-amp and storage device, at which point your requirement not to use a shield become a desire to do things the hard way.  Realistically, a basic ATmega-based Arduino is a poor choice for this application.  Many other boards have more appropriate hardware, though perhaps not as user friendly a development environment (something like an STM32F4 Discovery for example has everything you need on board except the speaker).  One of the ARM-based boards from arduino.cc might work as well.

Microphone input is easy (ADC). Speaker output is easy (PWM). Both have many, many examples strewn across the Internet.
What happens in between is not, and will require external components. You will need at the very least somewhere to store the samples between record and playback. Investigate SPI SRAM large enough to store all the required samples at your chosen sample rate (8 kS/s should be high enough for human speech).

I was looking to combine these two concepts http://www.instructables.com/id/Arduino-SOS-signal-with-8ohms-speaker-LED-blinki/?ALLSTEPS
http://www.instructables.com/id/Connect-the-arduino-and-make-the-speaker-play/?ALLSTEPS

Neither of those is what you want.


text:
It is possible to run an entire script on the Linux side? If so, how, what and where to do that?
I am new to using Arduino Yun and I would like to know if it is possible to run an entire script on the Linux side. In my case the script should execute a HTTP request to a remote server, parse the subsequent HTTP response and return some value that then can be used in the Arduino sketch.
If it is possible, what I have to do? For example, how should I write and run script files? what programming language should I use? where I should put those script files on the Linux side?

Not a Yun expert but shell commands seem easy on the Yun. I don't know much about adding a script to it, so feel free to build off of this and post an answer.

Don't know anything about Yun but I'd look at the FileIO class to make a file and write your script into it. Then use Process class to execute it.

Arduino Yun ships with python pre installed. You can copy python scripts from your pc to the yun with scp (or WinSCP or putty, if you're on windows). Once copied, just run it using Process from your sketch. As they are scripts, program name is python and the path to your script is its first argument (you can do that in a different way, but that would require some linux magic, which I suggest to postpone if you're new to it).
Other pre installed options include lua and bash. Other languages such as ruby, erlang and php are available as optional packages.

In which directory on Yun should I put my script files?

Wherever, but the sd card is the preferred choice, so you don't wear out the flash. If you have an sd card with an arduino folder, you should have it available at /mnt/sd


text:
How to disable Arduino Yun to work as Access Point and set it to work as needed?
I am using Arduino Yun and I would like to disable it to work as Access Point. That is, I don't want that it is displayed in the list of available networks.
Then I would like to set and use it (separately) in the following scenarios:
a) Arduino Yun connected just over a given Wi-Fi network (Ethernet connection disabled).
b) Arduino Yun connected just over Ethernet (Wi-Fi connection disabled).
How can I make it?
Note: In my previous attempts I tried to customize and/or disable someway the Wi-Fi connection (through the LuCI panel) in order to reach what I am looking for but in all of these cases I had to restore my Arduino Yun from scratch because it did not work anymore.

Yun expects wifi to be working and, if it's not, it will reboot itself after 60 seconds and return in access point mode.
In order to disable this check, edit file /etc/rc.local and turn wifi-live-or-reset into #wifi-live-or-reset (with a starting #).
Once done, use LuCI (the advanced configuration panel) to configure network interfaces.


text:
Powering 5V Accesories
I'm using an Uno to control NeoPixels LED strips (60 per metre). These are powered with a 5V DC supply. Now, when using USB to power the Arduino it works lovely. However I want to move the Arduino into a standalone "installation" where I'll only want one power supply.
I've already got a 5V DC supply which outputs about 5.2V. What is the best way to power both the Arduino and the LEDs? I understand the need for at least 7V at the Arduino's voltage regulator input. Would my best bet be to get a 12V supply (or similar) and use a buck converter to power the LEDs? The total current draw could reach 3.6A but will be 400mA for the majority of the time.

Just split the line coming from the 5v adapter. Have one 5v line connect the 5v pin on the arduino board, and the other to the led strip. That way you bypass the voltage regulator.

My worry wasn't that. My worry was that the 5V from the adapter was potentially not stable enough.

If your supply is regulated (put a 47ohm resistor across it and measure the AC voltage with a DMM; it should be almost nothing if properly regulated) then you can use it for both the Uno and the NeoPixels. The ATmega328P has a maximum input voltage of 5.5V, and the WS2812B has a maximum voltage of 5.3V, putting the supply within the proper range to run them.


text:
Understanding transistor datasheets
I'm trying my best to understand and utilise questions that already exist as well as other websites, however I just wanted to check the circuit I've come up with (which is a very simple switch circuit) will work.
I plan on using a BD139 transistor, although I haven't purchased anything yet, so can change to anything really.
The fans are each 0.09A at 12V. I've calculated that R1 should be 360ohms. The 5V control will be coming from an Arduino. I believe it's within the specs of the transistor. Ic max is 1.5A.
Does the circuit look correct? Are there any changes I should make?

For saturation you should assume hfe to be 10. This gives:
(5V − 0.85V) / ((0.09A ⋅ 3) / 10) = 154 Ω
Consider using a 150-220Ω base resistor instead. And since a fan is an inductive load, don't forget the flyback diode from the collector to the +12V rail. A 1N4000 series diode should be fine for this small a load.

Where did you get that value for hfe?

That is a safe assumption for normal (i.e. non-darlington) transistors. It's used by EEs the world over.

The datasheet specifies 25 (minimal) for Hfe. Using 150Ω would result in about 32mA of current, which is above the recommended 20mA for a digital pin.

@Gerben: Are you sure you didn't confuse the Vbe and Vce on the datasheet? Vbe(sat) according to the chart is about 0.85V at Ic=0.3A.


text:
Connecting hardware to the Arduino
I'm using an Arduino Due with various sensors. At the moment, I'm using the majority of the pins along the width (the double width pins). I want to make the setup more permanent, however I can't seem to find any ribbon cables with 36-conductors. What do you use for long term connections on the Due, especially if you occasionally need to unplug all the connections? Would a 40-pin ribbon cable work as they're easy to come by.
Thanks

I have used 40 pin cables for this purpose, specifically, IDE cables (beware: on high speed, "80 conductor" cables, but still with 40 pin connectors, some pins are permanently connected, to indicate to to the controller that this is a high speed cable!). The connectors are cheap, the cables are free if you ask around (probably less so now). In my case, I connected two extra-large 7-segment displays, and it worked great. More pins than you rarely hurts. In my case, it was especially useful since I needed some pins at the top, and some pins at the bottom of the display; my ide cable had three connectors (motherboard & two drives); I used the top row on one ide connector to the top of of my displays, and the bottom row of pins on the other connector to the bottom of the displays.

Take a look at these jumper wires. http://www.amazon.com/gp/aw/d/B00M5WLZDW/ref=mp_s_a_1_6?qid=1431346007&sr=8-6&pi=AC_SX110_SY165_QL70 they are really great for debugging as well as more permanent solutions.
If you are looking to build more than 5 go with some of the other posted answers

You can also make your own IDC ribbon cables pretty easily. A 36-pin cable might be pretty hard to find a connector for, but you could use a 20-pin and a 16-pin side by side.
Have a look at Kobicon 164-9008-E and Kobicon 164-9001-E.
You can get creative and mix and match different pin counts, depending on your project. Buy a few meters of 40-conductor .05" pitch ribbon cable, and you can peel off the 4 outermost conductors to make it 36-conductor, as well as separating the end of the cable into your connector groups.