get length of multidimensional array with different length in c++?

Advertisements I have a multidimensional array and i’m trying to get the length of each column. But it’s returning 20 for all of them. int buttons[16][5] = {{0, 4, 1},{1, 0, 2, 5},{2, 1, 3, 6},{3, 2, 7},{4,0,5,8},{5,1,4,6,9},{6,2,5,7,10},{7,3,6,11},{8,4,9,12},{9,5,8,10,13},{10,6,9,11,14},{11,7,10,15},{12,8,13},{13,9,12,14},{14,10,13,15},{15,11,14}}; sizeof(buttons[0]); >Solution : You are declaring an C-style array where each element is an array of 5… Read More get length of multidimensional array with different length in c++?

Why is my variable jumping in value when I add an "if" condition?

Advertisements The code below, without the if statement, count’s up from 1 to infinite and shows this in the console as intended. If I add the if statement, I get what’s shown in the screenshot below. Why does this happen? #include <Arduino_MKRIoTCarrier.h> MKRIoTCarrier carrier; int a; int r,g,b; void setup() { // put your setup… Read More Why is my variable jumping in value when I add an "if" condition?

'dict' object has no attribute 'mean'. Problems using statistics.mean(list with numbers)

Advertisements I am trying something new with flask, Python and the arduino. I want to measure things with the arduino, calculate and save some values through phyton and put it on display through flask. Right now I can make sure that the arduino receives and gives information and the displaying to a localhost worked. However… Read More 'dict' object has no attribute 'mean'. Problems using statistics.mean(list with numbers)

How can I get this code to make LEDs linked to my arduino flash at either the value the dial outputs, or no more than a determined value?

Advertisements Before I get started I want to make it clear I am still a beginner in both C++ and Arduino electronics, so the answer may be painfully obvious to someone with even a week more experience than me. But to me, it is a total mystery. Thank you for any help. To begin this… Read More How can I get this code to make LEDs linked to my arduino flash at either the value the dial outputs, or no more than a determined value?

Calculating a "char*" calculation and give back the result as a "double" (or "float")

Advertisements i want to calculate the "char*" and give back the result as a "double" (or "float"). char* calculation = "2+2*2"; double result = atof(calculation); double result: 2.00 The problem is that it just doesn’t calculate automatically and just stops scanning the "char*" at the "+". Any ideas? And NO I don’t want to declare… Read More Calculating a "char*" calculation and give back the result as a "double" (or "float")