Questions tagged [sketch]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
7k views

Many “expected `)' before ';' token” errors

As the title suggests, I have many "expected `)' before ';' token" errors. The issue is, I have this stuff in. So now I am confused, why am I getting this if the things are there. I am new here and ...
0
votes
3answers
233 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) { ...
1
vote
3answers
985 views

Unintended reaction: Sketch makes LEDs turn on and of randomly/LEDs don't react

Update: This piece of code does not do the same as the one in the right answer, it also reacts when one lets go of the button. int button_prev = 0; int button = 0; void loop(){ button_prev = ...
0
votes
1answer
228 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 ...
1
vote
2answers
301 views

Improvement security in a domotic project

I recently started with a domotic project, I began creating a lock opening with a RFID currently I'm trying improving the code (I took from http://forum.arduino.cc/index.php?topic=256260) but I have ...
-3
votes
2answers
10k views

Break statement terminating loop() [closed]

I am experiencing some very strange behavior with my arduino. I have a switch-case statement in the loop() method, and the break methods are not only breaking out of the case block, but also out of ...
0
votes
1answer
1k 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[...
5
votes
2answers
4k views

Is it possible to run a binary from EEPROM?

Say I wrote a compiled sketch to EEPROM then read it. Could I run the program from EEPROM? I guess the question is: Can an Arduino run software not in flash memory in the middle of executing the ...
1
vote
2answers
2k views

On my lcd my characters collide, how can i remove one(because of the programming)

My code means that when i press a button it displays a word, but by default words are already there and i need to get rid of those default words. #include <LiquidCrystal.h> // initialize the ...
2
votes
3answers
2k views

Wrong data from DS18B20 temperature sensor after long power off

I have my Arduino Uno connected to the PC via USB when prototyping. I am developing a thermometer with memory, using DS18B20 sensors. When PC is shut down, there is no power on the USB and the ...
1
vote
1answer
343 views

LED's won't light up when LCD/RNG hits 2 || 3 of a kind

I am a true beginner here. Trying to build a "slot machine" type game and am in the beginning stages. Found a RNG for LCD code and tweaked it a bit to get three digits to display randomly. Worked just ...
1
vote
4answers
5k views

How to handle multiple input pins at once?

I am relatively new to Arduino platform and not know much. I am working on a Bicycle speedometer with turn and stop indicators. I am planning on connecting an inductor magnet to calculate the ...
2
votes
2answers
2k views

Exoskeleton Motor Control Code

Background: I have been working on an exoskeleton project with a group of friends, and I need help. I made another post on the robotics.stackexchange site for the drive system: https://robotics....
0
votes
3answers
5k 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 = ...
0
votes
1answer
626 views

Unexpected behavior of sprintf with i32/u32

I'm trying to build a string of characters from several elements given by the TinyGPS++ library with the use of sprintf(). This is my code making the string and printing it in the serial monitor. ...
14
votes
2answers
23k views

Asynchronous function calls in Arduino sketch

In an Arduino sketch, is there a way to make asynchronous function calls within the loop? Like listening to requests through http server and process them in a non-blocking way.
4
votes
1answer
2k views

Check contents of buffer after serial read

I would like to test the contents of data received over a serial connection. In my loop() I store the data in bffr; and afterwards I would like to test to see if there are some predefined words in it. ...
6
votes
1answer
3k views

strange behaviour of dtostrf()

I'm trying to program a little bit in Arduino, but I'm stuck with probably something trivial. This is what I have: char ang[3], lat[9]; dtostrf(GPS.angle, 3, 0, ang); dtostrf(GPS.latitude, 9,5, ...
5
votes
1answer
2k views

It is possible to run an entire script on the Linux side? If so, how, what and where to do that?

I am new to using Arduino Yun and I would like to know if it is possible to run an entire script on the Linux side. In my case the script should execute a HTTP request to a remote server, parse the ...
5
votes
1answer
407 views

It is possible to program Linino to send HTTP requests and then use the returned values in sketch?

I am new to using Arduino Yun and I would like to know if it is possible to run a command from the Arduino sketch in order to make (probably, through the Bridge Library) Linino to execute a HTTP ...
2
votes
2answers
4k views

Arduino unable to read from XBee Series 2

An XBee Series 2 is set to Router AT whose TX and RX pins are connected to an Arduino Nano's Rx and Tx pins respectively. The Arduino is connected to a Mac OSX via USB. A second XBee Series 2 is ...
5
votes
5answers
706 views

Should I try to make my sketches as small as possible, even when I have enough room?

There has been a lot of talk about shrinking sketches recently, but if you don't need the room, should it be done? Will it speed up my program? Take this code: int led = 13; int val; void setup() { ...
19
votes
13answers
79k 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
1answer
2k views

Arduino error message that I don't understand

I downloaded Arduino code from this: https://github.com/BabyWrassler/MissionControl/ Github, and got the error message below. It is designed to work with a Raspberry Pi, and I installed the two ...
3
votes
2answers
966 views

How to implement multiple LED modes in a sketch with potentiometers?

My hardware is 4 potentiometers connected to Arduino Analog 0-3, the output is an RGB led driver connected to Digital outputs 9,10,11. The output channels provide access to PWM control of those pins. ...
3
votes
2answers
27k views

sprintf() to assemble String and float pieces locks up

I'm trying to parse many variables into a URL so that I can update a website through a simple HTTP API with sensor data. After talking to a buddy of mine, he suggested going with the code below. ...
2
votes
1answer
852 views

How can I use Python from a sketch?

I'd like to be able to use Python from a sketch. According to the Arduino playground, one can use PySerial from a computer to talk with an Arduino via Python. It looks like from that page you can ...
9
votes
4answers
7k views

How to really shrink a sketch

I want to make a sketch that is as small as possible, for test purposes. The problem is, when i compile the BareMinimum sketch (with an empty setup and loop), i get 466 bytes for the Uno and a ...
17
votes
6answers
11k 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 get get the Arduino to tell me what the error is?
44
votes
5answers
125k 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?