Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [sketch]

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

Filter by
Sorted by
Tagged with
2
votes
2answers
1k views

How to program an offbrand arduino uno?

So I recently bought this off brand arduino uno from betemcu.cn. it says its r3 compatible. Can I program this thing with the arduino coder or do I need to use something else? whenever I try ...
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 ...
2
votes
2answers
873 views

Modify SSID and Passwords in WiFi sktechs

This is a question about modifying sketches other than through the IDE. I'm using an Arduino Uno r3 + Arduino WiFi Shield (not the 101). Up to now I've been using the IDE to manually change the ...
2
votes
1answer
93 views

How does this code move the bird sprite in this sketch?

I'm teaching this sketch in my class. I understand most of the sketch and can see the class that makes the bird move, but I still don't quite understand how the code makes the sprite "move." I can ...
0
votes
1answer
130 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 ...
1
vote
3answers
92 views

Arduino code on Raspberry? [closed]

Is there any way to run Arduino sketches on Raspberry Pi (basically on Raspbian)? I have several projects that work on Arduino and I would like to run the exact same stuff on my Raspberry Pi. Is there ...
-1
votes
1answer
258 views

Issue when using Nick Gammon Board Programmer Sketches

Apparently I cannot comment on your answer Matt, only edit my existing post due to my reputation score. Appreciate you input, here is what I can tell you. I am connecting the ICSP from the ...
1
vote
2answers
117 views

How Add Piezo Buzz to Pong Sketch

I am junior high teacher teaching students how to program using Arduino. I know the basics of programing but the students wanted to program a game which is a little above my skill set. I am using the ...
1
vote
2answers
1k views

How do nested for loops work?

In the following code from an Arduino sketch will it run the first "for" statement before enacting the second "for" statement. Also how does it know go run the first stamens again? Will it continue to ...
1
vote
1answer
85 views

Arduino Program uses less RAM then expected and doesn't run

I am trying to make a program for my Arduino that will run 4 motors with random actions (forward,backward,left,right) and execution is determined by a random number generator. When I compile there is ...
0
votes
1answer
219 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 ...
1
vote
2answers
443 views

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

I've been playing around with Arduino and understand that the standard runtime provides a single thread essentially. I was wondering if it is possible to write a thin layer (library) that allows one ...
1
vote
1answer
2k views

Why is my variable not getting updated?

