Questions tagged [sketch]

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

Filter by
Sorted by
Tagged with
1
vote
2answers
2k 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 ...
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
2k 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 ...
1
vote
1answer
349 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
1answer
143 views

I want to create 10 levels with one button but this code shows only level 1?

#include <Adafruit_NeoPixel.h> const int PIN = 4; const int NUMPIXELS = 10; const int BUTTONPIN = 6; int buttonState = 0; int PINState = 0; int level = 1; int dt = 100; Adafruit_NeoPixel pixels(...
1
vote
1answer
244 views

Master Reader/Slave Sender with Distance Sensor

I am currently working on a project and want to transmit the information from a distance sensor from one arduino the another, but what i receive in the master board are not the correct measurements. ...
1
vote
2answers
65 views

Runtime compilation

I want to compile a sketch on Arduino Uno, while Arduino is running and not connected to anything else, and then run the compiled sketch automatically. Is this feasible? How?
1
vote
1answer
33 views

Update class attribute with attachInterrupt

I want to refactor this code /* YF‐ S201 Water Flow Sensor Water Flow Sensor output processed to read in litres/hour Adaptation Courtesy: www.hobbytronics.co.uk */ volatile int flow_frequency; // ...
1
vote
1answer
64 views

Help, I want to turn relay constantly on until a difference is detected, but triggered only one instead

Help, I want to use arduino to control relay for electricity, i get data from a sensor and when a value is detected it should be constantly on until another detection triggered again, i can get the ...
1
vote
2answers
136 views

How can I upload a sketch remotely from a distant location onto an arduino that is power by a battery

Of course after developing a success full embedded product the next step would be making upgrades to compete favorably with new products in the market. Well making upgrades would require making ...
1
vote
1answer
1k views

How Programing the nodeMCU Through OTA using GPRS?

How Programming the nodeMCU Through OTA using GPRS? Hi Everyone I need big help. Actually, I m using NodemCU one of my project. the setup in Remote location, that place dont have a wifi option so I ...
1
vote
1answer
2k views

Arduino Nano 3.0 CH340G clone cannot upload sketch from Arduino IDE [duplicate]

I connected my brand new Arduino Nano 3.0 clone with CH340G and installed the drivers. It detects in Device Manager as USB-SERIAL CH340 (COM6). Under the Tools menu, i selected the correct board, the ...
1
vote
1answer
105 views

Can I call functions from a different sketch? [closed]

I am a beginner at programming with Arduino and I am unsure on how can I call functions (such as, getData()) for the touchscreen LCD to display that data. The purpose of my device would be to listen ...
1
vote
1answer
646 views

When I turn on the servo it spins on its own before going to the right position and start the sketch

