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
votes
1answer
37 views
I am having an issue reading a HIGH LOW signal from a pressure switch
I'm trying to read either high or low from a pressure switch, I do have a pulldown resistor attached but even if I plug in a wire with nothing on it i get a false high. I've changed pins, tried adding ...
0
votes
2answers
28 views
Arduino Starter Kit
I am not sure if this question is allowed, feel free to remove if it is not.
I am new to Arduino and looking for advice on a good starter kit to purchase. I have done some research but felt it would ...
0
votes
0answers
21 views
Flash a .hex to an ATtiny45 with Arduino [duplicate]
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 ...
1
vote
2answers
60 views
Weird Arduino math result
I have a simple code, part of which contains the calculation 800/1000, which seems to return a value of zero for some reason (even though I store it in a float variable). When I replace the ...
0
votes
1answer
41 views
Find number of RX and TX-pin on ArduiMu
I've got an Arduino V3+ and need to find the correct PIN number for its RX and TX-pin on the FTDI-connector.
How can I find out the correct number of them to use them with the SoftwareSerial-library?
...
1
vote
3answers
71 views
Can do I make an Arduino program that can decipher telephone touch tones?
I have an old land line phone that I want to connect to my Arduino. Then I would like to write a program that can decipher the touch-tone button presses (which are a combination of two tones) so that ...
0
votes
1answer
59 views
How to start Arduino programming?
I am totally new to and don't know where to start, I am interested in building new system with combination of hardware and software and every time I search how to make that embedded system it finally ...
0
votes
1answer
45 views
Exiting from one loop and get ready for another
Thanks in advance for any help.
I am working on a keypad password lick system based on arduino UNO. I have used the password library from Arduino's website.
What I am trying to accomplish is to set ...
0
votes
1answer
28 views
MQTT for GSM/GPRS sheild
I want to publish sensor data to server using MQTT protocol via gprs/gsm modem. I googled mqtt for arduino, mqtt arduino available only for ethernet sheild or will mqtt arduino ethernet sheild work in ...
0
votes
2answers
57 views
Arduino UNO button LED brightness vary
I am using an Arduino UNO and I am trying to vary the brightness by steps by 0.5 volts till it gets to a max of 5.0 V using buttonA and decrease the brightness of the LED by 0.5 volts with buttonB. ...
1
vote
2answers
54 views
New Language - Interfacing with AVR
So I'm taking a class where the project is to create a new embedded language. We are using OCaml for the compiler, so I was looking for a way to interface with AVR or its C library in such a way as I ...
3
votes
3answers
86 views
How can I handle the millis() rollover?
I need to read a sensor every five minutes, but since my sketch also has
other tasks to do, I cannot just delay() between the readings. There
is the Blink without
delay tutorial
suggesting I code ...
1
vote
3answers
45 views
Measuring Time Between Inputs
I'm trying to measure the amount of time that has passed between every time a reed switch mounted on a wheel is activated to calculate the speed of a bike in miles per hour and display it on two 7 ...
0
votes
1answer
18 views
Conver char value to variable?
I want to pass the preprocessor values(AT commands) to the Serial.println function. Im trying TCP connection using arduino-SIM900A. I've declared all AT commands to each preprocessor variables like ...
0
votes
0answers
20 views
Linear equation solver Arduino Calculator, printing wrong answer
I wrote a code in C to solve equations, but I don't know why some equations that I input into this calculator, give me wrong values, the algorithm is correct because I execute it in C and give me the ...
0
votes
1answer
25 views
Arduino Serial Queue
So I am programming an LED Music Visualizer that uses a combination of Processing and Arduino. I have it all working as I want to but there is a small problem. If I were to stop the music, then the ...
0
votes
1answer
44 views
Arduino UNO coding problem voltage varying
I was wondering if anyone could help me... I am using and Arduino UNO and and I am doing my code in the Arduino IDE and I am trying to implement the code so that the output voltage can be varied from ...
0
votes
2answers
46 views
How do you call to a previous function?
I'm using an Arduino to control a reverse osmosis machine, I would like after a certain number low pressure events to return to the testing routine. Can you call to previous functions?
0
votes
1answer
18 views
Arduino IDE / Teensy 3 on Ipad
Does anyone know a good IDE for Ipad to write Arduino code and compile it for teensy 3 ?
Answers with different alternatives would be appreciated
0
votes
1answer
28 views
Controlling 2WD car chassis with PS3 controller
I'm having trouble with controlling my car with the PS3 joystick, and there hasn't been any example codes out there. I'm using;
PS3USB library from USB_Host_shield_2.0 library
Freetronics H Bridge ...
1
vote
2answers
50 views
How to count the number of times a changing variable reaches a peak value
I am recording a varying distance with an Ultrasonic sensor and Arduino but my problem is I want to display the number of times this variable reaches peak (at an instance the value will be increasing ...
0
votes
2answers
23 views
analogRead-ing Potentiometer Values in void setup()
I've run into a problem while coding a speedometer meant for bicycles. The speedometer would require the diameter of the wheel in inches for maximum accuracy, so I'd like to have an adjustable (by ...
0
votes
1answer
79 views
Arduino Protothreads by Example
I am trying to get Arduino working with Protothreads and wanted to confirm I have the basic setup correct. If I have understood the API correctly, then the following code should be what I need to ...
0
votes
2answers
40 views
Aduino 7 segment dice project
I am struggling with the code that I should write for my project. I finished my breadboard but I have never learnt programming before so I cannot write the program for the dice.
My project is to make ...
0
votes
2answers
63 views
Do I need 3 full-size arduinos to control this LED setup?
I'm sourcing the parts now for an LED persistence of vision setup on a bicycle. Two wheels with anywhere between 16-32 LED's per wheel, as well as 24 LED's mounted on the frame of the bike itself
...
0
votes
1answer
28 views
Call a class method from inside the same class
If i have file cSpeedOfSound.h:
#ifndef cSpeedOfSound_h
#define cSpeedOfSound_h
#include "Arduino.h"
#include "math.h"
class cSpeedOfSound{
public:
cSpeedOfSound(float *i,float *C);
...
-1
votes
0answers
11 views
reading variable from .cpp and using it in servo control (.ino)
i stuck at some point in coding arduino.
I am trying to make a robotic arm which is controlled by logitech 3d extreme pro joystick. I am using usb host shield to take axis info from joystick. Now i am ...
0
votes
0answers
22 views
How do I install a library in Arduino Yun cross compile environment?
A few days ago, I've asked this question.
Thanks to the replies I've received, I've set up a cross compile environment for Yun by following this guide.
I've created a virtual machine with virtualbox ...
0
votes
1answer
22 views
Arduino Yun doesn't link any library
I'm writing code for a project with Arduino Yun. My project is quite simple: it takes a picture with a webcam and saves it in a PNG or JPEG file format. I've already installed the uvc driver for ...
1
vote
2answers
42 views
Passing arguments to LCD.print through another function
I'd like to write a function like this:
void lcdPositionPrint(int row, int col, content) {
lcdPosition(row, col);
LCD.print(content);
}
but I'm not certain how to declare "content", ...
0
votes
2answers
40 views
giving delay function to output
I want my arduino to give the output at a specified delay .The delay is calculated from a polynomial equation.
unsigned long t=40*Vin*Vin-760*Vin+4320;
delay(t);
digitalWrite(ledPin,HIGH);
but ...
0
votes
1answer
48 views
How to define function/macro so it is accesible throughout various cpp files
I recently came across this nice SerialPrint() implementation:
void StreamPrint_progmem(Print &out,PGM_P format,...)
{
// program memory version of printf - copy of format string and result ...
0
votes
2answers
127 views
Arduino OR operator
I have been trying OR conditional operator in a if condition statement in my arduino program and the result is not what I expected.
My program:
// three variables assigned to const int datatype as ...
1
vote
1answer
41 views
Arduino analog joystick
I'm planning to make a handbrake for my racing simulator (Assetto Corsa) and I wanted to know how can I transform arduino into a joystick so the game can read the analog input?
Thanks in advance, and ...
1
vote
2answers
45 views
How to power on Arduino a few seconds later after GSM module initialization?
I've connected a SIM900A GSM module to Arduino and the circuit works standalone on a 12V power supply. The problem is when I provide the 12V power supply, both GSM module and Arduino starts but the ...
0
votes
1answer
53 views
How can I programming detect that a Bulb/LED is ON/OFF or a circuit is working as expected using Arduino?
I've created a circuit to turn on bulb using GSM module and Arduino. I want a mechanism(or programming) to know whether the bulb is on or off or fused. I've tried taking the input from the pins. But ...
0
votes
1answer
55 views
This specific code just refuses to compile?
I've been working on some software to do REALLY basic composition of music.
Here's my code so far:
#include "notes_sharps.h"
int notes[] = ...
0
votes
1answer
50 views
How do I scroll through the LCD Vertically with joystick?
So I have a device im working on and the only issue im running into is I cant manage to figure out how to get my LCD display to move around vertically with the joystick I have attached to it. I have a ...
0
votes
2answers
56 views
Interesting Problem with Arduino UNO Code(IGNORES VARIABLES SELECTIVELY)
This is the first code I wrote for my UNO R3 just to feel out the functions and I've already got some jankiness.(throughout this description I am referring the first two if statements one inside the ...
0
votes
3answers
77 views
How to control 2 servos at same time in sync?
For overcoming torque issues, I have attached 2 identical servos on a certain part of my robot arm and because I saw someone do the same.
Now, while writing code I realize:
#include <Servo.h>
...
4
votes
2answers
668 views
Why doesn't my code work in a function, yet works inline?
I'm trying to write a faster shiftOut function, which does not use the slow digitalWrite. In my code I have the original shiftOut, the new shiftOutFast, and the same as shiftOutFast, but inline. The ...
0
votes
2answers
32 views
Arduino: Put Data in Other File
The below code starts off with lots of data in the beginning, distracting the reader from the actual code. What is the best practice to clean this up:
#include <Wire.h>
// For LED Backpack
...
0
votes
1answer
44 views
Programming question for Time Arduino
Can you program a sketch so that if the time is between 1m and 10m then it will reset itself?
Reset I found already, it is the if that I don't know.
0
votes
1answer
138 views
WebCam Face detection and tracking tutorial with Arduino Uno R3 and OpenCV 3.0 RC1 in Ubuntu 14.04
I try to make this Arduino Open CV tutorial for webcams. OpenCV 3.0 RC1 is compiled and installed. I also use Code::Blocks 13.12 as IDE. I am a newbie what comes to OpenCV and I do not know too much ...
0
votes
0answers
29 views
Change ports in library file
I want to change the output ports in a library file because I use an Arduino Mega and the file uses an arduino uno.
How to change the output ports?
0
votes
1answer
33 views
Not sure if programmer or ATMega is burned
some time ago i tried doing this with my original arduino uno r3. I guess i had to plug the power cables in wrong order(i think it's called reversing polarity) because my arduino stoped working. It ...
7
votes
4answers
477 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
43 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
120 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
120 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 ...