Tagged Questions
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.
0
votes
0answers
28 views
Guide to code for multitasking and non blocking timers
I'm beginning to to kind of sophisticated things (well.. for my entry level skill) and I have to control a display with 3 LED and 4/5 types of events and status.
I'm using the BlinkWithoutDelay ...
-2
votes
2answers
75 views
Need help for RPM counter with Arduino on ubuntu
Following is RPM counting program.
It worked in windows perfectly.
However, in ubuntu it always shows weird value.
int pin = 7;
float rpm;
float duration;
unsigned long val;
float rps;
void ...
4
votes
1answer
64 views
From transfer function to arduino
This question might seem stupid, but I have been curious about it for a long time.
So I am a new engineering student, and we learned a lot about "designing a controller". For example, design ...
1
vote
1answer
22 views
Do we need another controller when using ArduPilot?
I'm a newbie on the all Arduino platform and I'm currently building a drone with Autopilot functionality. I've heard about ArduPilot and I'm wondering if that is all I need, in terms of controllers ...
-2
votes
1answer
33 views
Relay activation
I am posting my simple code here, I wanted to print the Output_Current Inspite when delay function called.Below is my code.
#include <MsTimer2.h>
int Analog_Pin=5;
int newaverage;
float ...
1
vote
2answers
57 views
4-digit 7 Segment LED displaying numbers in the wrong order
I am a novice Arduino programmer and am currently having trouble with a SH5461AS 4-digit/7-segment LED when using it with an Arduino Uno. I have struggled to find an accurate datasheet/tutorial of any ...
-1
votes
1answer
51 views
sample average of analog of current sensor
Here is my code. I have 2 problem in below code. This ACS712 sensor is too noisy so i am not getting count value properly .since i need approximate reading i consider curve is linear. and calculate ...
0
votes
0answers
79 views
+100
Aduino Due Can messages
I am trying to read/send CanBus messages using a Arduino Due.
As of now I have used https://github.com/collin80/due_can library to setup my Can Bus interface.
I am using Vector Software CanAylzer ...
-1
votes
0answers
24 views
library error “outside of class is not definition” for new driver
While I was building a software driver for an infrared LED and an infrared receiver
according this tutorial.
I found this error:
Arduino: 1.5.6-r2 (Windows 7), Board: "Arduino Uno"
...
1
vote
4answers
151 views
Unable to terminate “void loop”
I have loaded an example sketch that came with the installation of the Arduino software onto my Uno.
void setup() {
Serial.begin(9600);
}
void loop() {
int sensorValue = analogRead(A0);
...
4
votes
3answers
262 views
Is setup and loop provided for convenience?
Arduino sketches usually feature a setup and loop function. Are these functions only provided for convenience or do they actually have special purposes? (e.g.: are some operations disallowed or ...
-2
votes
2answers
69 views
Break statement terminating loop() [closed]
I am experiencing some very strange behavior with my arduino. I have a switch-case statement in the loop() method, and the break methods are not only breaking out of the case block, but also out of ...
0
votes
0answers
30 views
avr digital lock resetting keys
I am writing a C code for a digital lock with 4 digit password for ATMEGA32. The first part of the code generates numbers upon pressing the buttons on a 4x4 keypad through an interrupt.
I have three ...
0
votes
2answers
106 views
how to use strstr() in serial communication?
I have a SIM900 module and Arduino, both are working fine. In my previous programs I have use strstr() command to find specific word from a string but they were constants and pre defined in the ...
0
votes
2answers
104 views
Scroll String Only On Second Line Using 2x16 LCD
I'm trying to scroll a string in the second row of the LCD while letting the string on the first row stay intact. I use Serial to run that part of the code as you can see. It work at first but when I ...
0
votes
0answers
67 views
USB Keyboard in Retro Emulators
I have created a retro keyobard using a ZX spectrum and a PRO MICRO based on the info here: http://blog.tynemouthsoftware.co.uk/2013/04/arduino-leonardo-based-zx81-usb-keyboard.html
When plugged into ...
0
votes
1answer
51 views
Arduino Uno- Analog serial monitor not reading values over 174
I am simultaneously using a LEGO sound sensor in pin A5 and a RadioShack Tricolor LED Strip (Product #2760339) in pin A0.
The sound sensor alone works as expected (producing values based on volume) ...
1
vote
1answer
66 views
Using an array as a queue
I recently created a state machine for my latest Arduino project. It is a simple LED control, but it has many different modes and functions. I created a template for my state machine so I can use it ...
0
votes
1answer
81 views
ArrayList implementation fails for string object
I'm using a customised C++ implementation of ArrayList based on the method found in Processing. The original code is by Obed Isai Rios, but I've added a version to Github with more explicit file ...
0
votes
0answers
29 views
Errors With Hitechnic Infrared Seeker Library and Arduino Robot
I'm trying to this library with an Arduino Robot, but am experiencing problems.
The setup, loop and DirectionAngle methods in the example code are compiling and working well apart form this line:
...
0
votes
3answers
85 views
Arduino Digitalwrite for while loop set
My question is simple. Does Arduino set the digitalwrite() the moment it is called or at the end of the while loop. E.G.
int ledPin = 13;
void setup()
{
pinMode(ledPin, OUTPUT); ...
0
votes
0answers
55 views
How to connect an e-paper display to a RFD22102 RFduino DIP
I got my hands on a RFD22102 RFduino DIP and want to connect it to an e-paper display like the EM027BS013 or equivalent in the 2.7-3.0 inch range.
I am pretty new to this. I want to know which ...
0
votes
0answers
42 views
Wrong Mouse.move() output in Arduino Leonardo
I'm using my Arduino Leonardo as a Mouse but I'm experimenting a strange behaviour.
I put my mouse at (-1, -1) (absolute) coordinates and then I execute this code:
Move.move(com[curr_cmd_id].x, ...
0
votes
2answers
86 views
Getting a random number for electronic dice
I am making a "Electronic Dice".
I have 7 LEDs to form the output, and this works fine.
My problem is getting a random result on the output.
int die_face = 1;
void loop()
{
if ...
1
vote
1answer
95 views
Arduino Custom Function Problem
I am experiencing problems when I put parts of my code into custom functions and then have Arduino Mega 2560 run it. The code works fine when I put it all in the void loop() function, but when I ...
1
vote
2answers
84 views
How can I declare an array of variable size (Globally)
I'd like to make three arrays of the same length. According to the documentation, Arrays must be defined as int myArray[10]; where 10 can be substituted for a known length (another integer), or filled ...
1
vote
3answers
135 views
arduino serial port programming
I bought an arduino-on-breadboard kit. I have several pc with serial ports, now I'm being told I need a usb to serial converter? I thought I was ready to start uploading sketches, please advise.
I'm ...
1
vote
1answer
126 views
How to use readLine from JSSC [closed]
When I use JSSC and call serialPort.readLine(event.getEventValue()) from public void serialEvent(SerialPortEvent event) I've got fragments, not all string. What I must do to get all string from begin ...
0
votes
1answer
58 views
Nested For Loop
I'm not sure if I'm being really really stupid, but why doesn't this work?
void setup() {
Serial.begin(9600);
}
void loop() {
for (int x; x < 8; x++) {
for (int y; y < 8; y++) {
...
0
votes
1answer
77 views
Adapt program to suit Arduino UNO
I am trying to use a program that has been written for STM32 microprocessor for interfacing with a Time to Digital Converter TDC GP22 via SPI interface. I would like to use the same program and adapt ...
0
votes
2answers
69 views
On my lcd my characters collide, how can i remove one(because of the programming)
My code means that when i press a button it displays a word, but by default words are already there and i need to get rid of those default words.
#include <LiquidCrystal.h>
// initialize the ...
1
vote
0answers
34 views
There is any way to simulate an arduino due?
As the title says there is any program that can simulate an arduino due? I like the design of Proteus 8 but he can't simulate it. Only the arduino Uno R3, Mega and another one that I forgot the name.
0
votes
3answers
23 views
My counting function is not working with the text on my lcd
I want the bottom row of my LCD to display the counting function and include text:
lcd.setCursor(0, 1);
lcd.print("Launch in"millis()/1000);
But it comes out with an error, what part is wrong?
0
votes
1answer
58 views
My Lcd 16*2 is not displaying any characters, althought all wiring is correct?
Recently i have linked up a typical 16*2 lcd (liquid crystal Display) display to my arduino uno and have linked all the pins up.
Here is my connection:(lcd pin first)
1=GND, 2=+5v, 4=11, 6=12, 11=5, ...
3
votes
2answers
242 views
Arduino Remote controlled RGB LED strip, having issues with brightness/dimming
I have this sketch:
#include <TimerOne.h>
#include <IRremote.h>
#include <RGBMood.h>
int RECV_PIN = 2; // IR-Receiver PIN
int led = 13; // Satus-LED PIN
int modus; ...
1
vote
4answers
95 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 ...
2
votes
2answers
109 views
Exoskeleton Motor Control Code
Background:
I have been working on an exoskeleton project with a group of friends, and I need help. I made another post on the robotics.stackexchange site for the drive system: ...
1
vote
0answers
95 views
Cannot read from 2 I2C slaves consecutively
I am currently trying to communicate between 3 Arduinos using I2C. One of them act as a master, while the rest act as a slave.
I can request data correctly from the master. But if I were to do a ...
1
vote
1answer
47 views
Measure square wave frequency
I'm working with the Arduino Due ans I used the following code:
// period of pulse accumulation and serial output, milliseconds
#define MainPeriod 100
long previousMillis = 0; // will store last time ...
0
votes
1answer
194 views
Sending MPU6050 data over serial to Java/C# Program
I am using a MPU6050 Accelerometer/Gyro breakout (GY-521) to retrieve data and send it to a java program. I have tried several ways, but I couldn't find a way to send the float values calculated from ...
0
votes
2answers
99 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
3answers
139 views
Is it bad coding practice to design a buffer using pointers?
I coded a ring buffer for my Arduino to buffer data from either the SPI or TWI ports. In the .h file I used a pointer for the buffer:
typedef uint8_t *ring_buffer_t;
typedef uint8_t ring_count_t;
...
0
votes
0answers
34 views
Open loop solar tracking system
I am trying to build open loop solar tracking using actuator . My algorithm gives degree of solar position 9AM as -45 degree and 4PM as +45 degree with actuator system .since i don't have any feedback ...
2
votes
1answer
267 views
Why is my real time clock getting the wrong time from my PC?
I want my real-time clock to set its time as the time on my PC. However, when I run the following sketch, the real-time clock reports the time as being 32-33 seconds earlier than my PC says the time ...
0
votes
0answers
93 views
Leonardo based Tachometer?
I'm new here. I'm not a native speaker, so pardon me for my English .
Just received my Arduino Leonardo today. I tried some basic calculations and stuff like blinking and lcd interfacing.
Its ...
3
votes
1answer
89 views
What is causing my Uno to wake up?
NOTE: this code was working perfectly fine in another program.
I have a simple piece of code that puts the Arduino to sleep. When it is finished and intergrated into my project, it will only wake the ...
4
votes
1answer
120 views
Sending MIDI messages using PING ultrasonic sensor
I am working on a project that uses a potentiometer and an ultrasonic sensor to create MIDI signals. This is my first time working with an arduino. I took a class in C++, but am teaching myself some C ...
2
votes
2answers
298 views
How can I make my Arduino code work?
I am trying to make an automatic lock which stays open during different times and on different days. I want the door open Monday through Friday 8am to 5pm. On Saturdays and Sundays I want the door ...
1
vote
0answers
171 views
MCP7940 RTC Library
I am looking to implement a Microchip MCP7940 real time clock into my sensor data logging circuit that I have based on the Uno. Would the most logical solution be to attempt at changing an existing ...
2
votes
0answers
105 views
Bluetooth Master and Slave to track device's locations
I'm trying to create an app for my science fair that uses bluetooth to track people in a determined place.
I was thinking about one Arduino system to receive all the information and transmit through a ...