We changed our privacy policy. Read more.

Questions tagged [sketch]

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

Filter by
Sorted by
Tagged with
0
votes
3answers
687 views

TMP36 probe reading 0 on analog

I've designed this system which is supposed to turn on the LEDs when the temperature of a particular probe exceeds 32 degrees. From what I can tell, this should be functional but the analog sensor is ...
0
votes
1answer
1k views

Difference in bootloader of ATmega with 16MHz external crystal and 8MHz external crystal

I have used your bootloader for ATmega2560-16AU with 16MHz external crystal and it works like a wonder. In my new project I have a 3V power supply. Therefore, I am planning to use a low frequency ...
0
votes
1answer
151 views

Help with Flappy Bird Sketch

I am compiling the sketch found here. I just downloaded the .ino and .h files and opened them, so I have not modded the code at all. I keep getting the following error. In file included from ...
0
votes
1answer
257 views

Arduino LED lighting up when signal is reading low on multimeter

My code is designed to play a tone when ever pin 3 is high on my Arduino. When I am examine the pins voltage with a multimeter it is always reading below 1 volt. When I examined the voltage off of a ...
0
votes
1answer
505 views

Arduino serial informations

Is it possible to change serial information of arduinos board ? For example I have an arduino uno with this serial informations : { comName: '/dev/cu.usbmodem1411', manufacturer: '...
0
votes
2answers
3k views

Program button to switch between two values

There is a function on one of my programs I want to be switch on and off by pressing a button. The button is unbiased otherwise I would set the function to read the button's status of HIGH or LOW. So ...
0
votes
1answer
157 views

Lily Pad mp3, nested loops with timing and play randomly choosen mp3, coding problem

The best way to explain my problem is in form of code... const int ringerPin = A0; const int offhook = A4; const int onhook = A5; void setup(){ pinMode(ringerPin, OUTPUT); ...
0
votes
1answer
4k views

Sending Serial Hex Command from Pin 1 (Tx) [closed]

Using Arduino Uno with 3.5mm Jack connected to ground and pin 1 for TX Need to send two commands I want to send 0XAA13FE010113 for Mute on, and 0XAA13FE010012 for Mute off. Simple Serial Command ...
0
votes
3answers
246 views

Debouncing results in no reaction at all

Update: I changed the code to this, but it does not work either. `if ((millis() - lastDebounceTime) > debounceDelay) { if (button) { //DEBOUNCING if (!button_prev && button) { ...
0
votes
1answer
231 views

Cant's code against Yun Wireless Section

Just got my Yun today. Successfully connected to my home wireless, installed YunSysUpgrade_v1.5.1, and divied up my Micro SD card for Linino and Windows file system with YunDiskSpaceExpander, and ...
0
votes
1answer
2k views

Wrong Mouse.move() output in Arduino Leonardo

I'm using my Arduino Leonardo as a Mouse but I'm experimenting a strange behaviour. I put my mouse at (-1, -1) (absolute) coordinates and then I execute this code: Move.move(com[curr_cmd_id].x, com[...
0
votes
1answer
368 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 ...
0
votes
1answer
734 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> #...
0
votes
1answer
168 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
170 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 ...
0
votes
1answer
5k 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
1answer
147 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
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
2answers
6k 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
189 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 - ...
0
votes
2answers
82 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
337 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&...
0
votes
2answers
3k 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
1answer
6k 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 ...
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 ...
0
votes
1answer
3k views

Reading an MCP23S17 I/O expander port with the Arduino SPI library

I am trying to read an MCP23S17 I/O expander port B with the Arduino SPI library. The following example is simple as possible, and I still can not get it to work. The setup is an MCP23S17 I/O ...
0
votes
1answer
169 views

Does serial communication between PC and Arduino has to be in a loop?

I am trying to send a few variables from my python script to my Arduino. I am using pySerial. I am able to send the variables to the Arduino, but my Arduino sketch runs only for a second and then ...
0
votes
1answer
25 views

Sketch not running as expected

I wrote this sketch along with an HC - SR 04 Ultrasonic transducer and a DC motor. Whenever the HC-SR 04 reads any distance less than 15 cm, the motor stops, otherwise it keeps running. The problem ...
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) ...
0
votes
1answer
95 views

Stuck on uploading sketch via USB 6 pin

I'm just got a Galileo Gen2 and wanted to try a simple blinking-led. The firmware have been updated to 1.0.4. My problem is whenever I try to upload the code I get this error: Sketch uses 83,775 ...
0
votes
2answers
4k views

Using Rx and Tx pins(0 and 1) on Arduino Uno for GSM

I am using a GSM module sim800. My module responds to the output given by my PIR sensor and sends sms according to it. My module has got +5V, GND, Rx and Tx pins. What are the pin connections that I ...
0
votes
1answer
475 views

Sketch upload freezes during write

I'm trying to upload a huge sketch to my Uno R2. It's compiling just fine but it fails to upload at 94% of writing to flash... The program is so large because of a big array of data in a separate .h ...
0
votes
1answer
1k views

seperate ATmega 2560 - turn on a single LED - troubleshooting

I have got my own PCB with "some stuff" on it and first I want to make it run a simple "turn on LED". My setup: Atmega 2560 LED connected to PE4 (D2 in Arduino language) => PE4 - LED - 1K resistor - ...
0
votes
1answer
75 views

Transmitting sketches to Yun with Autobahn - a byte at a time?

I am using this tutorial to connect an Arduino Yun with a browser using Autobahn. In the python file in the above repo, there is this code: def controlLed(self, turnOn): if turnOn: ...
0
votes
1answer
2k views

Unable to load sketch: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x41

I've stumbled upon what I've later found it's quite common error, but there seems not to be simple troubleshooting way and solution (people often try various things, sometimes they succeed, sometimes ...
-1
votes
1answer
177 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 ...
-1
votes
1answer
861 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 ...
-1
votes
1answer
86 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 ...
-1
votes
1answer
909 views

Arduino UNO suddenly stops responding

I wrote this simple script to control a servo over serial comm - #include <Servo.h> Servo steeringServo; char data = ' '; void setup() { steeringServo.attach(9); Serial.begin(115200); } ...
-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
votes
1answer
567 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 ...
-1
votes
1answer
431 views

Is low memory warning based on a fixed number of on the actual sketch?

I have the following output of my sketch for the Arduino Mega so far: Sketch uses 25020 bytes (9%) of program storage space. Maximum is 253952 bytes. Global variables use 6919 bytes (84%) of dynamic ...
-1
votes
3answers
2k 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
votes
1answer
4k 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
2answers
252 views

Delay In receiving data when SoftPWMBegin(); is used from SoftPWM.h library

when i use SoftPWMBegin() function in setup there is some delay while receiving data over bluetooth. And if i pressed o and 1 fastly (see in below given code), some time it receives data and sometime ...
-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
votes
1answer
453 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 ...
-1
votes
1answer
135 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 ...
-2
votes
1answer
11k views

Problem: "stray '#' in program" [closed]

I got a sketch from the internet (http://www.instructables.com/id/How-to-build-an-8x8x8-LED-cube-and-control-it-with/) for controlling the display of an 8x8x8 LED cube. The program won't compile and ...
-2
votes
2answers
128 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 ...