I have the following snippet of code: const unsigned long fiveMinutes = 5 * 60 * 1000UL; unsigned long lastCheck = 0 - fiveMinutes; unsigned long now = 0; void loop() { now = millis(); if ( now -...
3
votes
3answers
7k views

AES Simplified for Arduino - Having hard time achieving desired result

Okay, here's the story. I'm not very familiar with how Arduino works but learning. I have a project that requires AES encryption on the Arduino Uno. As per a previous question we managed to figure out ...
2
votes
2answers
3k views

Empty char variable

How do I empty all the values inside a variable char array[256];? I tried a for loop assigning an empty value at each iteration, but it doesn't compile.
0
votes
1answer
773 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 - ...
2
votes
4answers
5k views

Interrupt fires multiple times

I have a Photo Interrupter which I am using to count the RPM of a motor. I am incrementing an integer to show the amount of interrupts there have been. The issue is that there can be several ...
0
votes
1answer
2k views

Counting revolutions of a DC motor with a Photo Interrupter

I have a DC motor which is rated at 11 200 RPM. I would like to count the actual RPM (it seems to be maybe 1500 RPM from what I can tell manually.) I bought a Photo Interrupter, and have connected ...
-6
votes
1answer
141 views

Two programs in one sketch [closed]

I want to create a sketch for 2 LEDs. The first LED in the first tab and the second in the second tab. I need an example please. Thanks. For more details, I want to make the LVIFA_Base for Labview ...
1
vote
1answer
1k views

Flash a .hex to an ATtiny45 with Arduino

I'm trying to upload a hex file to an ATtiny45 with an Arduino. I uploaded the Arduino ISP sketch to my board. I connected the ATtiny as shown below: Then I go to CMD and type: avrdude -c avrisp -p ...
0
votes
3answers
154 views

Convert a Serial string to a sketch command on Yun?

How can I convert a string like the following: "pinMode(2, INPUT_PULLUP)" or 'Keyboard.print("Hello world")' into actual code that the Arduino can act on?
0
votes
1answer
73 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: ...
1
vote
1answer
461 views

What is Reverse Current through an Arduino?

Can someone explain (in a non-wiki technical way) what reverse current is through an Arduino ? Cheers y'all
1
vote
2answers
9k views

How to read code from Arduino Uno to Arduino IDE? [duplicate]

we can upload a code into Arduino UNO from our computers, but how about reading code? Can we read and get C codes from compiled codes from Arduino hardwares? My second question is that will we read ...
1
vote
1answer
554 views

Got Trouble with ESP8266 and Arduino Yun using REST control

Sorry about my English. I'm a new bie in program Arduino and interested in ESP8266. I'm trying to use ESP8266 control Arduino Yun using REST API. Like you know, we using web browser as http://<...
1
vote
2answers
146 views

How to avoid report of unsuitable sketch names?

I bought a kit of 37 sensors for Arduino, and downloaded all the example sketches. Now, when I try to start up the Arduino IDE I get a lot of frustrating messages like this: ... and I have to ...
0
votes
1answer
445 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: '...
2
votes
3answers
1k views

Arduino error in code

i'm making a project and i came across the follwing error. Whan i'm trying to compile and upload the code i'm getting those errors: ShiftRegisterTest1.ino:In function 'int* return_pins(int)' displays....
1
vote
0answers
349 views

FTDI Cable to bypass USB for Arduino (Blend Micro) Programming

I bought a Blend Micro (an Arduino Micro with Bluetooth) a few months ago, and after my first experimentation with uploading the Blink sketch something went wrong with the USB connection--it would ...
1
vote
1answer
227 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 ...
5
votes
1answer
255 views

How to add the Wiring S board to Arduino IDE v.1.6.2?

My Arduino Uno is running out of memory to support my script (yes, I've tried several ways of optimize it already: PROGMEM, EEPROM, no Strings, and so on), so I would like to upload my script to my ...
2
votes
1answer
1k views

Using A 4 Ohm Speaker With Arduino

I've salvaged a 4 Ohm, 1.5 Watt speaker from an old computer, and I was wondering how I'd go about getting it to work with my Arduino. I've heard of various amplifier circuits such as opamps, but I do ...
1
vote
1answer
304 views

Integrating Shift Registers into 7 Segment LED Circuit

I'm trying to implement a shift register(s) into my circuitry and program to control two seven segment LEDs that would count up from 00 - 99. So far I have a fairly straightforward code (at least, I ...
1
vote
0answers
600 views

My Arduino Robot doesn't move, and it's the only thing that doesn't work

It will be simple. I started to look at the sketch of the Arduino Robot and just tried one, Disco_Bot, and uploaded it one the top board. The Arduino started to play some music and the name was on de ...
0
votes
1answer
85 views

How to upload program to board using Arduino sketch ver 1.6?

I am having problems uploading my program. I have been using the verify button aka the "checkmark" to upload my programs. I assumed that this was the correct button but now I am having problems ...
5
votes
4answers
20k views

How to add hysteresis to threshold values?

This code compares the analog input value against two thresholds, having three voltage regions. Then it will turn on an LED according to what region the read voltage is in. The problem is that when ...
2
votes
2answers
482 views

What do these operators do?

Going through the "timeouts" example of the elapsedMillis library (https://github.com/pfeerick/elapsedMillis) I found the following statement: digitalWrite(LEDPIN, flashPattern[ledIndex++] ? ...
1
vote
3answers
1k views

Programming arduino with Objective-C

Can you use clang, with --mpu=arm, etc. and avrdude to program an Arduino Due (Arm Cortex M3)?
14
votes
7answers
15k views

Loading local libraries

I'm new to Arduino/C development (coming from a JavaScript/Ruby environment), but I was wondering if it was possible to include a library from a custom folder within a sketch? So this is my situation;...
0
votes
2answers
2k 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 ...
1
vote
1answer
3k views

Arduino Ethernet and Uno R3 as a firewall

Is there a way to program the Ethernet Shield and Uno R3 to act as a firewall without using a huge chunk of the allowed bytes on the R3? I plan on using a DC adapter to plug the R3 into a wall, and ...
5
votes
2answers
2k views

Random(min,max) Function only giving ~50 range no matter what the values?

I can't get the min,max range to function properly. Monitoring the serial, only gives out ~50 difference from the min. I then added truerandom.ino to try to fix, but no help. const int ledPin = 13; //...
4
votes
2answers
2k views

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

I wanted to check how much memory (RAM) is used by an "empty" sketch. Here is my code: int freeRam() { extern int __heap_start, *__brkval; int v; return (int) &v - (__brkval == 0 ? (int) ...
0
votes
1answer
194 views

Interrupts don't work

I tried to run a sketch that tests my AVR's interrupts, I have an UNoriginal Arduino Uno, and I've checked pins 2 and 3 like the following: - at void setup() attachInterrupt(2, inter, CHANGE); - at ...
1
vote
1answer
2k views

How to use bitset/read on 16bit numbers (Arduino)

I'm working on an Arduino powered Tetris game. To keep track of the pieces that have fallen and become fixed I have an array of bytes byte theGrid[] = { B00000000, B00000000, B00000000, ...
6
votes
4answers
6k views

ATtiny85 minimum setup to blink led

What would be the (very) minimum schematic to make a ATtiny85 blink a led? Restrictions are: There must be a C program compiled and uploaded to it, just like an Arduino board would have. The code ...
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
153 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); ...
1
vote
0answers
153 views

Sketch not giving feedback as predicted switching from Arduino Uno to Nano

I have a sketch that works just fine on my Arduino Uno board, but somehow mess up, when I try to retrieve data from a Nano Board. I have wired a TCS230 color sensor, to get data about some colours. I ...
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 ...