The process of designing and writing source code as part of a program (or sketch) for Arduino. Do not use for uploading to an Arduino board.
1
vote
3answers
34 views
How to connect a a three state switch (ON-OFF-ON) to arduino?
I have created a car that can detect obstacle and change its direction, but now I want to add a bluetooth module to control it and I want to switch between the two circuits using a three state switch ...
1
vote
4answers
37 views
Proper error logging using Arduino
Coming from a C# background where I do logs for every application, and given that I will be using the Mega for most projects and therefore have the memory available to do so, I want to incorporate ...
0
votes
1answer
14 views
Help compiling multiple .ino file code with code! (I'm not sure what to name this)
Ok, so i'm trying to make This Project and the code comes all in different .ino files but in the video its all in one program. So how do I compile all of the code onto the arduino? (By the way the ...
1
vote
1answer
11 views
Adafruit Flora V2 use onboard and external NeoPixels
I am working on wearable project using an Adafruit Flora V2, and for this project I need to use the onboard NeoPixel. I also need to use Neopixels that are attached to the D6 pin (is it a pin?). I ...
-3
votes
1answer
16 views
Oddness with #define and #ifdef in a sketch
I'm putting together a simple sketch to read a few sensors and have come across some odd behaviour associated with #define and #ifdef.
Here are some snippets from my code:
// Defines
//#define DEBUG ...
-3
votes
0answers
18 views
Program to read 16 analog signal in arduino mega 2560 board
I want a program to read 16 analog signal in arduino mega 2560 and to check whether the signal is high or low and print the statement.I'm really stuck.can someone plz help in programming
-1
votes
1answer
33 views
How do I program an Arduino board to count how many times a magnet passes a hall sensor?
I'm very new to programming and need some help. So I have a project I have to where I have to calculate how many times my bicycle wheel spins before reaching a certain distance, so I thought it would ...
0
votes
1answer
47 views
Receiving serial data in acsii, how to split it.
Hello I want to know how to split an incoming serial message that comes in this format CxxxLxxx, x=number, so i can take the 3 numbers after the C and save them and then take the 3 numbers after the L ...
0
votes
1answer
32 views
Programming problem I need both if else cases to work but only else loop is running
#include <SoftwareSerial.h>
#include <Servo.h>
Servo myservo1, myservo2, myservo3;
int bluetoothTx = 14;
int bluetoothRx = 15;
SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
void ...
3
votes
2answers
61 views
using enums in functions
Given the following enums
enum RelayState { RELAY_OFF = HIGH, RELAY_ON = LOW };
enum class CrossingZoneState: uint8_t {
CROSSINGZONE_CLEAR = 0, // no train in crossing area, also initialized ...
3
votes
2answers
110 views
code to force a gentle servo power up
So I am new to the board and looking for a source to answer an Arduino servo project's rough power up. The project uses a pair of servos operating together to swing a small door. I have been working ...
0
votes
1answer
26 views
'Non-Deterministic' memory usage on Arduino
I had a problem with a memory leak in my sketch and cornered it with MemoryFree.h. This works great and I was able to fix my leak.
My sketch is not really static, but My var sizes are. I observed, ...
0
votes
3answers
96 views
Proper way to run functions in loop
I am having a problem getting my functions to run properly from the loop.
I am building a model railroad crossing gate and need to run the 4 processes once the sensor signals the train entering the ...
5
votes
4answers
357 views
Employing C++ code for Arduino
I have Googled quite a lot regarding using a C++ program for uploading to Arduino and related, however I am confused now. Right, my problem is this:
I have written a C++ program which imports RGB ...
1
vote
1answer
20 views
Compiler doesn't like function code
I am getting this error from the Visual Studio compiler (I use the Visual Studio add-in Visual Micro for Arduino).
ModelRailroadCrossingSignalController.ino:In function 'void loop()
...
0
votes
1answer
20 views
Is this bluetooth setup good?
I am trying to do this tutorial http://www.instructables.com/id/Chappie-Self-Balancing-Robot/ on building a self-balancing robot with uno. However, I bothered by the Bluetooth wiring. I've done ...
1
vote
3answers
39 views
Resetting millis() and micros()
I want to know how much time has elapsed since a certain event, and I do not want to use any external timers. It seems logical to reset an internal timer whenever the event occurs (using an ...
1
vote
0answers
49 views
Problem with my Arduino project
I am making a smart bin which automatically sense (with the help of IR sensor ) and dispose the trash by moving with help of DC geared motor 12V 60 RPM and it also detects for obstacles with the help ...
1
vote
2answers
19 views
Serial Data Formatting not Correct?
I am writing two Arduino Uno programs. One is a remote with a joystick and the other has five LED's indicating which direction the joystick is pointing. They are Bluetooth, so everything is sent and ...
1
vote
0answers
11 views
receiving sms by arduino with wavecome to control the led with sms
how to code the arduino program for turning on / off thhe led if we use wavecome modem fastrack on the arduino, please help me i'am in a trouble about this. Please
i dont understand about how to ...
0
votes
1answer
29 views
Trying to start a timer to change lights when a button is pressed
I am trying to setup a series of lights (traffic lights) that change based on a timer that begins when a button is pressed. The goal is to use the lights to track how long its been since you pressed ...
1
vote
0answers
14 views
Running script file/programe on Intel Galileo gen2
How do I run a script file/programs like C / python / shell script in an Arduino IDE like how We use System();
Commands like grep, cut, cat works fine but running System("python file.py"); doesn't.
...
1
vote
0answers
21 views
OV7670 non FIFO with AL440?
I am trying to build a low-cost Arduino-based camera image to SD card prototype and would like to know if it is feasible to connect a non-FIFO OV7670 camera to an AL440B video buffer to avoid the ...
0
votes
2answers
48 views
While loop not breaking
I'm trying to build a circuit that buzzes until a button is pressed, or it buzzes 5 times:
void alarm()
{
int AlarmState = 0; //Just to get while loop going
int count = 1;
while(AlarmState==0)
...
1
vote
0answers
39 views
Library for DIY Keyboard
I'm planning on making my own Bluetooth Mechanical keyboard using the Adafruit Feather 32u4 Bluetooth LE. Something that I haven't really figured out is the programming side of things. I was wondering ...
0
votes
1answer
14 views
Expected Initializer?
I keep getting the error "Expected initializer" at different points in my code whenever I try to verify it. Currently, the error exists before "void setup." How can I fix this error and not allow it ...
0
votes
1answer
35 views
LEDs instruction code does not loop
I am using Neopixel Library and a Trinket Pro 5V Microcontroller to chase first three LEDs on a strip and then burst the last 2 (could be modified based on the number of LEDs).
The LEDs chase only ...
0
votes
1answer
24 views
Arduino join multiple strings and numbers and then seperate them
OK, I'm working on a remote controlled robot. Both the robot and the remote use Arduino with a Bluetooth shield. The Bluetooth is working and I need to send something similar to this over Bluetooth:
...
4
votes
2answers
92 views
Why does DHT-library (and others) only allow one object instance?
I came across the problem to handle two DHT22 devices.
I use the Adafruit DHT Sensor library.
Since my Arduino sketch works as a "relay" for Serial commands on a host, I tried to wire up and ...
1
vote
1answer
46 views
Arduino Prototype on Breadboard: “avrdude: stk500_recv(): programmer is not responding”
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 ...
0
votes
2answers
28 views
“Return” Code Not Working
I'm trying to experiment with a "return" function. Yet each time I try to run my program, there happens to be an error, like "expected declaration before '}' token."
Can someone explain the basics of ...
1
vote
1answer
36 views
LED and LCD game
I am making a game where four different colored LEDs are flashing randomly, and when the green LED lights up, the user presses a button. If the user pushes the button when the LED is green, I want my ...
1
vote
1answer
22 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 ...
0
votes
1answer
37 views
Arduino UNO stuck in Setup function when interfacing UNO with ESP8266 module
Following is my code that i am trying to use it with Arduino Uno with ESP8266 module but my code stucked in setup function why is that.
#include "ESP8266.h"
#include <SoftwareSerial.h>
...
1
vote
1answer
78 views
What is pulseIn in programming Arduino?
I have seen some tutorials on ultrasonic range detector sensor.
In that, what is the meaning of the word pulseIn?
1
vote
0answers
69 views
Arduino NTP clock glitches every 7 seconds
Please ignore all of the comments, this is basically a Frankenstein program with several different programs combined together.
Basically what happens is the time prints out in seconds like this: 00, ...
0
votes
2answers
39 views
Has anybody seen/created a gps guided vehicle with arduino? [closed]
I thought the idea of Amazon Prime air drone delivery was a pretty cool one when it first came out and I started to question whether something like that (an autonomous gps guided vehicle) could ...
0
votes
0answers
9 views
Are there any good quadcopter tutorials? [duplicate]
I want to make a quadcopter with the arduino development board and I have no clue where to begin and I was wondering if anybody knows any good tutorials to help me get started?
2
votes
3answers
105 views
How to send data from an Arduino to PC, without using the Serial Monitor?
I have an analog sensor which I want to send data from my Arduino Certified Intel Edison to PC, without using a Serial Monitor and preferably putting the data into a text file.
0
votes
0answers
13 views
Voice Recognition Automatic Train
Voice Recognition with Arduino - RGB LED and Light Bulb (Home Automation)
In the link provided above, what code will I use to automatically input another set of voice commands into the Arduino using ...
1
vote
1answer
38 views
PC Cannot Access HC-06 Bluetooth COM Port
I have an HC-06 Bluetooth module connected to an Arduino UNO board to allow for the data received by the Ultrasonic sensor to be transferred to my PC via bluetooth and serial communication. I am using ...
1
vote
2answers
38 views
Servo control using DIP switch
I am pretty new to Arduino and programming too.
I want to sweep a servo using DIP switch. At the moment, I use 4 position DIP switch. To each of the switches, I want to set the number of times the ...
0
votes
1answer
27 views
Understanding the contents of a library in C
So this is a question not just about the #include but most all includes you find while programming in C.
So I understand a library is prewritten code and when you include that library are you able ...
-3
votes
1answer
102 views
How do I learn C? (was Computer project) [closed]
Can you help me writing a code for this question guys??
You have an Arduino Uno with 8 LEDs connected to digital pins 2 to 9.
Create an array of 8 elements. Fill it with random numbers between 2 and 9 ...
0
votes
1answer
164 views
Send JSON via POST on SIM900 shield with AT commands
I'm trying to send a JSON POST in SIM900 shield with AT commands. After I call the AT+HTTPACTION=1 command, it returns a 601 error: +HTTPACTION:1,601,0.
I saw here that the error was 601 Network ...
1
vote
2answers
117 views
Combining 2 State Machines?
I want to gain from recent advice from this forum by re-doing my project using 'state machine' logic if possible, in an effort to reduce wasted processor time and variables usage.
I'm starting from ...
1
vote
1answer
43 views
int not declared in this scope
This posting contains 2 sketches. the analogmux1 compiles successfully. Concerning analogmuvvolts sketch an error stating updateMux1 was not declared in this scope results. The int Mux1_State [8] = 0: ...
0
votes
2answers
83 views
Will a .ino Arduino Sketch compile directly on GCC-AVR?
Okay, we all have seen those questions all over the web such as Arduino v.s. C++, or other similar questions. And a vast majority of the answers do not even touch compilation differences other than ...
1
vote
0answers
30 views
how to write program for line follower with adafruit motor shield
i have analog sensor with Ada-fruit motor shield how to write the program to control motors, please tell me the program to run the motor
1
vote
1answer
64 views
Advice for checking integrity of serial char strings?
I'm trying to create a flexible but reliable system for arduinos to interact using serial ascii strings.
I'm using a message structure comprised of Command[10] + (optional) Params[20] + (optional) ...