Most Popular

1500 questions
4
votes
1 answer

Why does Arduino round off some integers but not others when my desktop PC does not do this?

I am writing (in C) some low level digit manipulation routines that convert int to float and vice versa for Arduino. I came across some puzzling behaviour with Arduino rounding some numbers but not others. So I located and extracted the offending…
WildCat
  • 323
  • 3
  • 11
4
votes
2 answers

How to move a servo quickly and without delay function

Im trying to move a servo from one place to another while using the typical for loop you find in the servo's library example: int lightON = 180; int lightOFF = 90; for (pos1 = lightOFF; pos1 <= lightON; pos1 += 1) { servo1.write(pos1); …
Marcelo_M
  • 121
  • 1
  • 7
4
votes
0 answers

What’s the most stable digital communication protocol for sewable electronics?

I’ve spent the past few days trying researching communication protocols and I have a few issues. With sewable electronics, you need to work with cables with a fairly high resistance that are constantly moving. That means unreliable and noisy…
4
votes
2 answers

How can I send and receive data from an Arduino MEGA 2560 and Python?

Hello community I am relatively new to the Arduino world and I am facing some issues trying to establish serial communication between the MEGA 2560 and Python using my PC, the desired result is to print the variable 'cnt' after in the code below in…
Badbunny52
  • 41
  • 2
4
votes
1 answer

Does the compiled binary of a sketch include uncalled functions from a library?

I am writing a GUI using a TFT display and the Adafruit GFX library and its default font on Arduino Nano. I want to be memory efficient and I assumed that the 'optimise for size' default setting of the compiler would not compile and include all…
4
votes
1 answer

Help solving "collect2.exe: error: ld returned 1 exit status" error in code

I just got an Elegoo UNO starter kit the other day and have been working my way through the little tutorials on all the parts it came with. I am using VSCode with Platform.io plugin and (after getting it set up) it has been working nicely. The code…
wileyrivers
  • 61
  • 1
  • 1
  • 5
4
votes
1 answer

TFMini Sensors with Arduino

I have three TFMini sensors I need all of them to detect. I only got one to work , pins 4,5 . My info in coding is basic . I really appreciate your help . Thanks in advance. I think the problem is with Library I can't add TFMini_1. Here is my…
Soul
  • 47
  • 2
4
votes
6 answers

What is the most efficient voltage divider for Arduino?

I need to make voltage divider, so I could read a battery voltage up to 14.4 V. Could I use very high resistance resistors for that, so the current would be very low (to not to discharge battery)? On the Internet there are examples with 500 - 2000…
Name
  • 135
  • 2
  • 6
4
votes
2 answers

Can Arduino Sketch be used for production

There are lot of device support with the help of Boards Manager today and is on going in Arduino IDE. So I am curious to know about can one use those for production purpose. Or it is recommended for quick prototyping purposes only...
Next-93
  • 63
  • 3
4
votes
3 answers

Arduino Pro Mini is burned by 12v. Can I save it?

I have this Arduino Pro Mini clone (ATmega328) 5v. I gave it exactly 12 volts through the RAW power input, but it instantly got hot and started fuming. Fumes were coming out of the area close to the black S4 thingy. I don't know why, because I…
Sergio
  • 57
  • 1
  • 3
4
votes
2 answers

Convert Hex to Decimal from signed 2's complement

I am reading data from a meter over dlms protocol and I am getting hex values from there. I want to convert that hex string to signed decimal value. For example - ff9d denotes a value of -99 [reference]. My hex to decimal code is: unsigned int…
Prateek Goyal
  • 175
  • 3
  • 9
4
votes
4 answers

What is the best and most reliable way to detect if a book is pulled out of a book case?

What is the best and most reliable way to detect if a book is pulled out of a book case? I have a book case which I want to mount sensors to so that I can detect when certain books are pulled out, I don't need to know how much, all I need is a…
JensB
  • 151
  • 3
4
votes
1 answer

How to burn the bootloader and upload sketches on ATmega328P U (specifically this model)?

Recently I started to learn embedded electronics and C/C++ and for a couple of days I tried and I am still trying to burn a new ATMega328P U bought from Aliexpress. From what I know new ATMega328P's come with bootloader included, but after I wired…
4
votes
1 answer

Arduino timer interrupts for PID

I'm working on a robotics project where an arduino nano is acting as the motion controller. I'm trying to use a trapezoidal motion profile generator and PID loop to follow that profile, but I found out the motion was quite jerky and I assumed it's…
OM222O
  • 199
  • 1
  • 7
4
votes
1 answer

why is "if" slow?

I am new to the Arduino world and I hope I can find a solution here. The code below functionally works ok. The problem I have is, at line 45 I've inserted an if statement to change dac_value. It is very slow while serial and all that is outside if…
Marius
  • 41
  • 2