Stack Exchange Network

Stack Exchange network consists of 174 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.

0
votes
0answers
30 views

How to make Arduino + CAN-BUS as Adapter

Is it possible to make Arduino + CAN-BUS shield as adapter to PC ? Example: I have software "A", which needs CAN data (software gets data itself, and do everything itself). I connect CAN-HIGH, CAN-LOW ...
1
vote
2answers
75 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 ...
0
votes
2answers
49 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 ...
0
votes
1answer
76 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
91 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 ...
0
votes
0answers
66 views

7,5" E-Paper with ESP32 - Avoid flickering

i want to display a static image on my E-Paper display, however, using a stripped-down example sketch from GxEPD, the screen is flashing from time to time - i dont know why and how to stop it, but its ...
0
votes
2answers
50 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
84 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
68 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
37 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
280 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
968 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
62 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
49 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
53 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
91 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
45 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
502 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
91 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 ...
0
votes
0answers
70 views

Several things with delays in millis()

I have several readings from some sensors. The goal is to print them one by one with a delay of 3 sec. It is fairly easy to do, but the problem is that there is a button and if i set those delays with ...
0
votes
1answer
112 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
1k 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
32 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
494 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
83 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
2k 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
168 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
77 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
34 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
534 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
170 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
129 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
294 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
41 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 ...
0
votes
2answers
53 views

Help adding 3 more on/off switches so that I can control 4 LEDs

This code is working fine to switch on/off one LED. Can anyone help me add 3 more on/off buttons so that I can control 4 LEDs? #include <String.h> #include <SPI.h> #include <Ethernet.h&...
0
votes
1answer
158 views

ESP8266 sketch worked a few times but now doesn't seem to run

When I flash my code: /* Create a WiFi access point and provide a web server on it. Author: Lucio A. Rocha Last Update: 21 Aug 2016 */ #include <ESP8266WiFi.h> #include <WiFiClient.h&...
1
vote
3answers
685 views

ESP8266 blink sketch not blinking LED

After flashing the blink sketch to the ESP8266, I removed all the unnecessary wires from flashing - and my setup to try and run the sketch looks like this: Something to note about flashing - it would ...
0
votes
2answers
435 views

ESP8266 Blink sketch - does not blink / or stays constant

I uploaded the Blink sketch (from the ESP8266 examples, in the Arduino IDE) successfully. Depending on which wire configuration I am using two different things happen: wiring 1: CH_PD -> 3.3V ...
-1
votes
1answer
127 views

How to vibrate Adafruit Feather 32u4 Bluefruit LE device? [closed]

I have 11 Adafruit Feather 32u4 Bluefruit LE devices. I want to vibrate my devices using a signal through an app. Is there any signal (Code from app like 0x56-NeoPixel checking, 0x43-clear color) or ...
0
votes
2answers
722 views

Servos: attach() and write()

Arduino newbie here, so this question might sound too simple. I am trying to run a parallax continuous rotation servo using Arduino Uno. From the reference, I learned that the servo needs to be "...
0
votes
2answers
1k views

Problem with uploading my sketch to my Arduino

I chose the correct COM port but it won't upload. Arduino: 1.8.3 (Windows 10), Board: "Arduino Leonardo" Sketch uses 5252 bytes (18%) of program storage space. Maximum is 28672 bytes. Global ...
0
votes
1answer
1k views

How can I update global variable within a loop from outside the loop?

I have this code, but its not working. If I type "ReportFRQ 1" (or 0) it reports back that FrqON variable has changed but the behaviour of the loop doesnt. Basically I am trying to switch parts of the ...
2
votes
3answers
464 views

Constructing my own serial command syntax to control arduino

I know this is a basic question, but as a hardware electronics guy and not a programmer I cannot seem to fathom how to do this - so any examples of code would be greatly appreciated: I want the ...
1
vote
2answers
255 views

send sketch to arduino via wifi

I'm pretty new to arduino and need some help. My task is to connect my UNO R3 to wifi AND then send data (sketch for blinking led) to it. I successfully connected my arduino with my wifi, but how do ...
2
votes
1answer
2k views

A1 was not declared in the scope

I'm trying to put all my settings in a config.h file and then #include it in the Arduino sketch. Here's what my config.h looks like: RobotConfig.h #ifdef BOT //hardware pins int motor1Pin = ...
0
votes
2answers
44 views

How can I set a calculated value when my sketch is uploaded?

I have an Arduino based countdown timer that counts down the number of minutes remaining to an event and displays them on an LCD. Since the event's start time is fixed, I have to re-calculate my ...
1
vote
1answer
136 views

Cannot obtain reading from meter (Modbus)

I have a system in which I am taking readings from a meter and processing it through an Arduino Nano. My code looks as follows: #include <SoftwareSerial.h> #define SerialControl 7 #define ...
-1
votes
1answer
322 views

Any good way to inverse a function? [closed]

I'm guessing that the answer to this is "no," but I'm curious if there is any way to save writing some code by specifying a function to do the opposite of whatever another function does. For example ...
0
votes
1answer
2k views

Is it any way to connect ESP8266 to wifi faster?

I'm uploading this sketch to try connecting ESP to internet. However, most of the times I've ran it it takes a very long time to connect, a lot of times I've had to break the process because it seems ...