Questions tagged [programming]

The process of designing and writing source code as part of a program (or sketch) for Arduino. For questions about uploading code to an Arduino board, use the [uploading] tag instead.

143 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
1answer
1k views

Leonardo-based tachometer?

I'm new here. I'm not a native speaker, so pardon my English. I just received my Arduino Leonardo today. I tried some basic calculations and stuff like blinking and LCD interfacing. Its interesting. ...
2
votes
3answers
1k views

Using an accelerometer with an Arduino as a shock sensor

I really need some help. I have absolutely no experience with accelerometers and have a project that would work great if I could integrate one into it. I am not hinting to have some write me a code, ...
2
votes
0answers
455 views

Do software SPI read from a register using shiftin()

How to read from a register using software SPI, presumably shiftin()? It works using the builtin SPI library + hardware SPI. I seem to be able to write but not read using manual shiftin()/shiftout()...
2
votes
1answer
2k views

How to get response of issued AT command for ES266 on Arduino programatically?

I'm successfully running AT commands via the Serial Monitor. But now I'm issuing AT commands via Arduino code and facing problems getting the correct response. Goal: After issuing AT commands ...
2
votes
0answers
377 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 ...
2
votes
0answers
344 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 ...
1
vote
0answers
53 views

ARDUINO PROGRAM

I have a project that consists in measuring the mass of an object with a strain gauge HX711. so I found an interesting Arduino program and the editing that goes with it. but I have a problem, I ...
1
vote
0answers
53 views

Clear Timer on Compare or CTC in ATmega328P, Toggle OC0A on Compare Match

I want to use the CTC on the ATmega328P to play same notes with a speaker, a project that I find in this book. In the data sheet I read: For generating a waveform output in CTC mode, the OC0A ...
1
vote
0answers
32 views

Troubleshooting Program using sensors and actuators

