Most Popular
1500 questions
11
votes
2 answers
Increase PWM bit resolution
I would like to increase the PWM bit resolution of the Arduino Uno.
At this moment it is 8-bit which I consider too low.
Is this possible without losing the ability of interrupts and delays?
Koen
EDIT
This setup delivers a 16-bit resultion
void…
KoenR
- 177
- 1
- 3
- 11
11
votes
1 answer
How can I communicate Raspberry Pi and Arduino (in both ways) using a 10-15m distance wires?
I am starting a personal project of home automation and I have a raspberry pi and an arduino Uno board.
I want communicate raspberry pi and my arduino where my raspberry should be able to write and read signals to and from arduino.
The distance…
thiagoh
- 211
- 1
- 4
11
votes
1 answer
Extend battery life with a power-controlling microcontroller?
This article describes a method to extend the battery life: use a low-power controller to switch on the Arduino only when needed. The author states that this method uses considerably less power than using Arduino's sleep mode.
Are there downsides to…
tuomassalo
- 351
- 2
- 8
11
votes
4 answers
What is the best way to define an I/O pin?
I read definitions like
const int ledPin = 9;
and also
#define ledPin 9
I know that a definition like
int ledPin = 9;
is a bad practice if you're not going to change it (which you usually won't), though I've see this several times in Arduino…
Joris Groosman
- 1,171
- 3
- 11
- 25
10
votes
1 answer
Writing First Library - Serial Stream Object
I have done quite a few projects with Arduino, but have never done more than a "Hello World" in C. I am writing my first library, and a lot of the object oriented stuff is going over my head. Anyway, my library is working as it is supposed to, I…
ahalekelly
- 285
- 2
- 10
10
votes
1 answer
Emulating 1-wire device(s)
What I want to do is make a ATTiny IC become a slave on the 1-wire bus, with its own S/N and command list for its specific functions.
What I want to know is if I can use the one wire library from the arduino site to send data as a slave.
For…
RSM
- 1,457
- 1
- 11
- 26
10
votes
3 answers
arduino - millis()
Copied from the Arduino reference - millis()
Tip: Note that the parameter for millis is an unsigned long, errors may be generated if a programmer tries to do math with other
datatypes such as ints.
What kind of math? What kind of other type of…
user3060854
- 590
- 4
- 9
- 19
10
votes
2 answers
On an esp8266 what is faster, 64-bit math or float math?
I need to do some math with vars from an attitude sensor (acclerometers and gyroscopes) on an esp8266. int32_t math with those vars does not have enough range and the float math operations are abyssmally slow.
I'm hoping to use a fixed-point format…
mark-hahn
- 277
- 2
- 6
10
votes
4 answers
Is there an Apple Silicon (M1) driver for CH34x devices?
I just migrated to a new computer running on an M1 CPU (the new Apple Silicon, arm64 based). I've been searching for CH34x drivers for my TTGO-Lora32 board, but can't find any around, nor can I find mentions of them existing or not. The x86_64…
finitud
- 240
- 1
- 2
- 9
10
votes
4 answers
How do you handle sensor drift?
I have a pair of potentiometers, on the Arduino, the output seems to drift, by one or 2 digits, back and forth. I would prefer they were read as one fixed value, without variation when their knobs are not turning. You can see in the image, the first…
j0h
- 882
- 4
- 10
- 28
10
votes
1 answer
Why is our refresh rate consistently decreasing in logging on SD card?
The current code is used to gather the state of 12 infrared beams and log them to an SD card using the real time clock to mark the time. The code uses a switch to turn the device on and off and an LED to indicate if data is being written to the SD.…
JClark
- 103
- 5
10
votes
3 answers
Arduino time keeping using millis() is not accurate or correct?
I have been using the Arduino to record some data. In my Arduino sketch I also used the millis() function so I can keep track of the time at which each value I am measuring is taken. However, I noticed that the timing isn't correct. For example 30…
hawkar
- 543
- 2
- 6
- 12
10
votes
4 answers
How to move from arduino to physical prototype
I've been reading a bit about moving from Arduino to PCB and it seems a bit daunting. For now, all I really want to do is take something I've built, and make a few changes so that I can actually create a casing for it and make sure everything stays…
mheavers
- 237
- 6
- 14
10
votes
6 answers
Setting serial number on CH340 USB-Serial device
Reading http://playground.arduino.cc/Linux/Udev there appears to be a way to write out to a FTDI USB-Serial EEPROM to set a given SerialNumber, allowing you to identify a given nano/other arduino to handle it specifically in UDEV.
I have a…
jvc26
- 255
- 1
- 2
- 7
10
votes
5 answers
Efficient algorithm/data structure to calculate moving averages
Currently I am developing a graphic LCD system to display temperatures, flows, voltages, power and energy in a heat pump system. The use of a graphic LCD means that half of my SRAM and ~75% of my flash have been used up by a screen buffer and…
Cybergibbons
- 5,350
- 7
- 33
- 51