New answers tagged

0

The analogread pin is unstable. This fixed it,ResponsiveAnalogRead, from github


0

Since you're using a matrix of anodes and cathodes you need to connect/disconnect both ends of each LED. You will probably multiplex these LEDs and only light one at a time. Are the LEDs high enough current that you can't either source or sink enough current for a single LED directly from Arduino pins? Most LEDs run on ≤ 20 mA, which an atmega328 can ...


0

The dimming problem was found to be the shift register IC not connected to Ground (dumb me). However, there is still problem with LED's on and off pattern. Sometimes two LEDs turn on at the same time and all previous LEDS turning off before the last or second last LED is turned on. It turns out Pin 10 (SRCLR Bar) needs to be pulled to high to solve that ...


1

This is not a complete answer, but an idea of how to accomplish the task. I just typed it in without testing the code. Use arrays to hold variables. That way a loop can be used to service the three sensors and the three LEDs.. for (i = 0; i<3; i++) { currentTime = millis(); // ...


3

You need to review your code and also the capabilities of the Arduino UNO. int declares an integer. So int duty = 0.5; is going to get rounded to either 0 1. delay(0); also will not work. The instruction will simply get skipped. Likely the reason why you get a brighter LED. Try to use delayMicroseconds(); if you need shorter time but the minimum delay ...


2

Look at the back of the module. There are 3 groups of 3 solder pads each, marked with A0, A1 and A2. With these pads you can set the 3 least significant bits of the address. On the images in your product link these pads are unconnected. The middle pin is the address pin. The left pad (which is connected to a trace) is Vcc, the right pad (which is connected ...


1

You are misinterpreting how the onReceive callback works. The millis() code like in the BlinkWithoutDelay example relies on the fact, that it is run repeatedly very fast, so that effectively the time is checked regularily very fast. The onReceive callback is only called once every time, that the Wire library received an I2C message, from an interrupt ...


0

I'd take a look at Mark Kriegsmans FastLED example "DemoReel100". This example shows how to delegate to multiple functions. First, I'll explain that example a bit: You set up an array of function pointers plus a variable for the current index. typedef void (*SimplePatternList[])(); SimplePatternList gPatterns = { rainbow, rainbowWithGlitter, confetti, ...


1

In your button() function, the line if (current and not last) { is less common syntax. The more common equivalent is: if (current && !last) { (see https://stackoverflow.com/questions/2376448/the-written-versions-of-the-logical-operators) This line: current == last; Has no effect and is incorrect. This ( “==“ ) is not an assignment but a ...


0

Your problem may only be that you are not calling the button function. Try changing if (button >=0) to if (button() >=0).


0

First of all, you need to have an overview over the whole project because you need to know what components you are going to use, how many digital/analog pins do you need, then check the official Arduino website to see if the board fulfills your needs. If there is no special need, like more EEPROM or more analog inputs, almost most of the board will work for ...


0

Micheal well easy solution is to use arduino nano as its bread board friendly and easy as it comes with the arduino IDE installed, well if size is what you are looking for then digispark attiny 85 can also do the task and its size is almost equal to a coin but for that youll need to install it in the arduino IDE which is a bit difficult. if you need any help ...


Top 50 recent answers are included