I am doing a project on waste management. I have to separate waste majorly as metal, plastic and other materials. For that using Arduino Mega 2560. I have connected Inductive proximity sensor @ A0 (...
1
vote
1answer
203 views

Printing elements of char array from PROGMEM

Given: const char* PROGMEM names[] = {"Foo","Bar"}; Serial.print(names[0]); I get garbage output. Is there some function that will print the string from PROGMEM? E.G.: Serial.print(<function ...
1
vote
0answers
60 views

Ideal voltage level for attachInterrupt()

Well I am working on old textile machines, it is taking motor RPM with ISR. I want to read this RPM and publish on web. but the output voltage of this old system is 0 and 22 Volt. (0 Volt when the ...
1
vote
1answer
104 views

Will this sketch eventually fail because of integer limit issue?

I am a novice in Arduino programming and I'm setting up an Arduino controlled, underwater time-lapse camera to take a picture every 2 hours. It's going in the ocean for a month and I want to be sure ...
1
vote
0answers
47 views

Arduino Communication with Xbee

I'm trying to establish a wireless connection between two Arduino's(M0) using xbee s2c, one Arduino as the sender and other as the receiver. But I am not able to receive the message what the Arduino ...
1
vote
0answers
48 views

Zero-ing Compass | Following Magnet Strip Robot

So my problem is purely programming, I understand the problem but can't figure out what to do, Is there a library? should I create my own code for Zero-ing my compass so I don't have value from earth ...
1
vote
0answers
142 views

Installing Optiboot loader for pro mini 3.3V 8MHz

I have tried to install a better bootloader in some chinese Arduino pro mini boards. I have tried the OptiLoader application via an ArduinoAsISP. I failed in some way. The boards got unstable, I can ...
1
vote
0answers
65 views

ALLBOT knee joints not moving

I am trying to write a simple script for an ALLBOT, but am encountering a very peculiar issue. With the following code, I can align all the servos: #include <Servo.h> #include "constants.h" // ...
1
vote
0answers
1k views

ESP8266 library / function for IR remote control

I am using IRremoteESP8266 for reverse engineering Hitachi AX-M76E mini stereos IR controller. I want to read the signal that the remote sends and send the same hexas to the stereos with IR led. ...
1
vote
0answers
200 views

How to pass input from a Midi controller to a function?

I am trying to pass the input[], data1(pitch) from a Midi controller to the waitForButton function. When a key is pressed it sends data1(pitch) into the array input[], and when the key is up the array ...
1
vote
0answers
65 views

Changing function to work with Midi controller instead of buttons

I am trying to change up this function to work with a midi controller instead of buttons most of the code for the function i will be using as is. it just the parts of the code the deal with button ...
1
vote
0answers
33 views

Not hearing PlayBack from code that records and plays back MIDI

I have altered some code that i found online that records and playback midi data from a midi controller. from my testing i am pretty sure that notes are being recorded from my midi controller, i have ...
1
vote
0answers
360 views

How to play Midi from the Sparkfun Mp3 Player Shield?

in the video: https://www.youtube.com/watch?v=zc1zbwheyE0 I suspect they may be using the midi playback functionality of the chip (VS1053b) on the Mp3 shield. how do you playback Midi from the mp3 ...
1
vote
0answers
461 views

Arduino Serial Communication Issue

I state that I have already written a similar question on StackOverflow thinking that the problem is with my computer software. Anyway, after some shell debugs, I notice that the real issue is on the ...
1
vote
0answers
61 views

Issue regarding executing sketch code when not connected to USB

`I have an Arduino Uno A000066 Board R3 that has an Arduino A000079 Motor Shield Rev3 attached to it. Also I have connected two DC Servo Motors to the Motor Shield and wrote the following sequence: ...
1
vote
1answer
2k views

Using MMA8451 accelerometer to count steps

I'm trying to use an Adafruit MMA8451 accelerometer to create a pedometer-type device that counts steps. I'd like to initiate a counter that says "if the x-axis readout is > some threshold, add 1 to ...
1
vote
0answers
244 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
0answers
213 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 ...
1
vote
0answers
205 views

Connection between Matlab and Arduino

I'm trying to connect Maltab and Arduino by this code: arduino=serial('COM7','BaudRate',9600); fopen(arduino); But I get this message: Open failed: Port: COM7 is not available. No ports are ...
1
vote
0answers
436 views

Arduino programming attiny13a

Hello I want to program an Attiny13a with Arduino code. I always have this error when I add repository "no file board.txt" in path. How to successfully configure IDE to able burn on it? I use : Link ...
1
vote
0answers
290 views

How to generate Analog Signal (Voice) to the microphone

I have question about microphone and generating sound signal. I have microphone in my intercom at home. It is simple analog microphone, not digital. What I want is to connect arduino analog ...
1
vote
0answers
1k views

Pelco D Library for Arduino

Does anyone know of any Pelco D libraries available for Arduino? I already have a PTZ joystick controlling 3 PTZ cameras, but I would like to add an Arduino 'intelligent' controller capable of ...
1
vote
0answers
92 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
vote
0answers
556 views

7 Key Educational Piano with Capacitive Sensor

I am working on a project for grade 10 computer science. I am supposed to make a piano that has 7 keys using a capacitive sensor, and the piano is supposed to teach you songs like Twinkle Twinkle ...
1
vote
0answers
532 views

Checking string condition?

I'm looking for my Arduino board to jump to a function based on an if condition, where a string (content) is checked to see if it matches the word FALLEN. However, the if condition never occurs ...
1
vote
0answers
5k views

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
vote
0answers
991 views

MODbus response for configure data

I am not able to receive data. I am able to send data from master but am not getting any response. This program uploaded successfully. I have below setup to monitor data from Modbus. I have included ...
1
vote
1answer
807 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
1answer
134 views

Quick Programming Check/Review

I've been racking my head trying to start programming in a library organized method. My code works, but the translation and split to a .h and .cpp file is riddled with errors. It's gotta be stupidly ...
1
vote
1answer
1k 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 ...
0
votes
0answers
7 views

nodemcu nack error bh1750

I am trying to run a simple example of bh1750 on my nodemcu, code is #include <Wire.h> #include <BH1750.h> */ BH1750 lightMeter(0x23); void setup(){ Serial.begin(9600); Wire.begin(...
0
votes
1answer
24 views

Creating an array with the length coming from a library

When creating an array like in the sketch #include <Lib.h> int myArray[Lib::len]; void setup() {} void loop() {} the variable len must be an integer constant that is known at compile time. ...
0
votes
1answer
16 views

Arduino - Extracting Multiple Strings from Serial Read

I am trying to write an Arduino code that reads a long string, example <11,22,33>, through the Serial Monitor and then stores the 11,22, and 33 into separate bins of a matrix array. So the user ...
0
votes
0answers
31 views

Arduino Due: Measuring the time between pulses

I have a 'pulse train' generated from a photo interrupter and slotted disc mounted on a rotating shaft. My goal is to measure the time between each rising edge. I have looked at the data sheet for ...
0
votes
0answers
26 views

Made a light controller for the holidays

I am a new the world of Arduino. I found on YouTube, how to build a light controller (https://www.youtube.com/watch?v=WvG9c84ApFA&t=39s). I follow every step but it doesn't work. Here are some ...
0
votes
0answers
33 views

Where is tcp.c?

This question is related to my other question, which I already answered. I want to add modify tcp.c to include my own code. The problem is I can't find tcp.c. The first thing I tried was looking in ...
0
votes
0answers
28 views

HC-SRO4 always returns zero no matter what I do?

Wondering if it's the sensor or the code? can anyone help? I've used the code here /* HC-SR04 Ultrasonic Sensor with LCD dispaly HC-SR04 Ultrasonic Sensor VCC to Arduino 5V GND to Arduino GND ...
0
votes
1answer
35 views

Where is tcp.h?

This is for an esp8266 project that uses EasyAsyncTCP. In EasyAsyncTCP.cpp they #include "lwip/tcp.h". But I can't figure out where that file is. I've found a tcp.h in the following directories on ...
0
votes
0answers
27 views

I cant seem to form a code to read both DHT11 and pulse sensor

I combined both the heart pulse sensor code and the DHT11 code. I can get a decent reading from the pulse sensor however an error is given from the DHT11 sensor. I am able to get them to function ...
0
votes
0answers
41 views

pin change interrupt on arduino Due

Greeting! I am finding it difficult setting up a pin change interrupt on an arm board ( I am using Arduino due). I found a sample online which I have used but I discovered that when ever an interrupt ...
0
votes
0answers
33 views

how to get text box values from webserver of esp32 and print them in to serial monitor by using <webserver.h> library

Actually I'm trying to get the values from esp32 server webpage. Suppose there is a web page containing some text box fields, user has to enter some details in it and this details I want to be print ...
0
votes
0answers
12 views

Trying to get pseudorange data out of NS-RAW GPS

I have an NS-RAW CPGPS and I am trying to get GPS Data using an arduino. Do I just use the serial to get the data out of it and just convert and extract the data to what I need?