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 [sketch]

A sketch is compiled code that is uploaded to an Arduino board.

-1
votes
0answers
14 views

How can we take readings from two sensors in arduino one after the other on an LCD with a short delay? [duplicate]

I have two sensors DHT11 (Temperature and Humidity sensor) and a SW-420 (Vibration sensor), I want both the sensors working simultaneously and I want them to display readings on a LCD with some delay. ...
0
votes
1answer
34 views

Please help me combine the two codes for DHT11 and SW-420 Vibration sensor for arduino in one program

The following is the code used for DHT11 Temperature and Humidity sensor: #include <LiquidCrystal.h> LiquidCrystal lcd(4, 5, 0, 1, 2, 3); byte degree_symbol[8] = { ...
0
votes
1answer
22 views

How Programing the nodeMCU Through OTA using GPRS?

How Programming the nodeMCU Through OTA using GPRS? Hi Everyone I need big help. Actually, I m using NodemCU one of my project. the setup in Remote location, that place dont have a wifi option so I ...
2
votes
3answers
461 views

What is wrong with my code? RGB potentiometer

Arduino programming has been a huge learning curve for me and I am trying to create a project with an rgb that's color is determined by a potentiometer. To where the further I turn it, the further ...
0
votes
1answer
30 views

Help with coding Arduino Nano to run fan through slide switch at specific intervals

I’m trying to use Arduino Nano to run my 5 V PC fan, which, I know it sounds crazy, it’ll be mounted on a piece of Tupperware that’ll control the airflow through it via the fan. However I have no ...
0
votes
1answer
127 views

Arduino Nano 3.0 CH340G clone cannot upload sketch from Arduino IDE [duplicate]

I connected my brand new Arduino Nano 3.0 clone with CH340G and installed the drivers. It detects in Device Manager as USB-SERIAL CH340 (COM6). Under the Tools menu, i selected the correct board, the ...
0
votes
2answers
44 views

Interrupt triggering using DHT-11

I am new at arduino. I want to write a sketch that would print the message if the temperature grows greater than 30 C. Here is my sketch can you please tell me what's wrong with it #include "DHT.h" #...
0
votes
1answer
59 views

millis() replace delay() question

// each "event" (LED) gets their own tracking variable unsigned long previousMillisLED12=0; unsigned long previousMillisLED13=0; unsigned long previousMillisLED3=0; // different intervals for each ...
0
votes
1answer
55 views

Please explain the void loop() section of the sketch

#include <VirtualWire.h> int PWMB = 5; //Speed control void setup(){ Serial.begin(9600); //receiver setup vw_set_rx_pin(2); vw_set_ptt_inverted(true); vw_setup(2000); ...
0
votes
1answer
58 views

please explain the sketch attached

