Questions tagged [sketch]

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

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

What if Ultrasonic sensor doesn't detect object?

I am trying to write a sketch where a function will only be triggered when the ultrasound doesn't return back. Thus when the echo pin is checked after 1 second after the trigger pin was written high, ...
2
votes
4answers
1k views

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

I am developing an educational product that I would like to mass produce. I am not sure of the quantity yet, but I imagine we will make a few hundred PCBs at least to begin I spoke with an electrical ...
0
votes
1answer
229 views

Details on OV7670

I am thinking of working on a project based on a camera module OV7670. I am making a security system using an arduino where detected motion (I am also using a PIR sensor) will trigger the camera ...
0
votes
1answer
214 views

How to upload Arduino sketches to Atmel chips

I am new in this Arduino coding world and I was trying to make a project. I normally used Arduino Unos all the time, but I was facing a problem and that is that the Arduino Uno has only 13 digital ...
0
votes
1answer
491 views

Arduino compiler uploading last saved version of sketch, not current

Is this an issue or a defined behavior? I am using Arduino IDE 1.6.6 Sometimes I made changes in code, and immediately upload them to the Arduino board. And many times issues already fixed are ...
1
vote
2answers
1k views

uint8_t etc as color variable

I am very new to coding and I am attempting to teach myself the best I can. I have no prior knowledge of coding and am filling in the blanks via YouTube and forums alike. One place I keep getting ...
0
votes
2answers
4k views

Clearing SRAM in loop()

Very broad question here. I don't know exactly what the problem is but I'll edit this post as we narrow down the possibilities. I think I'm running into memory constraints. I'm running a sketch ...
0
votes
1answer
356 views

How to extract the last byte out of an IP adress

Newbie question: I need to pass the last byte of a local IP as a parameter. Eg.: when Ethernet.localIP() returns 192.168.0.100, I need to extract the 100 and put it in a char array or string. Anyone ...
4
votes
4answers
23k views

What is better: one sprintf() or multiple strcat() and itoa()?

I was creating Arduino function which sends two int and additional chars between them and at the beginning and end of char array - then print that array to the serial port in almost real time. (For ...
3
votes
1answer
951 views

What is the Arduino Uno default sketch?

When I bought my Arduino Uno and connected it to my computer, I tried to make the simple blink circuit (before programming the Arduino) and suddenly the LED started blinking. Is the blink example the ...
1
vote
1answer
246 views

Arduino sketch does not repeat

I have a Problem with my code. My Goal is to receive a Ethernet message via UDP and send the message back via CAN. It works fine but only with the first packet I send. When I send the same packet ...
1
vote
2answers
1k 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
81 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
586 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
478 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
439 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
935 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
95 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
143 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
94 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
270 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
121 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
89 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
239 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
455 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
4k 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
858 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
143 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
156 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
537 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
561 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
197 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
471 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
352 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
240 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
262 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
323 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 ...