I can't get my head around this: when I turn the servo on it just spins on its own as if it's setting up, it goes to an angle superior to the one I want it to go. (Don't mind if it has to set up but ...
1
vote
1answer
46 views

List of sketches disappears off the bottom of my screen

v 2:1.0.5 The list of sketches disappears off the bottom of my screen and there is no scroll to reach them. This renders the IDE nearly useless. Is there a solution?
1
vote
1answer
316 views

Need to set a FAILSAFE in an if else loop

This works but I would like to have a timed failsafe... If the FLOAT_PIN goes LOW for more than 3 seconds, it will turn SOLENOID_PIN to LOW. I can't figure out how to incorporate it into my loop. I ...
1
vote
2answers
12k views

Problem with uploading my sketch to my Arduino

I chose the correct COM port but it won't upload. Arduino: 1.8.3 (Windows 10), Board: "Arduino Leonardo" Sketch uses 5252 bytes (18%) of program storage space. Maximum is 28672 bytes. Global ...
1
vote
1answer
383 views

Cannot obtain reading from meter (Modbus)

I have a system in which I am taking readings from a meter and processing it through an Arduino Nano. My code looks as follows: #include <SoftwareSerial.h> #define SerialControl 7 #define ...
1
vote
2answers
69 views

When a pushbutton and sensor are in a certain state, do something for a certain period of time (15 seconds)

I have a sketch that contains code for an analog input (FSR sensor), a pushbutton, and 6 blinking LEDs. Currently, the sketch is written to allow the LEDs to blink only when the button is pressed and ...
1
vote
3answers
908 views

How can I use my Arduino sketches on my Raspberry Pi IDE?

I have installed the Arduino IDE 2:1.0.5 on my Raspberry Pi3 under Raspbian and am using a cobbler breakout which provides a nice breadboard. On that breadboard I have installed an Arduino Nano to do ...
1
vote
1answer
1k views

'MeDCMotor' does not name a type error inside mBlock

I was using a 3rd party programming enviroment, mBlock 3.4.5 for making C++ Arduino programmes with a graphical programming language. I was compiling a program and the following eroor came up. ...
1
vote
4answers
2k views

Digital Reading from a array without using the exact element

Is it possible to read a digital input from an array without using the exact element? Such as while(digitalRead(myButtonArray[i])) digitalWrite(myLEDArray[i], HIGH); Reading the ...
1
vote
2answers
127 views

Can you pass params to an arduino sketch?

I was wondering if there is a way to pass parameters to an arduino sketch at the upload step. Edit: The reason this would be helpful is because I have a bunch of esp8266 units that need to have ...
1
vote
1answer
647 views

How to exclude a ino/pde file from Arduino projects

I would like to be able to exclude from the auto-including process of the current project (without renaming the extension or delete it) a sketch with pde or ino extension that is used in certain ...
1
vote
1answer
769 views

How to make two wheels turn only for a particular amount of time?

I am trying to make a robot turn (dc motors are being used) back 180 degrees. So I used an l289n for it and made one wheel turn clockwise and vice-versa. But as I wan't it to make only a 180 degrees ...
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 ...
1
vote
2answers
126 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
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 -...
1
vote
1answer
685 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
1answer
567 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
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 ...
1
vote
2answers
67 views

(noob) 2 servos for robot (head & chest) movement at different speeds at once

I have an Arduino Uno and two Hi-tec Servos HS-40 & 5055 digital that I'm using for a basic robot build. I'm trying to have 1 servo(HS-40) turn the head back and forth (left to right) slightly ...
1
vote
0answers
44 views

Why does the LED state behave differently?

I wanted the sensor to be high when I press the button, but when DigitalRead does low, the LED turns on, when it does high, the LED goes off. Whereas when the digitalRead is high, isn't it supposed to ...
1
vote
0answers
29 views

Http Client requests

I am working on a project where the ESP 8266 sends a very long string about 3000 chas over http as client. Likewise sensor data are determined. The loop repeats itself every 250ms. Now I noticed that ...
1
vote
0answers
32 views

Aurdino EMG sensors and servos?

I'm new here and to the aurdino. I'm building a 3D printed robotic arm controlled by a EMG sensor. I purchased a V3 EMG board and leads on Aliexpress. Here's a list of the things I've purchase for ...
1
vote
0answers
131 views

How do i efficiently write this code for PS2 controller to USB convertion sketch for Arduino Pro Micro?

I am really new to coding and building stuff, so forgive me if it is anything offensive.i have been trying to convert my PS2 dualshock controller to USB using arduino. there is a library called ps2x ...
1
vote
0answers
74 views

Arduino Sketch Crashes in working procedure when adding extra call

I am trying to drive a couple of motors to make a car. I successfully wrote some code then tidied it up to procedurise it and it just kept crashing. I've put some debug code in and narrowed it down a ...
1
vote
1answer
459 views

Arduino New Optiboot Bootloader on custom ATMega328p board, ATMEL Studio and AVRdude [closed]

I am about to ask a kind of complex question due to the number of system parts involved and the system architecture I am planning to use. First of all I have a tiny bit of experience with the Arduino ...
1
vote
1answer
369 views

Trying to connect a 1.3" IIC OLED display to an Arduino M0 board (not Uno)

I'm trying to connect an OLED display to the Arduino M0. I got the code example (ssd1306_128x64_i2c) from the Adafruit SSD1306 library I downloaded. Video showing at 8:14 how it should look However, ...
1
vote
2answers
673 views

How to insert into table in database after every 5 minutes using Real time clock module

I have RTC module attached to arduino mega, to calculate time difference of minutes I am getting minute from the RTC module and checking if passed time is greater than 5 minutes then insert to ...
1
vote
2answers
479 views

Arduino Prototype on Breadboard: "avrdude: stk500_recv(): programmer is not responding" [duplicate]

I have created an arduino prototype using the exact instructions found on this page: https://www.arduino.cc/en/Main/Standalone However, when I plug in the micro USB power supply and try to upload a ...
1
vote
1answer
258 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
3answers
100 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
vote
1answer
263 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 ...
0
votes
4answers
8k 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
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
1answer
125 views

The sketch burned two H Bridges, need help to find out how to modify

This is Arduino RC control car, the sketch tested good in a small motor, but burned two 60A drivers when put into 24V,500W motors, need help to find out whats wrong? #include <VirtualWire.h> //...
0
votes
1answer
1k views

Code is not working (Matrix keypad) [closed]

I am new to Arduino. I am learning from Arduino Cookbook. I was using tinkercad.com for running my Arduino code. But it is not working. The Serial monitor should show the key which I have pressed on ...
0
votes
2answers
867 views

ESP8266 Blink sketch - does not blink / or stays constant

I uploaded the Blink sketch (from the ESP8266 examples, in the Arduino IDE) successfully. Depending on which wire configuration I am using two different things happen: wiring 1: CH_PD -> 3.3V ...
0
votes
3answers
161 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?