Sorry about a newbie. 1. what mening of: if(Xstr[XstrLength-1] != '|'){ Xstr[XstrLength] = '|'; Xstr[XstrLength+1] = '\0'; the setup: char Xstr[60]; what means? and then: itoa(Yint,...
1
vote
1answer
70 views

Arduino New Optiboot Bootloader on custom ATMega328p board, ATMEL Studio and AVRdude [closed]

I am about to ask a kind of complex question due to the number of system parts involved and the system architecture I am planning to use. First of all I have a tiny bit of experience with the Arduino ...
0
votes
1answer
103 views

The sketch burned two H Bridges, need help to find out how to modify

This is Arduino RC control car, the sketch tested good in a small motor, but burned two 60A drivers when put into 24V,500W motors, need help to find out whats wrong? #include <VirtualWire.h> //...
0
votes
0answers
12 views

Problem with uploading sketch [duplicate]

Arduino: 1.8.9 Hourly Build 2019/02/04 10:12 (Mac OS X), Board: "Arduino/Genuino Uno" Sketch uses 2078 bytes (6%) of program storage space. Maximum is 32256 bytes. Global variables use 189 bytes (9%) ...
0
votes
1answer
38 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 ...
0
votes
1answer
85 views

LCD shows output without pressing the sensor

#include<LiquidCrystal.h> LiquidCrystal lcd(13,12,11,10,9,8); #define vibrate_sense 7 char str[70]; char *test="$GPGGA"; char logitude[10]; char latitude[10]; int i,j,k; int temp; //int ...
0
votes
0answers
126 views

Ethernet Shield - Not Working Properly Always

I'm working on a school project and using Arduino Uno. The basic working method for the project is as follows: Read temperature from LM-35. Read CO2 level in air using MH-Z14A. Upload data to server ...
1
vote
1answer
66 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
1answer
41 views

What is the easiest way to count how many global variables are in your sketch code?

I have a fairly complicated sketch with about 1k lines of code. I should also say that I'm not a programmer by trade... As I go over my code and try to make it more efficient, it'd be good to know ...
1
vote
2answers
97 views

What exactly does the Arduino preprocessor do?

Arduino claims to be a "language," not just an "application framework," and Arduino files have their own extension, .ino. The language is obviously C++, but not quite. My understanding is that ...
-1
votes
3answers
119 views

Is there an open source compiler for Arduino Sketch codes?

I am working on a web app to program some nodeMCU devices that were flashed with the arduinoOTA library. http://esp8266.github.io/Arduino/versions/2.0.0/doc/ota_updates/ota_updates.html I tried the ...
1
vote
1answer
95 views

Will this sketch eventually fail because of integer limit issue?

I am a novice in Arduino programming and I'm setting up an Arduino controlled, underwater time-lapse camera to take a picture every 2 hours. It's going in the ocean for a month and I want to be sure ...
1
vote
0answers
407 views

Unable to upload sketch using Platformio (but Arduino IDE works)

I am using an Arduino Nano (Clone) which I was programming with the Arduino IDE (Version 1.8.5 on Mac OS X 10.10.5). Using the Arduino IDE I need to re-plug the Nano before uploading, but after doing ...
1
vote
2answers
59 views

Detecting Ultrasonic sensor malfunction within the arduino sketch [closed]

Is it possible to write code in the sketch that checks the functioning of the ultrasonic sensor? Say if the sensor stopped working then the arduino will alert the user in the serial monitor.
0
votes
2answers
104 views

Run piece of code based on a feature

I am an engineering student completely new at using Arduino so my following question might be silly but still. I do not think you'll need to get the entire code so I am only going to expose the idea. ...
1
vote
1answer
115 views

How arduino boards eliminate the need to press buttons to flash?

I've come across many Arduino shields for various boards like the Uno, ESP8266, and ESP32 which sometimes have a button for flashing and other times they do not because the flashing is automatic. ...
1
vote
1answer
43 views

Can I call functions from a different sketch? [closed]

I am a beginner at programming with Arduino and I am unsure on how can I call functions (such as, getData()) for the touchscreen LCD to display that data. The purpose of my device would be to listen ...
0
votes
1answer
2k views

Control multiple LEDs with multiple buttons

Problem 1: LED1 needs to be on only when button1 is held down. Right now it takes several presses to turn on and off and stays on. Problem 1: LEDs 2,3,4 do not turn off with buttons 2,3,4. They are ...
0
votes
0answers
2k views

IOT-GA6 gsm module Arduino +CME error 58

I've recently bought a IOT-GA6 gsm module . I want to use it to send an mms but doesn't work. The SMS and call work. When I execute the void function (mms) the monitor shows the error message +CME ...
-1
votes
1answer
72 views

How to change the value within a variable using math? [closed]

I'm up to Lesson 11 in the TopTechBoy tutorial: https://www.youtube.com/watch?v=afurKLOqqSg Lesson 11 : http://www.toptechboy.com/arduino/lesson-11-arduino-circuit-to-dim-led-with-potentiometer/ I ...
0
votes
1answer
71 views

compare two hex files

I need to check if the code burned on the some Arduino is the same one as I have. I know how to get the hex file from the Arduino. My question is what influence the hex code? Board Type? ...
0
votes
0answers
22 views

Sending sketches from visual studio? [duplicate]

Can anyone tell me if it is possible to send a sketch to Arduino directly from Visual Studio?
0
votes
1answer
59 views

Should I use a loop instead of an If statement?

I have a simple sketch that tests input from 2 touch sensors and outputs to 2 relays (if a sensor is touched, trigger the respective momentary relay). It has been a bit quirky to say the least. ...
0
votes
1answer
123 views

How to upload sketch from flash memory of nodemcu-V1.0?

I'm working with esp8266 nodemcu-v1.0 .Now we are using OTA but the module may be disconnected from wifi so we need to use 2G by GSM Module(using beside nodemcu) to receive our new sketch to be ...
2
votes
3answers
55 views

Set variable value with serial?

so I need to make a arduino program, generates 2 random numbers, makes a + calculation with them and asks user the right answer. If the answer is right AKA Calculation==User Answer, then led is set to ...
0
votes
2answers
1k views

Uploading sketch problem

I just plugged my arduino and click upload, it shows this error: Arduino: 1.8.5 (Windows 7), Board: "Arduino/Genuino Uno" Sketch uses 948 bytes (2%) of program storage space. Maximum is 32256 bytes. ...
1
vote
2answers
196 views

Is checking an if statement every loop/while iteration inefficient?

I have code that changes a bool only time in the setup(), and in my loop() I have if (setupBool) { // ... } else { // ... } Is checking the bool every loop slower than having a while(true) with the ...
1
vote
1answer
220 views

When I turn on the servo it spins on its own before going to the right position and start the sketch

I can't get my head around this: when I turn the servo on it just spins on its own as if it's setting up, it goes to an angle superior to the one I want it to go. (Don't mind if it has to set up but ...
3
votes
2answers
3k views

ino.hex vs ino.with_bootloader.hex

I'm working on a Android App able to update the content of my Arduinos. Start to work (reset the Arduino, communicate with STK500 protocol, get id of ATmega and so on). But I face a question about the ...
0
votes
1answer
36 views

List of sketches disappears off the bottom of my screen

v 2:1.0.5 The list of sketches disappears off the bottom of my screen and there is no scroll to reach them. This renders the IDE nearly useless. Is there a solution?
0
votes
2answers
849 views

What's the difference between DDRB and pinMode?

It's my understanding that the following lines are equivalent. They seem to be interchangeable in my sketch: DDRB = 1<<DDB0; and pinMode(0, OUTPUT); Is the first form (DDRB...) setting a ...
0
votes
1answer
136 views

Need to set a FAILSAFE in an if else loop

This works but I would like to have a timed failsafe... If the FLOAT_PIN goes LOW for more than 3 seconds, it will turn SOLENOID_PIN to LOW. I can't figure out how to incorporate it into my loop. I ...
0
votes
2answers
3k views

Unable to use Keyboard library with Arduino UNO even after changing the firmware

So I'm trying to use my UNO as an HID device. I followed this tutorial, flashed the firmware and got the UNO to be detected as an HID device. However, I am still getting the error 'Keyboard' not ...
0
votes
1answer
297 views

Code is not working (Matrix keypad) [closed]

I am new to Arduino. I am learning from Arduino Cookbook. I was using tinkercad.com for running my Arduino code. But it is not working. The Serial monitor should show the key which I have pressed on ...
0
votes
1answer
94 views

ESP8266 only executes Sketch after switching on/off CH_PD pin

I started a new project with an ESP8266-01 module. I want to use it as stand-alone circuit to send an Email at the press of a button. The wiring is: VCC - 3.3v VCC CH_PD - 3.3v VCC GND - ...
-1
votes
1answer
39 views

No data in text file [closed]

Data can be seen in the console but the data is not being written in the text file. The file is created but there is no data in it. Here is my code in Processing, import processing.serial.*; Serial ...
0
votes
1answer
986 views

Arduino Sketch: NodeMCU compilation error

Every time I try to compile a program written in Arduino IDE 1.8.5 for NodeMCU (LoLIN version v3), I get the following error: Arduino: 1.8.5 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz,...
1
vote
1answer
276 views

Trying to connect a 1.3" IIC OLED display to an Arduino M0 board (not Uno)

I'm trying to connect an OLED display to the Arduino M0. I got the code example (ssd1306_128x64_i2c) from the Adafruit SSD1306 library I downloaded. Video showing at 8:14 how it should look However, ...
0
votes
1answer
170 views

Auto Fish Feeder

Good day, I am new to Arduino, but have made some nice projects work. I have a n issue with a Auto fish feeder. I have used a servo that I modified to run 360. I am having a issue when the Nano board ...
-1
votes
1answer
359 views

MKR FOx 1200 doesn't upload Sketch

My Arduino MKR Fox 1200 doesn't upload any sketches. First it worked, but now it doesn't. It compiles the bare minimum sketch (empty loop and empty setup) but then uploads forever and after a long ...
0
votes
1answer
46 views

Help! My motors are not working!

I have made a project using Arduino, 3 LDRs and a L293D motor driver shield. My project was that when I block light from the first LDR, the motor will spin. When I block light from the second LDR, the ...