chrisl
  • Member for 3 years, 11 months
  • Last seen this week
RF Keyfob single button code
Accepted answer
1 votes

Look again at your logic here: if (num == 16130609){ mySwitch.disableReceive(); if (statusled == LOW) statusled = HIGH; } else { statusled = LOW; } When you press A you will get num ...

View answer
Whats common practice when using more components than there are pins?
6 votes

Basically there are 4 ways to go if you run out of pins: Change to a microcontroller board with more pins Arrange the parts in a smart way to save pins (like if you have many buttons or LEDs you ...

View answer
How to limit backlight LED current in 16x2 LCD
3 votes

The two pins on the LCD which are marked "LED" are directly connected to the backlight LED. If you drive an LED over its forward voltage the current is rising exponential in relation to the ...

View answer
Why analogRead's value decreases when I decrease the value of resistor?(I use digitalWrite(high) to positive terminal of resistor)
Accepted answer
0 votes

A digital output pin can only provide a specific current: 20mA max recommended, 40mA absolute max. When you get near and over that these values the voltage will go down, as the internal driver ...

View answer
i am tying to make a automated parking lot with a gate, sensor, button, keypad, how can i time how long has each car spent inside?
1 votes

For measuring the time for each parking lot: Declare an array of unsigned long with one element per parking lot (so 5 in this case) and initialize it with zeros: #define N_PARKING_LOTS 5 unsigned long ...

View answer
Doubt in coding part in blink without delay
3 votes

This is a common misunderstanding for Arduino beginners. In the second code you do unsigned long currentmillis = millis(); outside of any function, meaning at global scope. These variables are ...

View answer
Controlling a 5V fan and ultrasonic fogger with an arduino - do I need an external power supply?
Accepted answer
7 votes

About the ultrasonic fogger: The product description is misleading. This is a pure transducer. That means it does not generate its own ultrasonic frequency and is thus not DC. You need to provide an ...

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
Why do we add delay when using ultrasonic sensors?
9 votes

We need to provide the HC-SR04 with a fitting trigger signal. When you read the datasheet of the HC-SR04 you will see that it needs a 10us trigger pulse. The first delay of 2us is to make sure we are ...

View answer
Is an ESP32 HTTP web server limited to a certain number of Base64 images?
1 votes

You build up the HTML website by concatting strings together by hand in the code. I know this is done in many code throughout the internet, but this is only really practical, if you need to change the ...

View answer
Serial connection between Processing and Arduino doesn't work
Accepted answer
1 votes

Most Arduinos (and the Nano Every is one of them) will reset when the serial connection is reopened (You close it by closing the processing sketch and open it again with the Serial Monitor). Variables ...

View answer
Can arduino show the power drawn from its output pin on serial monitor? If yes, what code should I use?
1 votes

No, it cannot do power measurement. With an Arduino (and most other microcontrollers) you only have voltage measurement (on the analog input pins). Though this is half of the power measurement, since ...

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
How to use HC-SR04 sensor to make a flowmeter?
Accepted answer
3 votes

I don't think this will work with HC-SR04 sensors. They are not just ultrasonic transducers. They incorporate extra electronics for the sole purpose of measuring the time difference between the sended ...

View answer
Random Blink with millis()
Accepted answer
4 votes

Your problem descriptions is a bit unclear, though I think I see your problem. On every loop() iteration you call randomBlink(), which generates a new random delay value and then calls ledBlink(), ...

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
PID control doesn't work. After computing the values, the values just become equal to 0
1 votes

You seem to have some misconceptions about PID. For explaining I will use a different use case of a PID control, which is easier to understand (and also mentioned in the documentation of the PID ...

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
How to change variable/sketch through a GUI
Accepted answer
1 votes

Reflashing (and with that recompiling) the sketch for every variable change is very over-the-top. As you already want to write your own program for the PC I would suggest using Serial. That will be ...

View answer
LCD displays more digits than serial monitor
4 votes

The additional "6" seems to come from one of the first values. Maybe the first value printed is just a rogue value and all the following values are correct. The point is that this rogue ...

View answer
Keyboard.h not found on Arduino nano
Accepted answer
1 votes

To convert the comments into an answer: You cannot (!) use the Keyboard library on the Arduino Uno/Nano/Mini. It needs a native USB interface to configure it as a HID device, but the Uno/Nano/Mini all ...

View answer
what is the maximum number of servo motors that can be connected to a l293d motor shield?
1 votes

As to the PDF Guide on page 19: How can I connect to the unused pins? The analog pins (analog 0-5 also known as digital pins 14-19) are broken out in the bottom right corner. Pin 2 has a small ...

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
How to send multiple data over serial in one byte?
Accepted answer
4 votes

You should learn how to use bitwise operators. These are needed to do what you want. We can save the state of each switch in one bit each. For this we first define our global variable that will hold ...

View answer
ESP8266 with HC05 : expecting to receive more bytes then the 63 received
1 votes

I see 2 things, that might give you problems. First the one with a higher chance of being the important point: You use while (EEBlue.available()) in your GetBMSData() function. With serial (and ...

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
Arduino Uno freezes for unknown reason during code execution
Accepted answer
5 votes

The program most likely hangs at Wire.endTransmission();, because that's where the actual I2C communication happens. Wire.write() does nothing but placing the data into the internal buffer of the Wire ...

View answer
Delay() and millis() functions don't work in cpp external files
Accepted answer
10 votes

The Arduino framework does some initializing for you before going into setup() and loop(), for example configuring Timer0 correctly for millis(), delay() and siblings. This is done in the main() ...

View answer
Where are these junk characters (from serial) coming from?
Accepted answer
1 votes

I would say you are printing data outside of your char array, because you didn't terminate the C-string in it and the size of your array is too small. You have #define BYTELENGTH 4 //Limited to 4 ...

View answer
1
2 3 4 5
20