Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

-1
votes
0answers
24 views

Smart shopping system project [on hold]

I am doing smart shopping system project. I can added and remove product using RFID in ARDUINO. I need ur help to show all added products in lcd by pressing a push button
0
votes
1answer
39 views

Any idea why my LED fails to operate with the if statement

I have tried several workarounds without success. #include <LiquidCrystal.h> float tempC; int tempPin = 0;// BS E D4 D5 D6 D7 int buzzer = 4; int LED =2; LiquidCrystal lcd(7, 8, 9, 10, 11, 12);...
0
votes
2answers
39 views

Esp8266 Vin pin

I've read that Vin pin is directly connected to usb cable in esp8266 (which is 5V). I wonder if I can power a relay 5V and a servo motor Sg90 with this pin? And is there any danger of doing that ?
1
vote
1answer
21 views

Create a device to detect object and voice alert what kind of object it is [closed]

Here is what I want to do (since I'm not a embedded guy) create a prototype with an Arduino to detect objects using camera(object classification?) that prototype will detect objects and alert that ...
0
votes
0answers
20 views

Serial port not selected [closed]

//TMP36 Pin Variables int sensorPin = 0; //the analog pin the TMP36's Vout (sense) pin is connected to //the resolution is 10 mV / degree centigrade with a //500 ...
1
vote
1answer
18 views

.elf and .hex equivalency? (code, eeprom, fuses, and lock bits all in one)

I have all configurations (eeprom data, fuses, lockbits) of my ATMega168A together with the code in my C files. The compilation creates an elf file that I use as an all-in-one programming file for ...
0
votes
0answers
24 views

Reading a tab-deliminated ASCII text at a 9600 baud rate using serial monitor

hope you are fine . I have a problem with reading the data from a device ( cycle analyst ) it outputs a " tab-deliminated ASCII text at a 9600 baud rate" like first it outputs a header line, and ...
0
votes
0answers
21 views

Can I use an ST-Link to program an STM32F4 through the Arduino IDE?

I have a bunch of boards with STM32F's on them, and they only have JTAG headers. Is there some way to program and/or debug the boards
1
vote
1answer
58 views

How to execute operation once till a condition then restart it from start [closed]

I am making a project using IR sensor,servomotor and Push button. I am not able write code for the logic as stated: it will execute the operation when it reads the digital value of IR high and rotates ...
0
votes
1answer
30 views

Getting different values inside vs. outside a function while using global array

function splitter is designed to get a string of parameters and create a an array of parameters. If only part of parameters were given, the rest of them will get default values. for example : input ...
0
votes
2answers
57 views

How to combine two different sensor sketches to one complete sketch?

How to combine two different sensor sketches to one complete sketch for a complete circuit that attaches to one Arduino Uno? Sharp Dust Sensor int measurePin = A0; // Connect dust sensor to Arduino ...
1
vote
0answers
26 views

Help with app controlled Arduino sensors [closed]

(I'm a beginner in using Arduino and MIT App Inventor) We have this project (an app-controlled aquaponics system) where our group decided to use an app to control the arduino sensors and then show ...
1
vote
2answers
46 views

How do you make a switch case run until another serial input is detected?

I am trying to create a Traffic Light Controller. There are three modes to the controller: Mode 1 - the traffic light operates RED-YELLOW-GREEN-YELLOW and should repeat * (The other modes are not ...
0
votes
0answers
26 views

How to use parameteric function arguments

I have a function defined as follows: void turn_leds_on(int col_indx, int bright_1 = BRIGHTNESS, int del_1 = 5, bool dir_1 = true ) This function is called using MQTT from user to define led's ...
0
votes
1answer
36 views

Serial plotter isn't displaying my supplied data

I want to use serial plotter feature of Arduino by using DHT11 as humidity sensor at a time. But I'm getting problem as plotter is not loading by the code I have. Please help me what is the problem ...
0
votes
0answers
70 views

Can I use ESP8266 and OV7670 to video stream on a web?

OV7670 image sensor, small volume, low operating voltage, providing all functions of a single chip of VGA camera and image processor. so I am using and ESP8266 to connect to internet and stream the ...
0
votes
1answer
48 views

Parsing Data and Comparing two string in arduino

I am working on my final assignment. The problem is I want to make a prototype tool, with 2 string compare. If I send data "OK DISC DISCLOSED: 341513DB689AOK RSSI: -056 OK NAME: CarBT1 OK DISCE" will ...
1
vote
0answers
22 views

Troubleshooting Program using sensors and actuators

I am doing a project on waste management. I have to separate waste majorly as metal, plastic and other materials. For that using Arduino Mega 2560. I have connected Inductive proximity sensor @ A0 (...
0
votes
2answers
39 views

Problem with a code

I have one problem with my code and I'm a beginner and I can't solve it. Can you help me? Thank you so much. I have this problem: error: expected unqualified-id before '{' token And this is my ...
0
votes
0answers
26 views

Serial communication problem NodeMCU

this is my first post here. Before I ask you my problem, I'm sorry if I'm wrong to write but my English is bad. So, my problem is this: I'm developing a "client-server" system with serial ...
0
votes
0answers
42 views

invalid pure specifier (only '= 0' is allowed) before 'int'

#include <PixySPI_SS.h> #include <Pixy.h> #include <Adafruit_MotorShield.h> #define X_CENTER ((PIXY_MAX_X-PIXY_MIN_X)/2) #define Y_CENTER ((PIXY_MAX_Y-PIXY_MIN_Y)...
1
vote
2answers
38 views

Creating an array of structures which store bitmaps to work with u8glib

I've tried reading the documentations and I'm getting desperate because I can't find anything. I need to create an array of structures, which contains a bitmap stored in PROGMEM space (because of ...
0
votes
0answers
20 views

how do i fill an array from a grayscale sensor (SKU:SEN0147)?

I'm designing a safe lock of 4 digits, but the password is in terms of colors, I have 3 colors. we are obliged to use a grayscale sensor (SKU: SEN0147). The assignment is as follows: Write a program ...
0
votes
2answers
72 views

How do I fill an empty array with the values from a sensor and compare it to another given array I filled before

I'm designing a safe lock of 4 digits, but the password is in terms of colors, I have 3 colors. we are obliged to use a grayscale sensor (SKU: SEN0147). The assignment is as follows: Write a program ...
0
votes
1answer
55 views

Arduino stops logging data after ~32761 seconds

I made a small set up to log temperature on SD card, everything is running smoothly until it reach 9:06:01 of logging that is 32761 seconds. I know that corresponds roughly to the maximum value of an ...
1
vote
1answer
45 views

When does a pre/post increment occur? [closed]

Editing here to clarify. The headline asks the question but the example given was not ideal. This was a more general Q than about the example code. Compilers have sequence points, places where you ...
0
votes
0answers
113 views

ESP8266 to send data to thingspeak while doing unblocked read on Serial.readString()

I have a requirement to get RFID data on Arduido UNO and send it to ESP8266 to be sent to ThingSpeak via the Wifi module. However, ESP8266 is also programmed to send Temperature and humidity data to ...
1
vote
1answer
47 views

Printing elements of char array from PROGMEM

Given: const char* PROGMEM names[] = {"Foo","Bar"}; Serial.print(names[0]); I get garbage output. Is there some function that will print the string from PROGMEM? E.G.: Serial.print(<function ...
3
votes
2answers
338 views

How to declare a global variable in the .h file?

I have a .h library file in which I want to declare a global variable that can be read in the program loop and in the library's .cpp file. The question is, is it possible to declare a variable in the ...
0
votes
1answer
61 views

LCD displays an “A” instead of 0

I am trying to make a timer that has a accuracy up to 1 tenth of a second. However when it is suppose to print "0", it will print an "A". For example, when printing "10", it will print "1A". This ...
0
votes
2answers
69 views

Combining code for multiple sensors in a single program [closed]

I need to operate 3 different sensors (taken 6 sensors of each type) by Arduino Mega2560 :- DHT11 (temperature-Humidity sensor) MQ5 (gas sensor) and Soil Moisture sensor {taken 6 of each type (total=...
0
votes
1answer
32 views

Why Would Declaring a Global Variable Change How An Unrelated Conditional is Evaluated?

Here is my entire sketch. This is my first Arduino project. I included all of it because I don't know what's relevant. I am printing out to a 4-digit 7 segment display. To do that I use sprintf to ...
1
vote
0answers
50 views

Ideal voltage level for attachInterrupt()

Well I am working on old textile machines, it is taking motor RPM with ISR. I want to read this RPM and publish on web. but the output voltage of this old system is 0 and 22 Volt. (0 Volt when the ...
0
votes
0answers
48 views

nRF24L01 communication with Arduino as transmitter and Raspberry Pi as receiver

here are the codes and i don't know why it does not communicate. The arduino should send some example data and the raspberry pi should simply receive the data. Transmitter code (Arduino) #include "...
-3
votes
1answer
25 views

How do I turn on/off led with the same IR button? [closed]

I'm trying to make the led switch on/off by the same case(): code. But its not working could anyone help me?
1
vote
2answers
57 views

How to combine strings and text together?

I'm trying to combine two strings (strings/int) together with text in below code: int foo = String((char*)payload).indexOf(' '); int message1; int message2; message1 = String((char*)payload)....
1
vote
1answer
106 views

Does Arduino C++ support dynamic arrays of objects

My C++ is seriously out-of-date, and I'm working on a project that will be juggling multiple timed actions at the same time, with a menu system to manage the interface and control those timed actions (...
1
vote
1answer
40 views

Serial not declared in this scope, newbie mistake most likely

Ok, newguy with a little VBA coding experience going to pull hair out soon. It is probably a simple thing I have missed but I would like someone to point out where I went wrong. I modified a sketch ...
1
vote
2answers
81 views

Need help with the syntax for a function that takes a closure [closed]

My C++ is very out-of-date. (20+ years, before C++ had closures). I'm a senior SW engineer, and I spent several hours yesterday trying to figure this out, but I could not work it out. The background:...
0
votes
1answer
93 views

how can I upload a hex file to an arduino uno?

I have a Rostock Max 3d with an Arduino Uno as the controller. The OEM has a firmware version I would like to upload, but it is in the hex file format. I have looked all over the Arduino IDE, but ...
1
vote
1answer
29 views

Dynamic allocation/ Pointer to Pointer to update an Array containing parameter [closed]

topicArray defined as follows: const char* msgTopic = "Home/Messages"; const char* groupTopic = "Home/All"; char* deviceName = deviceTopic; const char* topicArry[2] = {deviceTopic, groupTopic}; But ...
0
votes
0answers
25 views

Fujitsu FMC-16LX(MB90F387) Pulse Sensor BPM formula displaying only 96BPM

#include "_ffmc16.h" #include "extern.h" #include "monitor.h" void initLCD(); void delay(); void instCtrl4(unsigned char data); void display(unsigned char temp); void display1(unsigned char pulse, ...
0
votes
1answer
55 views

Newbe needing help with fixed string length

im trying to build a bit of test equipment that will talk to some software and it needs to send a fix string. when the voltage changes the string length does as well. i need to cap the results to 4 in ...
0
votes
1answer
59 views

Digispark Attiny85 ultrasonic sensor input problem

I was trying to use ultrasonic with digispark Attiny85 board and used separate pins for trigger and echo, and used MM5451 led controller as a display, I uploaded the code successfully the problem is ...
0
votes
1answer
26 views

servo starts rotating whenever it is plugged

I am making a fish feeder using an Arduino Mega 2560, servo motor SG90 and RTC DS3231. I want to make it rotate twice a day, i.e. morning and 9 o'clock evening. Whenever I plug my Arduino board to ...
0
votes
1answer
47 views

CPU information on Arduino Serial Monitor

how to show the CPU temperature, CPU usage (percentage) and the memory usage(percentage) in Arduino Serial Monitor.
1
vote
4answers
179 views

How to blink led and run another code at same time?

I had written a code to calculate rpm of the motors using IR sensor and Arduino nano and displaying it on OLED . With that I want an LED to blink always. Here is the code what I did: You can skip the ...
0
votes
0answers
34 views

Installing ESP 32 in Arduino IDE

What to do if in Arduino IDE boards manager, installation is stuck at "Downloading tools (3/3). Downloaded 38,190kb of 125,719kb." when installing ESP32 on Arduino IDE? I have not connected the ESP32 ...
0
votes
1answer
39 views

New code results in audio noise

I am working on a circuit that can record audio to an SD when a switch is HIGH and stop recording when the switch is LOW. I am using the TMRpcm library. I previously had an issue solved on these two ...
0
votes
0answers
23 views

error while uploading a code

Arduino: 1.8.5 (Windows 10), Board: "Arduino/Genuino Uno" avrdude: can't open input file C:\Users\PETER_~1\AppData\Local\Temp\arduino_build_223764/nyu_probe_activity1_code.ino.hex: No such file or ...