Questions tagged [sketch]

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

Filter by
Sorted by
Tagged with
-1
votes
2answers
189 views

My Arduino Code isn't workig… and i just couldn't see any problems… thoughts?

There's Latest Update! So i'm working on a counter just for fun. How it works is when you press BUTTON1 the LED Lights up red, the buzzer beeps and the variable "counter" adds one to itself;...
1
vote
2answers
62 views

(noob) 2 servos for robot (head & chest) movement at different speeds at once

I have an Arduino Uno and two Hi-tec Servos HS-40 & 5055 digital that I'm using for a basic robot build. I'm trying to have 1 servo(HS-40) turn the head back and forth (left to right) slightly ...
0
votes
1answer
1k views

The Arduino Sketch does not save in Arduino folder location

I have just installed Arduino on Mac OS. The Arduino folder is created under Documents. But whenever I save the sketch it gets stored in some ghost location and gives an error, the same name already ...
1
vote
3answers
6k views

Implement Visible Light communication using Arduino

I want to implement a simple VLC based communication system using two Arduinos and send messages/data/files between two PCs. For that I have a simple transmitter circuit with an LED on Tx side and a ...
0
votes
1answer
614 views

Getting error invalid conversion from 'const char*' to 'const uint8_t*

I have written this sketch, and I am trying to populate the array of wifi hotspots to set the value in html select using javascript dynamically. #include <Arduino.h> #include <Hash.h> #...
1
vote
2answers
133 views

How can I upload a sketch remotely from a distant location onto an arduino that is power by a battery

Of course after developing a success full embedded product the next step would be making upgrades to compete favorably with new products in the market. Well making upgrades would require making ...
0
votes
1answer
575 views

Program Nano Every using UPDI port

I have and Arduino Nano and an Arduino Nano Every. I'm doing some experiments and trying to program the Nano Every from the Nano, using the UPDI port. I'm using tutorials like this one that does the ...
54
votes
6answers
174k views

Is there any way to download a sketch from an Arduino?

I made a sketch, but then I lost it. However, I uploaded it to the Arduino before losing it. Is there any way I can get it back?
1
vote
0answers
23 views

I have 2 sketches with same RTC DS1307 but when I combine the 2 sketches it gives errors [duplicate]

I have 2 sketches one is pixel clock with RTC ds 1307 and the other is 7 Segment with DHT 11, I want to merge the two into one but it is giving errors for rtc. sketch for pixel clock #include <Wire....
1
vote
0answers
43 views

Why does the LED state behave differently?

I wanted the sensor to be high when I press the button, but when DigitalRead does low, the LED turns on, when it does high, the LED goes off. Whereas when the digitalRead is high, isn't it supposed to ...
0
votes
1answer
195 views

How should I customize UIPEthernet constants?

I am using UIPEthernet to get an Arduino Nano to drive an ENC28J60 Ethernet Shield for a UDP-based application. I'm customizing a number of its #define parameters to change default settings to save ...
1
vote
0answers
27 views

Http Client requests

I am working on a project where the ESP 8266 sends a very long string about 3000 chas over http as client. Likewise sensor data are determined. The loop repeats itself every 250ms. Now I noticed that ...
1
vote
0answers
30 views

Aurdino EMG sensors and servos?

I'm new here and to the aurdino. I'm building a 3D printed robotic arm controlled by a EMG sensor. I purchased a V3 EMG board and leads on Aliexpress. Here's a list of the things I've purchase for ...
5
votes
3answers
553 views

Using Arduino as a standalone compiler

I mostly program in C/C++ so I conviniently have a GCC compiler for all my compilations. I was wondering if there is a special compiler for Arduino that can be used just like the GCC Compiler? Because ...
1
vote
0answers
44 views

Due examples for using DFPlayer mini

After researching many sketches on interfacing with the DFPlayer Mini, all of them include softwareserial.h which the Due does not use. So are there any example sketches for the Due interfacing with a ...
1
vote
1answer
262 views

I have to reload Sketch every time I start my Yun

