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.

learn more… | top users | synonyms (1)

5
votes
4answers
392 views

What is the best way to define an I/O pin?

I read definitions like const int ledPin = 9; and also #define ledPin 9 I know that a definition like int ledPin = 9; is a bad practice if you're not going to change it (which you usually ...
0
votes
1answer
13 views

Arduino Java SerialEvent not being called (Rasberry PI) XPOST from stack overflow

I am following a simple example found here (example one), to have an arduino connected to a Raspberry Pi and read some data from the arduino on the Pi in Java. The issue is that the SerialEvent ...
0
votes
2answers
56 views

Making my own libraries

Does anyone know of a site or book where you can learn how to create, or for first reed, libraries. Because I think the libraries I use are sometimes unnecessary complicated, or have similar features, ...
0
votes
2answers
34 views

Error in Compiling

The error shown is C:\Users\SIDDHA~1\AppData\Local\Temp\build3397782103973366883.tmp/core.a(Tone.cpp.o): In function `__vector_7': C:\Program Files ...
1
vote
1answer
34 views

Debugging modified BlinkWithoutDelay

I have some level of programming background, however never with Arduino's. I've just started hacking at the examples - I'm not even sure what language I'm currently writing. I presume it's C++. ...
0
votes
1answer
84 views

Global Variable not able to be accessed in function?

I am trying to compile an Arduino program that takes analog input. However, when I declare multiple global variables, it often will not compile and because it throws an error that the variables aren't ...
0
votes
0answers
12 views

How to use the OV7670 camera with Arduino IDE [duplicate]

I recently got the OV7670 camera and I like to use this with the Arduino IDE, but I dont find any information about how start with this, i found code but for other IDE's, anyone knows hos to start ...
2
votes
3answers
144 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)' ...
1
vote
2answers
39 views

Alternative to Tone( )

Is there any way to make sounds using an Arduino without using the tone function? It must be possible via this new method to control frequency of sound.
0
votes
1answer
51 views

Communicating with Arduino

In this Question how does the code Processing work? Which programming language is it written in? How to run it?
0
votes
4answers
154 views

How to learn enough C++ to program Arduino

I am an experienced web-developer, but my C++ skills are very basic. I struggle with the concepts because it is so different from something like Javascript (which I already know). I do not have a lot ...
-1
votes
1answer
46 views

I Want to use nested if in arduino , can anyone help me out?

I'm working on Home Security Project and in that I'm using DTMF to unlock the door and PIR sensor to switch on lights , Laser counters to count number of persons entering and leaving the room. the ...
0
votes
0answers
8 views

How to get read user input from DAQ for a given time interval?

I'm using a built-in DAQ simulator. When it opens, it shows 3 different LEDs with 3 pushbuttons, one corresponding to each LED. I'm trying to read the user input from 3 pushbuttons for a time ...
0
votes
2answers
61 views

Getting started [closed]

so I am not a newbie to computers or programming. I regularly program in C# and Java, know quite a bit about computer hardware and operating systems. But I am bored of writing stupid calculators or ...
1
vote
0answers
42 views

Issues with PIR Sensor triggering by itself

I am currently working on my first Arduino project and I am having some issues that I am seeking help with. The robot I am building must have human following capabilities and to do so I am using 3 PIR ...
3
votes
1answer
1k views

Why use .h files with .cpp?

At school, our teacher always taught us to use .hpp (c++ Header files) with our .cpp (c++ files). But arduino seems to use .h files (with .cpp links?). When someone is programming in C (withouth ...
0
votes
0answers
29 views

Arduino Due Guitar Output Frequency Detection [on hold]

I have been attempting to design a guitar tuner using an Arduino Due and a library called Arduino-FreqPeriod-Due. I have the guitar connected in the following way: Guitar Output Jack --> Guitar Cable ...
0
votes
0answers
17 views

27 Servo Project, Uno with Adafruit's 16-Channel Drivers

I'm working on a project where I need to be able to control 27+ servos. The problem is that I am unsure how to control them from a computer. I'd love to build a simple program with a user interface ...
-1
votes
2answers
51 views

How to Display data from Strings?

i am working in an interactive project in displaying texts in POV which people can click to generate different texts automatically i wrote a String to store the text first, but it seems cannot display ...
2
votes
3answers
78 views

How to calculate phase shift between two square waveforms with Arduino DUE

I have two square wave signals with the same frequency. I want to measure the phase shift between these two signals. There will be a small phase difference between two signals. (0-90 degree) and the ...
1
vote
3answers
99 views

How big of a difference is there between an Arduino Uno and the rest?

Lately I've been fooling around with a project for my Microsoft Sidewinder Force Feedback Pro Joystick. I've found out that there is a project currently for it built for the Teensy 2.0. On the page ...
2
votes
1answer
34 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 ...
3
votes
1answer
360 views

Port manipulation using C code

I'm trying to manipulate the ports of Arduino using C code. I have attached an LED to pin 8 and a tact switch to pin 13 (with a pull down resistor). The code works fine, and the results are printed on ...
1
vote
1answer
57 views

Use object of other class within class

I am writing a class for a project which will take care of handling any LCD updates for my project. The way I want to handle this is to initialize the LCD object in my main file, and then pass the LCD ...
1
vote
0answers
27 views

Home-Made EL Tape chaser

I am working on a project involving 14 sections of EL tape. This is a circular array that incorporates a chaser effect with two lights lit on either side. originally I had found a small diy LED ...
1
vote
1answer
50 views

I want a couple of servos to listen for P.C. input (data from OSC protocol), can I bypass having to use an Arduino?

...and whack a stripped usb cable straight into a prototype board? by bypass having to use an arduino I mean any kind of sheild? polulu would be perfect but im trying to avoid needing any of this. ...
0
votes
0answers
23 views

How to use “enum” within Arduino IDE? [duplicate]

When I try to write a enum function it looks like arduino IDE does not recognise it. Any suggestion on how this works?
0
votes
1answer
145 views

Arduino TCP communication with android phone

I am trying to communicate Arduino UNO with android phone, What I trying to is 1) android device post a string to arduino 2) arduino post a integer to android So far I can post message from ...
3
votes
0answers
76 views

SAM3X8E (Arduino Due) Pin IO registers

How does IO registers of Arduino Due work? On Arduno Uno just set DDRx, then PINx to read, PORTx to write, I'd like to do the same thing with an Arduino Due, but it has many more registers, such as ...
2
votes
1answer
221 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 ...
0
votes
1answer
26 views

Vibrating motors with different intervals

For my project, I have 3 ultrasonic sensors and 3 vibrating motors; the motors need to buzz for a small amount of time, then wait for a specific time that corresponds whith the range of the ultrasonic ...
1
vote
0answers
33 views

Detect external ground on an input pin

I am making a bike alarm for my bike. I haven't started yet. Basically, I'm thinking of a pin to be connected to the metal post (to which the bike is locked.) I want to detect if that connection (to ...
1
vote
1answer
60 views

Trying to track down macro or #define values, possibly in arduino preprocessor

In reading various code I stumble across symbols that seem to be the result of #define or other macro like symbols that I cannot find just by tracking through the code ( including its chain, if any, ...
0
votes
1answer
46 views

How to return a message when calling by a TCP connection?

I am working on a communication between android and arduino board. The android make a TCP connection with the board and successfully send some string to the board. The problem is , there is a int ...
0
votes
1answer
155 views

How to make the motor car move left-forward / left-backward/ right-forward/ right-backward

I recently using the arudino uno to make the motor car. And I successfully make it move forward / backward / left / right void forward(void) { analogWrite(EA,254); //speed 0 - 255 ...
1
vote
2answers
162 views

How to program ATTiny85 running 3.3V

I have a working project built around ATTiny85 on a breadboard running at 5V. Now I want to move this prototype on a PCB where it will be powered from batteries. All components used are capable of ...
0
votes
0answers
20 views

ultrasonic sensor program SRF005 on Arduino Uno [duplicate]

can someone explain to me that program? int duration; int distance; int srfPin = 2; void setup() { Serial.begin(9600); } void loop() { pinMode(srfPin, OUTPUT); digitalWrite(srfPin, LOW); ...
-1
votes
2answers
48 views

fancy arduino IDE [duplicate]

Do you know an IDE that is Arduino compatible, with : Black background, white hurts my eyes Some auto completion features mabe ? And also one which lets you minimise brackets, Xcode like. A ...
0
votes
2answers
61 views

Internet of Things at home only

My question isn't specific to Arduino but can concern Raspberry Pi and all Internet of Things homemake projects. As I'm preparing a personal projet with sensors, data storage and ...
0
votes
2answers
299 views

Connect Arduino via TX RX Pins to Computer's USB Port

I want to avoid using the big USB B connector to program my Arduino Mega. Since there are those RX TX Pins I thought, it would be possible, to connect my USB - Wires from my PC directly to those RX TX ...
-1
votes
1answer
41 views

Can't figure out the error to this code

I've written up this very simply code to control transistors in an inverter circuit. The editor is flagging up errors which I can't see myself. I'm pretty new to Arduino programming but it's very ...
1
vote
2answers
76 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
2answers
115 views

Programming arduino with Objective-C

Can you use clang, with --mpu=arm, etc. and avrdude to program an Arduino Due (Arm Cortex M3)?
1
vote
4answers
657 views

New to Arduino: Should I learn C, C++ or both (C & C++)?

From what i've researched here is my thoughts on both C++ I heard that you can create libraries using C++ in arduino. And you can use the Arduino IDE to do that stuff. Here is the proof ...
0
votes
1answer
134 views

Pulse measurement

I am currently doing the project in pulse measurement using arduino yun. I am using pulse sensor is SEN-11574 . When I verify the code I get this error: Arduino: 1.5.8 (Linux), Board: "Arduino Yún" ...
1
vote
3answers
118 views

Can i use arduino code, without using arduino board but just using MCU included

I am developing a product, and to ease my job i am planning to use MCU inside the arduino with the library of Arduino. Since all the registers are already defined inside the library, and all required ...
-1
votes
1answer
82 views

modbus slave ID setting

I have small problem in setting device ID for Mosbus slave arduino. Here is simple example In Modus library; device ID being configure hardcode while program. This code works for Me. Modbus ...
0
votes
1answer
740 views

arduino program got error expected //primary-expression before ')' token error: //expected ';' before '}' token E

#include "pulse-sensor-arduino.h" #include "Arduino.h" #define PulseSensorbegin int pulsePin = 0; int blinkPin = 13; int fadePin = 5; int fadeRate = ...
1
vote
3answers
333 views

Make a PC graphical interface for Arduino - Any easy software? [closed]

What's the best/easiest software to make a PC-Arduino interface? Ideally, I need to create a .exe that shows up a simple graphic interface, where the user can display data acquired from sensors ...
0
votes
0answers
56 views

Trying to make zumo robot stay within dark lines like a track of electrical tape. Doesn't seem to register turns fast enough

Trying to make my zumo robot stay within a track, made of electrical tape. Basically when the right or left sensor detects the tape ('sensors > sensor threshold' after going from grey surface to ...