chrisl
  • Member for 4 years
  • Last seen this week
Arduino Hello World in Serial monitor
3 votes

Judging from the comments, you lag some basic knowledge. To really learn, what you are supposed to learn in this assignment, you should review your learning material or C/C++ and Arduino Tutorials on ...

View answer
FastLED - How to Control specific LEDs
Accepted answer
3 votes

The colors of the LEDs in your sketch are set in this loop: for(int i = 0; i < NUM_LEDS; i++ ) { leds[i].setRGB(0,255,250); // Set Color HERE!!! leds[i].fadeLightBy(brightness); } You ...

View answer
Using serial.available to return number of bytes
Accepted answer
3 votes

This is because at the first execution only one byte was received. The Serial interface does not send the data in one big packet of 5 bytes, only because you typed five bytes and started the ...

View answer
How can I initialize an array of objects in setup?
Accepted answer
3 votes

As Craig wrote, the declaration of an class typed array will call the default constructor of the class, which is the one without any arguments. The class, that you use, does not provide a default ...

View answer
What will happen if I set ARef to 3.3V and try to use adc connected to 5V
Accepted answer
3 votes

The datasheet of the Atmega328P does not give a direct answer to this, but Single ended channels that exceed V REF will result in codes close to 0x3FF. (Datasheet Chapter 24.5.2) sounds, as it ...

View answer
Custom function like yield
Accepted answer
3 votes

Without any hint, what you are actually doing in your long loops, it is difficult to say, what way would be the best for your case. I don't believe, there is a standard way of doing this, but there ...

View answer
Run two stepper at same time
Accepted answer
3 votes

When using a normal stepper driver, you say the driver to do one step, by sending him one pulse. The length of these pulses does not have a meaning. they are constructed, so that the driver can sense ...

View answer
Arduino TimerOne breaks the program when calling "digitalRead"
Accepted answer
3 votes

The time between 2 interrupt triggers is only 8us. Also digitalRead() is a quite big function, that needs some time to execute (I don't know how much). That way it is to short for the Serial print ...

View answer
How can I get an external program to change values inside the Arduino C++ code?
2 votes

Your question seems very confused, so I will try to shine a light on some basic distinctions. How can I get some constantly changing values from a separate C++ program entered and uploaded into the ...

View answer
Selenoid motor not responding to NodeMCU instructions
Accepted answer
2 votes

So you connected 3.3V and pin D2 both to the positive motor wire. When the pin is high the motor runs and gets its current from the 3.3V pin. When you set the pin to LOW you essentially short the 3.3V ...

View answer
Can a power cut damage the software?
Accepted answer
2 votes

First we need to look at the different memory technologies in a microcontroller: First you have the flash memory. This is where the program is saved, but it can also be used to hold user data. On AVR ...

View answer
How to smooth transition to another color NEOPIXELS
2 votes

something that will go through the color wheel until the destination color For that the FastLED library has the function ColorHSV(), which can be used to define colors using the HSV color space. It ...

View answer
Modifying the neopixel rainbow function to work with 4pins
Accepted answer
2 votes

Currently you are first filling an array with values from a calcuation by going through all LEDs; and then you are again going through all LEDs to actually set them. You can do that in one step. Also ...

View answer
How to change brightness of LED light?
Accepted answer
2 votes

To change the brightness of any RGB color you need to multiply each color component by the brightness ratio. Lets look at some examples: Red is 255,0,0 in RGB. Full brightness is represented by 1, ...

View answer
Why does the send pin influence the receive pin with Arduino Capacitive Sensing Library
Accepted answer
2 votes

If we ignore the capacitance of the input pin, then it would instantly follow the voltage of the send pin. A voltage drop over the resistor only happens if a current is flowing though it, which cannot ...

View answer
How to use this specific arduino shield
2 votes

Do I even need this shield at all? Can I just use a regular UNO to be able to freely operate with 6 servos? You don't really need this shield for 6 servos. The standard servo library supports 12 ...

View answer
5-bit communication method?
2 votes

Unfortunately your code is all over the place. You have to use C/C++ syntax, which you don't. Also you don't actually read any input. if statements look like this: if(condition){ my_code(); ...

View answer
How can I play sound on Arduino with an SD card?(I have a problem with the sound)
Accepted answer
2 votes

I see three problems with your code: It doesn't make much sense to begin the SD card again and again in loop(). Please move that part to setup() or somewhere, where it isn't called on every loop ...

View answer
How to control Shift registers output individually bitwise
Accepted answer
2 votes

You have two problems with your code: byte is equal to unsigned char and can only hold exactly one byte, aka 8 bits (not 16 bits like your comment says). But you are trying to assign a 16bit number ...

View answer
How to call multiple delayed functions using a single millis()
2 votes

The current structure with multiple if statements and on timestamp variable does only work, if you also check for millis()-then being smaller than the next interval. Otherwise the first if statement ...

View answer
why can Arduino variables of int type contain a value such as A2
2 votes

You are correct. A2 is just a number (like everything in a microcontroller). We can look at the corresponding part in pins_arduino.h (a file defined in the variants folder of your used core and of ...

View answer
How detect I2C errors with requestFrom()
Accepted answer
2 votes

The Wire library does not give you any possibility to get error states, when requesting bytes from a slave. Basically you are stuck with the number of bytes being read. Though you can read some ...

View answer
Purpose of LED indicator
2 votes

This buildin LED is connected to an IO pin of the microcontroller on the Mega (most commonly pin 13, but might be different depending on the board). So the meaning depends on what the code on the Mega ...

View answer
Slow USB reading operation
Accepted answer
2 votes

When sending multiple bytes which together form a single message it is best to use a delimiter character and read the data until there. That way you don't run into timeouts and you can be sure, that ...

View answer
Setting float to two decimal places
2 votes

In addition to Majenkos answer: A float cannot take any decimal number. It has a limited change and a limited resolution in that range you could say. So if often happens, that the flat (rounded) value ...

View answer
Electronics Laboratory
2 votes

There won't be a really complete list, since there are many many tools, that one could use for an electronics/Arduino laboratory. Also low budget is relative, so you might wanna choose out of the ...

View answer
What is the difference when an arduino has been unplugged vs when a serial port connection was closed?
Accepted answer
2 votes

We cannot know, if your python code also has a problem. But your Arduino code will send the series of "V" only once. You are using this while loop: while(counter < maxnum) in there you ...

View answer
Reproduce simulated temperature data with Arduino
Accepted answer
2 votes

You can use an array to go through the times. Create a struct with the fields time and temperature (you should think about saving time as unix epoch, meaning seconds since 1970, so that you save ...

View answer
HC-05 Module not receiving commands and not pairing
2 votes

You have seen contradictory statements, because there are many variables here, that might be different for each of the tutorials. some connect the RX and TX pins in reverse to the Arduino, some don't,...

View answer
Arduino - Function -> return Cstr instead of string
Accepted answer
2 votes

You cannot work with c-strings like with Strings. You need to use the standard c-string functions (like sprintf(), strcpy() and siblings) or directly access the char array. This gives the following ...

View answer
1 2 3
4
5
20