I am new to Arduino and IoT. I got my hands on a Yun and loaded a simple sketch to subscribe to a topic. I am receiving messages (I have set up a PHP script and broker on a server, which takes care of ...
1
vote
2answers
11k 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 ...
-1
votes
1answer
504 views

Standard deviation and variance of an array of numbers

Looking for a simple way to get the variance of an array of numbers, that will compile with the Arduino compiler. Something like this c#: static float variance(double []a, int n) { // Compute mean ...
4
votes
1answer
1k 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
1answer
42 views

Ardiuno DUE board. Sketch uploading Error

I am working on Arduino UDE board in Ubuntu 18.04. I've followed following link tutorial. https://www.arduino.cc/en/Guide/ArduinoDue#:~:text=Use%20your%20Arduino%20Due%20on%20the%20Arduino%20Desktop%...
-1
votes
1answer
55 views

How do I fix my code on the Arduino IDE App?

//www.elegoo.com #include <RobotIRremote.h> #define RECV_PIN 12 //Infrared signal receiving pin #define LED 13 //define LED pin #define L 16738455 #define ...
1
vote
1answer
142 views

I want to create 10 levels with one button but this code shows only level 1?

#include <Adafruit_NeoPixel.h> const int PIN = 4; const int NUMPIXELS = 10; const int BUTTONPIN = 6; int buttonState = 0; int PINState = 0; int level = 1; int dt = 100; Adafruit_NeoPixel pixels(...
3
votes
2answers
358 views

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 ...
2
votes
1answer
37 views

Leds become dimmer after they reach a certain brightness, why?

Even if I don't use buttons and I do an automated thing that makes the led brighter(Even the non-rgb one)after sometime it resets itself to a dimmer light, why?* int Gled = 5; int Bled = 6; int Rv; ...
0
votes
1answer
374 views

Can't Upload Sketches to Arduino Nano Every

first-time builder here. I just got my Arduino Nano Every in the mail from Mouser, and I'm trying to upload a modified version of the blink example to my new brand-new board. However, every time I ...
2
votes
1answer
146 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 ...
0
votes
2answers
3k 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. ...
0
votes
1answer
525 views

nRF24L01 - Measuring distance using time elapsed

For school usage, my team and I are working on a wristband that will alert the user if they are too close to another wristband (for social distancing). The problem is measuring distance using radio ...
0
votes
1answer
331 views

Cannot send any UDP packets from ESP8266 Wemos D1

I am attempting to send sensor data from a battery-powered device using UDP. The goal is to send a datagram immediately after the wifi station awakes from sleep then immediately go back to sleep after ...
1
vote
0answers
114 views

How do i efficiently write this code for PS2 controller to USB convertion sketch for Arduino Pro Micro?

I am really new to coding and building stuff, so forgive me if it is anything offensive.i have been trying to convert my PS2 dualshock controller to USB using arduino. there is a library called ps2x ...
-2
votes
2answers
127 views

Use an LDR to run a sketch

This may sound like a simple question but I have tried to find the right solution but all I find is the usual make an led blink and even I can code that nugget I am quite new to programming arduino ...
0
votes
4answers
8k views

DC motor makes noise but does not rotate

i am following Jeremy blum's tutorial on youtube. link i have done the exact same circuit design as he has. but the dc motor just makes a continuous beep sound when i run this code. int motorPin = ...
1
vote
1answer
216 views

Master Reader/Slave Sender with Distance Sensor

I am currently working on a project and want to transmit the information from a distance sensor from one arduino the another, but what i receive in the master board are not the correct measurements. ...
17
votes
6answers
12k views

What happens if there is a runtime error?

What happens if there is a runtime error in a program? Will execution of the program just stop? Is there some way I can get the Arduino to tell me what the error is?
1
vote
2answers
102 views

Bike Gear Indicator Coding Problem

Lack of practice I forgot many function of C & C++... Can anyone help me with this coding Please... I think this is The Main coding: Topic: Gear indicator I first found this, Gear_Indicator_Raw ...
30
votes
12answers
115k views

Arduino Nano uploading gives error: avrdude: stk500_recv(): programmer is not responding

I have a Arduino Nano (Sainsmart) that I'm trying to upload a sketch to. Under the Arduino IDE, the device selected was Arduino Nano w/ ATmega328. However uploading the sketch gives me the error ...
1
vote
3answers
901 views

How can I use my Arduino sketches on my Raspberry Pi IDE?

I have installed the Arduino IDE 2:1.0.5 on my Raspberry Pi3 under Raspbian and am using a cobbler breakout which provides a nice breadboard. On that breadboard I have installed an Arduino Nano to do ...
0
votes
1answer
124 views

Controllino Mega and Fatek HMI

I have a setup that controls the rotation of two stepper motor using Arduino UNO, HBS860H stepper drivers, 4X4 keypad and LCD screen. I have replaced the Arduino Uno by a Controllino Mega and it works ...
1
vote
2answers
61 views

Runtime compilation

I want to compile a sketch on Arduino Uno, while Arduino is running and not connected to anything else, and then run the compiled sketch automatically. Is this feasible? How?
0
votes
1answer
245 views

Im having another problem with my code the error is "redefinition of 'AF_DCMotor motor'? [duplicate]

Heres the code #include <AFMotor.h> AF_DCMotor motor(1, MOTOR12_8KHZ); AF_DCMotor motor(2, MOTOR12_8KHZ); AF_DCMotor motor(3, MOTOR34_1KHZ); void setup() { Serial.begin(9600); Serial....
1
vote
1answer
31 views

Update class attribute with attachInterrupt

I want to refactor this code /* YF‐ S201 Water Flow Sensor Water Flow Sensor output processed to read in litres/hour Adaptation Courtesy: www.hobbytronics.co.uk */ volatile int flow_frequency; // ...
0
votes
1answer
460 views

serial is print twice?

I have a problem , when send 1 or 0 by Bluetooth module the serial monitor print two time (RECEIVED SMS) . what's the wrong ? This is my code : char BluetoothData = 0 ; void setup() { // ...
0
votes
2answers
163 views

Check if the board is in sleep mode

I'm using seep sleep mode with UNO with a simple sketch that turning on an LED and then goes to sleep. as far as the ATmega328p datasheet in sleep mode part showing the wake up sources and deactivated ...
3
votes
7answers
2k views

Include Git tag (or SVN revision) in Arduino sketch?

Is there any way to get the current Git tag/commit identifier into an Arduino sketch binary? For normal desktop program development, you can pull some tricks with the Makefile (as pointed out in this ...
0
votes
1answer
2k views

Using MMA8451 accelerometer to count steps [duplicate]

I'm trying to use an Adafruit MMA8451 accelerometer to create a pedometer-type device that counts steps. I'd like to initiate a counter that says "if the x-axis readout is > some threshold, add 1 to ...
1
vote
0answers
70 views

Arduino Sketch Crashes in working procedure when adding extra call

I am trying to drive a couple of motors to make a car. I successfully wrote some code then tidied it up to procedurise it and it just kept crashing. I've put some debug code in and narrowed it down a ...
0
votes
4answers
8k views

While loop not breaking

I'm trying to build a circuit that buzzes until a button is pressed, or it buzzes 5 times: void alarm() { int AlarmState = 0; //Just to get while loop going int count = 1; while(AlarmState==0) ...
1
vote
1answer
59 views

Help, I want to turn relay constantly on until a difference is detected, but triggered only one instead

Help, I want to use arduino to control relay for electricity, i get data from a sensor and when a value is detected it should be constantly on until another detection triggered again, i can get the ...
1
vote
0answers
159 views

Arduino uno wifi rev2 error compiling sketch to board [duplicate]

I'm having an irritating situation with my Arduino Uno wifi rev2 board. I made an installation with an LCD, keypad and little servo motor. I first wrote the code for my regular Arduino Uno and ...
0
votes
2answers
67 views

NeoMatrix Button Troubles

I am creating a 20x15 LED Matrix using and Arduino Nano. My goal is to switch between different "scenes," if you will, using 4 buttons (I just need to run different code to make it display something ...

1
2 3 4 5 6