Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 10794

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

6 votes

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

There are likely to be one of two scenarios: Your sketch was short, in which case you might, after weeks of work, turn the assembler code back into C Your sketch was long, in which case it would be virtually … impossible to turn it back into C In the "short sketch" case, you are better off just rewriting from scratch. …
Nick Gammon's user avatar
  • 38.7k
3 votes

Problem: "stray '#' in program"

From the Instructable you linked: matrix8x8.pde is a program in Processing to build your own displays. You downloaded the Processing code, not the Arduino code. See above that: cube8x8x8.pd …
Nick Gammon's user avatar
  • 38.7k
0 votes
Accepted

compare two hex files

The lines in a typical hex file include a VLI (variable length indicator). The hex files output from the IDE might have different lengths than those produced by avrdude. As a simple example: File 1: …
Nick Gammon's user avatar
  • 38.7k
1 vote

Why is my variable not getting updated?

I modified your code to produce a working example: const unsigned long fiveMinutes = 20 * 1000UL; unsigned long lastCheck = 0 - fiveMinutes; unsigned long now = 0; void setup () { Serial.begin ( …
Nick Gammon's user avatar
  • 38.7k
2 votes

How do nested for loops work?

What you have there is a nested loop. The first for statement runs 8 times, incrementing r from 0 to 7. For each of those 8 iterations the second for statement runs, incrementing c from 0 to 7. Thus t …
Nick Gammon's user avatar
  • 38.7k
1 vote

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

A possibility would be to run a cron job that periodically (say, every minute) updates a .h file with the current commit ID from the branch, and include that in the sketch. …
Nick Gammon's user avatar
  • 38.7k
4 votes
Accepted

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

The simple thing would be for your sketch to read from the serial port continuously. … Or can I somehow detect from within the sketch code that there is a USB connection, and have that trigger the unlock? …
Nick Gammon's user avatar
  • 38.7k
5 votes

What exactly does the Arduino preprocessor do?

In case they are not, here is the first part of that answer: This is how the IDE organizes your "sketch": The main .ino file is the one of the same name as the folder it is in. … A side-effect of all this is that you can consider the main sketch (the .ino files) to be C++ to all intents and purposes. …
Nick Gammon's user avatar
  • 38.7k
2 votes

Existence of a non blocking and task yield framework for Arduino programming

My recommendation would be to simply code without needing blocking. I have examples here. Petri Häkkinen coded a game - Toorum's Quest - without using any real-time library. That game (on a Uno) has …
Nick Gammon's user avatar
  • 38.7k
1 vote
Accepted

TMP36 probe reading 0 on analog

The image on the linked tutorial has the middle pin of the TMP036 going to the analog input, whereas you have it going to 5V, so that is not going to help one bit. In other words, it is wired wrongly …
Nick Gammon's user avatar
  • 38.7k
2 votes

if statement does not work with fraction, but works with decimal equivalent

1/440 will be treated as an integer expression, returning zero. To make it work, make one or both operands a floating-point type. In your case: if(t >= (float)1 / 440){ //Fraction t = 0; } Or: …
Nick Gammon's user avatar
  • 38.7k
9 votes

What's taking up so much RAM in an almost empty sketch?

On this page about putting constant data into program memory I obsessively tracked down every last byte of memory used in a small sketch. … That particular sketch actually used even more RAM: Free memory = 1702 So where did the 346 bytes go? …
Nick Gammon's user avatar
  • 38.7k
0 votes
Accepted

Separate ATmega 2560 - turn on a single LED - troubleshooting

You are saying that the LED lights if you write LOW to it. I need to pull the output pin to LOW to make the LED work That's exactly what you expect. Since the other end of the LED is wired t …
Nick Gammon's user avatar
  • 38.7k
1 vote
Accepted

Take an Arduino or Teensy prototype to Mass production - Loading software onto microcontroller

Also, he said the other option would be to recode my Arduino sketch from scratch using an AVR code. I don't see why that would be necessary, in any way. …
Nick Gammon's user avatar
  • 38.7k
1 vote

AES Simplified for Arduino - Having hard time achieving desired result

We've been trying for some time now from endless conversions to splitting up our plain text into chunks of 16 characters so that we can encrypt the message. To address this question/issue, belo …
Nick Gammon's user avatar
  • 38.7k