Most Popular
1500 questions
7
votes
4 answers
How to add hysteresis to threshold values?
This code compares the analog input value against two thresholds, having three voltage regions. Then it will turn on an LED according to what region the read voltage is in.
The problem is that when the voltage read is very close to the threshold,…
Andy
- 103
- 2
- 2
- 7
7
votes
1 answer
Warning Arduino CMakeLists "Policy CMP0022 is not set: INTERFACE_LINK_LIBRARIES"
I'm trying to build an Arduino example without using its IDE. My OS is Windows 8.1 and I'm using the last version of CMake (2.8.12.2) and MinGW (GNU Make 3.82.90).
I downloaded the Arduino CMakeLists and I learned all about make/upload any firmware…
fenix688
- 173
- 1
- 7
7
votes
4 answers
Optimizing code for ATtiny10
I'm trying to squeeze code onto an ATtiny10, but I'm just not getting there. I'm using 1060 bytes and only have space for 1024 bytes.
The code is simple enough; I need to read a button pin. If high it needs to pick a random value and that causes one…
Earthbound Ruben
- 111
- 4
7
votes
1 answer
Pressure transducer / sensor (0.5 - 4.5V) innacurate analog pin readings
I have a relatively cheap 0-15psi pressure transducer. It has 3 pins - ground 5V and signal. The signal outputs a voltage of 0.5V to 4.5V based on pressure from 0psi to 15psi. I can verify it does respond to significant pressure increases so it…
DominicM
- 597
- 3
- 7
- 13
7
votes
1 answer
How to build (concat) a string with big numbers
new to arduino I'm struggling with what sounds like fairly n00b problem...
I've wired up a adafruit GPS-board to my Arduino and it is working as it spits out GPS data to the serial port with Serial.print(GPS.latitude, DEC)
I Now want to concat a…
stUrb
- 351
- 2
- 5
- 10
7
votes
5 answers
What is the best technique to design a 20 push button circuit
I will be controlling a robot with more than 10 motors which means I'll need 2 buttons each to control moving forward and backward. My controller is an Arduino mega. Is 1 pin = 1 button the best solution here? Or should I use another IC for this?
Julius
- 91
- 1
- 6
7
votes
1 answer
How to use RS-232 sheild as software serial port?
I would like to be able to use a USB port at the same time as an RS-232 port with my Arduino Uno board. I unwittingly bought a shield that (I think?) overrides the USB port when it is mounted to the Arduino…
user_name
- 317
- 1
- 3
- 11
7
votes
6 answers
Is it possible to generate an exact 15 kHz clock pulse using an Arduino?
I want to generate a 15 kHz pulse with an Arduino using Timer1, but the problem is that if we want a 15000 Hz clock we need to initialize the timer with 1/15000 seconds or 66.66 microseconds, but we can only pass integers without any decimal…
astrick
- 93
- 1
- 9
7
votes
2 answers
Can you use Serial Port as a variable?
I am doing a project where, for troubleshooting reasons, I find myself often swapping components to different serial ports. Maybe one time it's in Serial, then in Serial1, maybe I need to try if software serial works.
But changing every line where…
metichi
- 181
- 1
- 4
7
votes
3 answers
Measuring li-ion that arduino is running from
I am using a 5v Arduino pro mini (with regulator and power led removed).
I have been reading how to accurately measure Li-ion batteries when powering from the same battery you are trying to measure from. Using the 1.1V internal analog reference to…
Lindsay Cox
- 103
- 6
7
votes
2 answers
Most power efficient way to constantly save 2 kilobytes of data per second
I would like to constantly save data coming from sensors (for an activity tracker) while consuming as less battery as possible (I'd like to have a 4/5 days autonomy on a 3000 mAh battery) but I can't find the best way to save about 2 kBytes/s on a…
Pop Flamingo
- 335
- 1
- 2
- 8
7
votes
1 answer
What are these stray resistors on the Arduino Mega schematic?
I am using the Arduino Mega schematic found here and it's mostly clear, but there are a few resistors floating in the middle and I'm not quite sure what they're for or where they go:
Does anyone know what these are and where they go?
3ddavies
- 193
- 5
7
votes
1 answer
Include guards vs #pragma once
Is there any particular reason why #pragma once doesn't seem to be used in Arduino code? Is this just because it's not a well-known feature, or is there some overriding reason to use #ifndef XXX_H/#define XXX_H/#endif?
Tim Long
- 305
- 3
- 11
7
votes
2 answers
How to read high voltage (40-65v) from a Solar Battery bank
I would like to monitor the battery voltage of a 48v solar battery system. The expected voltage range is 40-65v.
I have tried creating a voltage divider with 2 resistors but with all values I have tried one resistor almost melts as soon as you…
Joelm
- 73
- 4
7
votes
3 answers
How to allow cross-domain requests on ESP8266WebServer
I am using a Raspberry Pi running Chrome (handling the user interface) and connecting via ajax to an Arduino D1 compatible using the IP address as follows:
$.ajax({
type: "GET",
url: "http://10.1.1.100/myfunc?id=5",
…
Chiwda
- 252
- 1
- 3
- 11