Questions tagged [programming]

The process of designing and writing source code as part of a program (or sketch) for Arduino. For questions about uploading code to an Arduino board, use the [uploading] tag instead.

Filter by
Sorted by
Tagged with
2
votes
1answer
21 views

RS-485 Serial communication problem with arduino

I use 485 modules to transmit data serially from one arduino uno to another uno. If I connect the 2 arduino boards directly without using the rs485 module, the data is sent and received without a ...
1
vote
1answer
40 views

Bluetooth module(HC 05) issues

I am trying to make a Bluetooth controlled 4WD robot. i was following a tutorial i found online (https://howtomechatronics.com/tutorials/arduino/arduino-robot-car-wireless-control-using-hc-05-...
0
votes
0answers
21 views

Problem burning bootloader to ATMega32U4-MU (is the schematic correct?)

I designed a very simple 4*3 keypad system controlled by an ATMega32U4-MU MCU, using Adafruit's Itsy-bitsy 32U4 as reference (attached is the schematic of my circuit, while Adafruit's circuit can be ...
0
votes
1answer
32 views

Push Button Arduino mega2560 [closed]

My problem I would like to include a push button in my ArduinoMega program by which that I can start/stop the nema 17 motor. That means, I wanted by the first click of push button call the Void ...
2
votes
2answers
56 views

Can the atmega328 return remainder during integer division?

When I write code like this: int a = 7 int b = 2 int c = a/b int r = a%b Does the chip use the remainder while calculating c or does it redo the entire calculation?
1
vote
0answers
22 views

How do I reset to servo position everytime I excecute a particular sequence

I'm trying to make a prosthetic hand that can play rock, paper, scissors with a human. It is based on the premise that you push a button and it randomly selects a move to play. After each move, I'd ...
1
vote
1answer
17 views

AMIS30543 | DataSheet Understanding CIRCULAR TRANSLATOR TABLE

I was reading the data sheet of AMIS-30543 stepper motor and I didn't understand fully what does this Circular Translator Table means, I have a couple of doubts What does Circular Translator table ...
1
vote
1answer
11 views

AMIS30543 | Data-Sheet understanding Status register

I was reading the data Sheet of AMIS-30543 stepper motor driver and I was not able to understand how to combine the result of the Micro step position status register MSP[8:0]. I know that its a 9 bit ...
3
votes
1answer
47 views

How to program Esp8266 remotly via wifi?

I hope it's not a sci-fi for arduino. But I saw that dual system with two MCU can program each other via radio connection. It has been done in experimental space cube projects. It is theoretically ...
1
vote
1answer
59 views

4WD Robot keeps freezing

I have been working on a 4WD robot for a while now. The parts I'm using are Arduino v4 shield, l298N driver motor, Hc 05 ultrasonic sensor, DHT 11, mq2, Bluetooth module, servo motor, ir transmitter ...
1
vote
0answers
103 views

Attiny85 problem [closed]

I am trying to make attiny84 4ch IR relay … in following code … #include <IRremote.h> int RECV_PIN = 0; int RELAY_PIN = 2; IRrecv irrecv(RECV_PIN); decode_results results; // Dumps out the ...
1
vote
1answer
30 views

Sequencing air pistons proble - Help please?

I am a beginner trying to activate 2 sets of 3 air pistons sequentially by going through the YouTube Tutorials... Help, please, pretty please?? :-) There are 3 sets of 2 pistons, each set working in ...
1
vote
0answers
25 views

Clocking issues while programming ATMEGA32U4-AU via USB bootloader

Hi, I'm designing a custom board with the ATMEGA32U4, with a GPS receiver and LoRa radio and it is powered from a LiPo battery. Since I'll need to make hundreds of this board later on, I'd like to ...
0
votes
0answers
41 views

I can't see any readings from my pulsesensor what can I do?

I have been using NodeMcu board for my project with a pulse sensor, DH11 sensor, and temperature sensor. Everything has worked well in spite of the pulse sensor. It doesn't show any readings that ...
1
vote
1answer
228 views

How do i improve this Code? (or how to pass a Char String into a Function to behave like a Variable)

Sorry i am a beginner and amateur when it comes to coding, can somebody help me to make the code inside the loop() less "monkey-like" by using a proper function? I have tried a lot and at ...
0
votes
0answers
30 views

Multiple functions at the same time with Arduino Uno

