We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [sketch]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
317 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
185 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
390 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
52 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
64 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
269 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
1k 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
692 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
168 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
2k 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
4k 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
3k 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
787 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
504 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
4k 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
46 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
335 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
536 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 ...
2
votes
1answer
158 views

Arduino Simon Says with Midi Controller

I altered code for the Simple Simon says to work with a Midi controller instead of push buttons. i am having trouble with the input of the song sequence with the Midi Controller. during the time where ...
1
vote
2answers
65 views

When a pushbutton and sensor are in a certain state, do something for a certain period of time (15 seconds)

I have a sketch that contains code for an analog input (FSR sensor), a pushbutton, and 6 blinking LEDs. Currently, the sketch is written to allow the LEDs to blink only when the button is pressed and ...
1
vote
3answers
5k 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 ...
2
votes
1answer
4k views

how to send argument to ESP8266WebServer objects on function

this probably simple thing to do however I can't think of a way to pass argument to function call ESP8266WebServer server ( 80 ); void toggleRelayOne() { char temp[400]; String msg = ""; if (...
1
vote
1answer
427 views

Arduino eeprom_put sketch writes data in two locations?

Using precisely this code - the eeprom_put example in the Arduino IDE, and am seeing some strange results... The sketch does write correctly to eeAddress = 0, and the corresponding eeprom_get sketch ...
0
votes
1answer
74 views

3D printer Arduino sketch

I'm building an automatic warehouse system using 3 nema17 stepper motor. My problem is to move the motors with precision, since I do not have any kind of encoder on the motor and so I cannot know the ...
1
vote
0answers
61 views

Issue regarding executing sketch code when not connected to USB

`I have an Arduino Uno A000066 Board R3 that has an Arduino A000079 Motor Shield Rev3 attached to it. Also I have connected two DC Servo Motors to the Motor Shield and wrote the following sequence: ...
1
vote
2answers
616 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 ...
1
vote
1answer
1k views

'MeDCMotor' does not name a type error inside mBlock

I was using a 3rd party programming enviroment, mBlock 3.4.5 for making C++ Arduino programmes with a graphical programming language. I was compiling a program and the following eroor came up. ...
1
vote
4answers
176 views

Is there a way to keep a program on the Arduino after uploading new sketches?

I am looking for a way to keep a program on my Arduino Nano 3.0, after uploading new sketches on it. I would like to have a program on it that will control th screen and buttons at it. The user will ...
0
votes
3answers
953 views

What is the best board for setting up an SSH protocol to an Arduino?

I currently have a project using an Arduino R3, set up across the room from my computer. This has become quite annoying, as every time I want to push something to the Arduino I have to get up and move ...
0
votes
2answers
1k views

How to run background music while the code for a game is executed

I have some background music. If I put it at the top of the void loop(), it'll first play the music and then execute the game code afterwards. How do I have the code run while the background music ...
-2
votes
2answers
79 views

Building a low voltage disconnect w/ timer - need help with the timer

I'm trying to build almost exactly this device: http://www.reuk.co.uk/wordpress/reuk-shop-low-voltage-disconnects-lvd/buy-reuk-programmable-low-voltage-disconnect-with-display/ It is a low voltage ...
0
votes
1answer
251 views

Typedef Function Pointer Invoking Issue

I'm having an issue trying to use a normal non-member function of my main sketch file as a callback. I can't get the function pointer to invoke from a function other than it was saved. More info ...
1
vote
1answer
81 views

Is there a way to “list” (in BASIC, or “cat” in LINUX) the current sketch loaded in my xxxDUINO? [duplicate]

I was surprised when I couldn't find an old post where someone asked this question. Seems like a natural beginner, uh excuse me, "newbie" question, but then I'm a throw-back to the days when a home ...
0
votes
2answers
103 views

What does the following code in Morse Code Arduino mean?

struct node *root, *currentNode; root = (struct node*)malloc(sizeof(struct node)); root->value = '\0'; root->next = 0; currentNode = root;
1
vote
4answers
1k views

Digital Reading from a array without using the exact element

Is it possible to read a digital input from an array without using the exact element? Such as while(digitalRead(myButtonArray[i])) digitalWrite(myLEDArray[i], HIGH); Reading the ...
0
votes
2answers
6k views

Keypad number input and store

i'm stuck with a little problem. I need to create a program that can store a number via keypad (this number will be chosen by the user) and then do something with it. To be more specific i will create ...
2
votes
1answer
278 views

How to execute commands on Arduino (via PC) without touching the current sketch?

I am working on my first Arduino project. It's a Reverse Geocache. Basically, it's a puzzle where a battery-powered Arduino is mounted inside a locked box, and is able to unlock the box if the user ...
1
vote
2answers
390 views

How to insert into table in database after every 5 minutes using Real time clock module

I have RTC module attached to arduino mega, to calculate time difference of minutes I am getting minute from the RTC module and checking if passed time is greater than 5 minutes then insert to ...
0
votes
2answers
233 views

What do I do about a compiler error “ variable 'font' must be const”

I am trying to run the test program from Adafruit, with their libraries, for an Arduino controlling a Nokia5110 display and get this error message: Arduino: 1.5.8 (Linux), Board: "Arduino Pro or Pro ...
1
vote
1answer
2k views

Using MMA8451 accelerometer to count steps

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 ...
3
votes
2answers
916 views

What programming practices should be adopted while coding sketches for Arduino?

What are some of the best programming practices that can be adopted while coding sketches for Arduino, so that it uses the least memory and performance should not suffer from memory outage, and still ...
3
votes
2answers
42k views

“stray '/302' in program error” when compiling

For some weird reason, the following code doesn't compile. I get a "stray '\302' in program" error around volatile unsigned int encoderPos = 0;, and I have no idea what the issue is. I've been trying ...
0
votes
1answer
155 views

How to extend my Sketch for Multiple Inputs and Outputs

I am using 4 Push Buttons and 4 leds in my project. Here the sketch is only for one push button and one Led. I want extend my sketch upto 4 push buttons and 4 leds .Please tell what changes I make in ...
-1
votes
1answer
941 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
1k views

Trying to get my mega 2560 to work for my 3d printer

Trying to pit marlins v2non this board and it gives me an error and I have no idea what to do Arduino: 1.6.10 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)" Sketch ...
3
votes
2answers
2k views

How can the Arduino check if it is connected to a PC and the PC is on?

I have been searching around the Internet to find if there is a way to check whether an Arduino is connected to a PC or not. For example: if my PC is turned on, the Arduino will listen to any serial ...
0
votes
1answer
101 views

How do I convert a program made on Notepad to my Arduino on Proteus

I had the Arduino IDE but I accidentally deleted it. I have no internet connection, so I could not download it again. I do not currently possess the Arduino hardware itself but I do have Proteus and ...
-1
votes
2answers
195 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 ...
0
votes
1answer
636 views

Arduino programming through HC06

My goal is not upload sketch to Arduino Pro mini through bluetooth module HC06. I have made a breadboard version of DTR signal simulator which takes LED status pin as a source. The output from the ...