chrisl
  • Member for 4 years
  • Last seen this week
Issue with simple timer based on millis()
Accepted answer
2 votes

Since currentMillis is just a simple variable, it will not automatically update. In fact the initialization with millis() in global scope is unnecessary. Just initialize the value with 0. At the time, ...

View answer
4 Bit Counter up and down
2 votes

Currently you are just setting the LEDs manually one after another in your code. That is not actually a binary counter (as it is most likely wanted by the exercise), but only looks like one. First you ...

View answer
[SOLVED]Normalization not working on input buffer. How to solve this?
Accepted answer
2 votes

I will point out some problems with your code: Look at this line: 64*(Buffer2[i]/Buffer2[0]); It doesn't do anything. You calculate a scaled value, but you are not saving it anywhere. You need to ...

View answer
Blink only one led in a led strip
2 votes

Everytime, that you want the LEDs to change, you need to call the FastLED.show() function. You are doing that only once after you set the values multiple times. Also you need 2 delays in total (1 for ...

View answer
How to control speed of 28BYJ-48 stepper motor without using library?
2 votes

A stepper motor always needs a driver. As the ULN2003 (or similar) driver is normally shipped together with the 28byj-48 motor, I will assume, that you have this driver. The ULN2003 has 6 pins: Vcc ...

View answer
Run multiple function with different argument/return structure by one function pointer
2 votes

I assume, that the fun_ptr points to the different service functions to do some kind of animation other other long running tasks on your display, thus you want to repeatedly call them in a structured ...

View answer
Serial Communication to Control Stepper
Accepted answer
2 votes

You have 2 problems, which are already mentioned in the comments: You call Serial.end() after you received one line. That will stop the Serial hardware. Thus the code will only receive one line and ...

View answer
Measure the time between 2 inputs
2 votes

The way to go depends on the time range, that the event will have. The Arduino framework already includes a function for timekeeping: millis(). It returns the number of milliseconds since the startup (...

View answer
Bitwise write to analog PIN
Accepted answer
2 votes

Note, you haven't specified, which Arduino you are using. I'm assuming a Atmega328p based Arduino (Uno, Nano, Mini) here, though the principle works with every AVR microcontroller, that has this ...

View answer
Best buffering practice for continuous SD card writing
2 votes

Is this a sensible solution to the problem? No, unfortunately not. The size of the buffer is limited by the available RAM on your chip. Jumping between multiple buffers or cores will not change that, ...

View answer
Read Comma Separated String
2 votes

The AVR implementation of sscanf() does not support parsing floating point numbers, thus you only get zeros out of it. You can't use the %f specifier with it. You need to convert these numbers by ...

View answer
Joy-IT RS232 Shield and RS232 voltage levels
Accepted answer
2 votes

Yes, that shield will handle the level shifting for you. If you look closely at the images of the shield, you see the MAX232 chip, which is a commonly used chip for getting UART (which is the Serial ...

View answer
Get more PCINT capable pins on Mega 2560
Accepted answer
2 votes

The Atmega2560 has a total of 24 pins associated to the PinChange interrupt. You cannot change that. It is an internal property of the microcontroller. As you already have seen yourself, you need to ...

View answer
Serial Communication, if statement not working
2 votes

You are using Serial.println() to send the message. That function will add the combination \r\n as line ending to your message, which are the ASCII codes for return carriage and newline. In your ...

View answer
I want a bar type display for my Arduino Project
Accepted answer
2 votes

As Majenko already stated, the second image shows a custom display. It is not pixelated, because each shown element/symbol has it's own element in the LCD. When you have one of these displays, you ...

View answer
How to create a 1 hour timer with ATtiny13A microcontroller?
2 votes

As the unchanged blink sketch blinks with 8.4 seconds, I think my assumption is right. The clock of the Attiny is running 8 times slower, than the code thinks. When you have installed the Attiny core, ...

View answer
Is an Ultrasonic Sensor or Infrared Sensor better for measuring distance (to/from a human body)?
Accepted answer
2 votes

That depends on your requirements. An IR distance sensor will work better with different materials, since IR light is mostly reflected in very broad angles (expect for very reflective materials, like ...

View answer
Arduino split comma separated serial stream
Accepted answer
2 votes

The reference article, that you linked to, is about sending data over Serial, not about reading. You can use the strtok() function, which can split a character buffer into tokens based on a delimiting ...

View answer
Arduino using delay in I2C receiveEvent
2 votes

The general way of doing long things triggered by an ISR is to simply set a flag insode the ISR, which then gets checked inside void loop(). volatile byte flag = 0; void loop(){ if(flag){ ...

View answer
Is it possible to overload the digital pins for an Arduino?
Accepted answer
2 votes

As mentioned in the comments, you cannot power your robot from a 9V block battery. These are made for low power projects (like a smoke detector) and cannot provide enough current to drive even only ...

View answer
Confused as to how 2 of my interrupts are firing from just 1 pin input?
Accepted answer
2 votes

The interrupt on pin 2 triggers, because the pin is floating. Since nothing is connected to the pin, it reacts to whatever noise is flying by (for example from pin 3). That can lead to the pin ...

View answer
Arduino Timer 1 Library manipulate Timer value
2 votes

When you look into TimerOne.h, which is the header file for the TimerOne library, you can see at line 55 the method void setPeriod(unsigned long microseconds) which can be used to set the period of ...

View answer
Nokia 5110 LCD number display problem
2 votes

Look at line 55, where you are doing this temperature = newSetpoint; There is no reason to give temperature the same value as the set point. It does not make sense. And the temperature variable is ...

View answer
AVR & PIC 8-bit Microcontrollers - Can you add: external flash memory, external RAM, video & audio output, more address busses?
Accepted answer
2 votes

Yes, you can connect external RAM chips through the typical interfaces (mainly SPI or I2C). But you cannot execute code from it. The microcontroller is an IC, meaning Integrated Circuit. It is hard ...

View answer
Calculating SpO2 using pulse sensor
2 votes

For measuring oxygen saturation (SpO2) with a pulse sensor, you need to use the fact, that hemoglobin, that carries oxygen, will reflect in different light wave lengths, as hemoglobin, which doesn't ...

View answer
Making Cases for Projects
Accepted answer
2 votes

Your question has multiple layers: The custom PCB: Breadboards are good for experimenting, but not for a finalized circuit. Depending on some factors you can decide between multiple options. One, ...

View answer
How to use any module that has no library for arduino?
Accepted answer
2 votes

About the fingerprint sensors from mobile phones: You might find the answers to this question useful. They explain in detail, why it is not really worth the effort to try interfacing such a ...

View answer
Is Arduino Mega useing one buffer or multiple buffers?
2 votes

Actually there are 2 buffers per Serial hardware interface: The hardware buffer, that is 1 byte (per direction of data transfer). The Serial library then transfers this byte in an extra buffer (64 ...

View answer
Question about RGB LEDs
Accepted answer
2 votes

Your code is currently written as blocking, so we can leave it that way and add another blocking nested loop. Let's take the colorWipeUP() function as example: void colorWipeUP(byte red, byte green, ...

View answer
24v LED strip with common anode?
Accepted answer
2 votes

Your strip has 2 LEDs with different color temperature directly besides at the same spot for every element of the strip. So the adjusting of the overall color temperature is done by changing the ...

View answer
1
3 4
5
6 7
20