I would like to make a stepper motor run in for loop in time intervals. I also want to stepper motor run when I press the button. Two functions independently. One does not affect the other. I wrote ...
1
vote
2answers
51 views

Is it possible to send 2 or more o/p signal at the same time?

I wanted run two motors using Cytron MDD10A Dual Channel motor driver. So my concern is based on execution of code that is done line by line, in that case when I'm driving two motors will this delay ...
1
vote
1answer
69 views

Can Arduino UNO permanently store a code?

I'm really new to Arduino and wanted to know if I can make Arduino a permanent controller? and could you help me with a cheaper alternative? I also wanted to know about "fuse", i read it ...
1
vote
1answer
39 views

send configuration commands with arduino

I am using ublox zed F9P multi GNSS module. I have to program it for its configuration messages. Like I have to run a specific configuration of my receiver with the help of Arduino. I know arduino ...
2
votes
1answer
104 views

My motor driver gets stuck in either high or low with a certain speed super randomly. Motor output stops going based on accelerometer input

Running a DC motor(6.5A max input), motor driver (MD10C 7Amp peak output), and arduino Mega. Basically, I am creating a stabilized object based on the accelerometer's input. It works great but all of ...
4
votes
1answer
156 views

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 ...
0
votes
1answer
36 views

Arduino + Codeblocks C++

I'm writing the code for my Arduino board using Code::Blocks editor. When I create a new project, there is AVR Project and Arduino Project under Projects category. Which one do I select?
2
votes
0answers
18 views

Getting atsam3x8e (Arduino Due) to work

I decided to make a pcb based on the atsam3x8e (microcontroller used in Arduino Due). For the design I copied most of the layout that I found on this site and looked at the official Arduino Due ...
1
vote
1answer
67 views

Understanding Debounce code

I don't understand the following Debounce code. (The complete code is at the bottom.) From what I understand, when the pin reads something, we wait at least 50 milliseconds before performing anything. ...
0
votes
2answers
81 views

Is there a way to get about a 10ns Timer resolution from an AVR CPU?

I have an 8Mhz ATM32u4 that is able to read external pulse inputs at 125ns ticks using InputCapture3 (PC7) on its 16-bit timer. Is there a magical way (bitbanging?) to get around 10ns tick resolution ...
2
votes
1answer
71 views

Branchless programing on arduino?

So I've been looking into branchless programming to speed up code and I'm curious as to how exactly Arduino (or rather atmega328) actually reads machine instructions. Does it have a memory cache or ...
1
vote
0answers
47 views

avrdude not in sync

So this uno was working before, now i can't upload anything, can't even burn the bootloader. Using another arduino as isp does not work. It always says avrdude: stk500_recv(): programmer is not ...
1
vote
1answer
72 views

Cannot successfully implement singleton

I have spent the better part of today trying to figure out why I can't get this to work... I have this project where, because of previous design considerations, have implemented a singleton class that ...
3
votes
3answers
154 views

Programming Arduino Uno R3 to trigger a relay once every 24 hours

I programmed Arduino UNO R3 to trigger a relay once every 24 hours from the moment it is powered on I calculated milliseconds and used the function delay() 24 hours * 60 minutes each hour * 60 second ...
2
votes
1answer
58 views

Static ip for esp8266 based on gateway

I'm new to Arduino programming. I want to make my esp8266 get static IP based on gateway. I mean if gateway is 192.168.0.1 then it should get 192.168.0.15 as static IP. And if gateway is 192.168.1.1 ...
1
vote
0answers
50 views

SG 90 servos randomly spinning

I started one project where i need 4 servos to control 4 grabbers jaws. i use STM32F103C8T6 with arduino IDE for programming it. The motor TZT Micro Servo 9g SG 90. First, I was playing with stepper ...
2
votes
4answers
812 views

Arduino Object Oriented Programming

Can anyone send me a link tutorial about Arduino Object Oriented Programming? I want to learn Arduino, I am just a beginner.
1
vote
2answers
60 views

help explain pulseIn function with arduino and Ultrasonic sensor

dears Engineers.. i got stuck with this issue couldn't understand.. please help with explanations. first i was upset of my ultrasonic sensor reading deviations, that is i examine my sensor indoor and ...
1
vote
2answers
102 views

Counter program

I'm an absolute beginner, and lately I had some problem with this program I was trying to do. Basically I wanted with the Arduino to count 3 pulses from an oscillator and store the time of these 3 ...
0
votes
3answers
55 views

