Questions tagged [sketch]

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

Filter by
Sorted by
Tagged with
1
vote
2answers
973 views

Python script to toggle LED's

I have 8 LED's connected to a shift register on my arduino uno r3. I am trying to write a Python3 script that will prompt a user to select one of the LED's and then prompt to toggle on or off. Should ...
1
vote
1answer
4k views

Graph plotting on Processing from Arduino sensor data

I am trying to plot a graph on processing but I'm having challenges going about it. The processing sketch below does work for plotting only one axis, and I'm trying to plot all three axis on the same ...
0
votes
1answer
79 views

Broken Score on Game Sketch

I have modified the code for Flappy Duino to give me a score at the end of the game. Here is the code: #include <SPI.h> #include <Adafruit_GFX.h> #include <Adafruit_PCD8544.h> ...
0
votes
3answers
569 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
2answers
458 views

Sending data from Arduino to the server where arduino (sketch) acts as a client

I want to make simple client-server program where arduino behave as a client. For example I have a LED connected in arduino board that is controlled by a switch. With the switch I can turn off and on ...
0
votes
1answer
426 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 ...
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
907 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
94 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
137 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
93 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
263 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
120 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
87 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
234 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
450 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
807 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
6k 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
142 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
155 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
500 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
10k 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
556 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
173 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
460 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
350 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
234 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
257 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
318 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
615 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
90 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
21k 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
486 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
16k 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
197 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 ...