What's the most direct way to assign Serial.read() bytes to an array?

I'm trying to send NMEA 0183 sentences through LoRa. Every dinstict NMEA message looks like several char arrays (sentences) followed by '\n'. In the below picture we see one NMEA distinct message: ...
2
votes
1answer
39 views

WebSocket Server for MKR1000

I was looking for a websocket server for my MKR100 but nothing I found looks it works. I tried all the libraries that come with arduino but half of those doesn't compile on MKR1000 and those that did ...
-1
votes
1answer
35 views

Sending data struct with 2 int fields from Arduino to Raspberry via NRF24L01

I'm trying to do wireless thermometer on max31865 arduino and nrf24l01 but I'm having problem sending whole data struct I can send int or char arrays but when I try to send whole struct I got output ...
1
vote
0answers
20 views

Arduino and ZMPT101B But Not Stable Sigma Output In 7segment Display(TM1637) using filter library

#include <Arduino.h> #include <math.h> //TRUE RMS START #include <Filters.h> //Easy library to do the calculations #include <TM1637Display.h> float testFrequency = 100; ...
1
vote
2answers
47 views

How to properly put a u8g2 handle in a class

I'm trying to create a small battery powered alarm clock using an Arduino MKRZero and a generic SH1106-controlled, 128x64 pixel oled. I started out just dumping all code into a single file named Clock....
1
vote
2answers
114 views

Detecting an incoming 7.875 kHz pulse to use as trigger

I have written a code that detects an incoming pulse (square) of 7.875 kHz to trigger the output High for the entire duration of pulse, and trigger the output low if the pulse is off or not detected. ...
1
vote
1answer
45 views

More effecient datalogging code

Background: I am using a Teensy 3.6 to data log over a dozen sensors. I am printing to Serial1 for local Serial access, Serial3 for remote access (via xbee, same data is on Serial1 as on Serail3, just ...
1
vote
1answer
35 views

Please , explain about MAX30100 using for Arduino to read ADC in format (0-1023) [closed]

can anyone help me..? I am using MAX30100 with arduino, and my expectation is i can to process the ADC as usual (0-1023), but I do not understand the signal processing. Has anyone used the MAX30100 ...
1
vote
1answer
40 views

Why is their need of response time needed in esp8266 AT commands?

I am writing an AT commands firmware for esp8266 via connecting it to atmega2560. Now the question is how will I come to know the response time for AT commands for writing its firmware to read the ...
1
vote
1answer
47 views

inconsistent digital output on simple code

so im new on arduino coding, and i made this code, where i input from serial monitor and then use it as a command for digital write. the problem is, sometimes the code work perfectly but then when i ...
0
votes
0answers
103 views

Digispark Atinny85 not recognized (bootloader problem)

I recently bought the Attiny85 (picture below) I managed to install it correctly following the official guides, never that a problem. Drivers are installed correctly, and I used the Arduino IDE to ...
1
vote
2answers
219 views

What exactly does the return type do in a function?

something I've never understood and still don't is, what does the return type do specifically? Everyone in tutorials just say that void returns nothing and int returns int, etc. But what does that ...
0
votes
0answers
24 views

Arduino Due Master Programming

I am newbie. In my application Arduino Due is configured as Master and Arduino Uno as Slave. I need to transfer 24-bit Hexadecimal data of about 79-registers to slave device. At the slave end in ...
0
votes
1answer
61 views

If the code used for Arduino can be embedded into a permanent , callable memory, is there a way to create an OS for Arduino that runs on call?

This thought came into my mind on thinking about smartwatches. Although those I saw on YouTube are really good, they don't seem to provide a real experience of a real smartwatch - one that has an OS ...
0
votes
1answer
53 views

How can I assign the value of a char array to a uint8_t array?

I have a char array variable that has a value. I need to send this value through LoRa. The library I use for the LoRa implementation accepts an array of uint8_t. How can I pass the value of a char[] ...
0
votes
0answers
263 views

esp8266 Arduino error : esptool.FatalError: Failed to write compressed data to flash after seq 1 (result was C100)

i have simple circuit for controlling the dc motor by bjt BC869 like this: and this code: /* ESP8266 Blink by Simon Peter Blink the blue LED on the ESP-01 module This example code is in the ...

1
2 3 4 5
31