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.

Filter by
Sorted by
Tagged with
1
vote
1answer
314 views

Uploading Error: no programmer has been specified

Whenever I upload a code I get this error: avrdude: no programmer has been specified on the command line or the config file Specify a programmer using the -c option and try again I am able ...
1
vote
2answers
13k views

Change the baud rate of HC-05

#include <SoftwareSerial.h> SoftwareSerial BTSerial(10, 11); // RX | TX void setup() { pinMode(9, OUTPUT); // this pin will pull the HC-05 pin 34 (key pin) HIGH to switch module to AT mode ...
1
vote
1answer
5k views

strtok problem while parsing String

Here is my code. The incoming string is "*CRB12344,Temp25,Humidity55,CC5#" I am unable to get value of Temp which is 25 and Humidity which is 55 and CC which 5. It only display the value of CR i.e ...
0
votes
3answers
5k views

Pass variable in a URL

I am working on code where I am able to manually enter the value in the URL to let the PHP code save it in the database, but I'm unsure how to do it with a variable in a loop running. This is the URL: ...
0
votes
1answer
78 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
1answer
60 views

How I can make alarm on off?

I want to do is BEEP! to show that the program is running. #define SPKR 4 //this is the digital pin that you plugged the red wire into void setup() { pinMode(SPKR, OUTPUT); //set the ...
0
votes
2answers
6k views

When to use different variable types? [closed]

There are several different types in the Arduino programming language. They each have different applications that can use up the limited RAM in the Arduino. When should i use each?
0
votes
2answers
2k views

What sensor would work for soccer ball detection efficiently using Arduino?

I want to make a soccer goal counter using Arduino and some sensors. I built using an ultrasonic sensor, but it does not detect if the ball is moving too fast. Are there any other sensors I can use to ...
0
votes
2answers
239 views

Can I use the same Data Registry for both input and output pins?

This is for a class in which we are not allowed to use the Arduino Library (Not my choice or preference). I know to use DDRB for the B pins. This is the code that I have so far: //Global pointers ...
0
votes
2answers
445 views

Optimizing code to use less Flash Memory and SRAM

I'm trying to reduce my sketch size and managed to reduce both SRAM and Flash memory. From: 1570 SRAM - 32144 Flash memory To: 644 SRAM - 19458 Flash memory This are what I've done so far: ✓ ...
0
votes
3answers
22k views

Error: Function not declared in the scope

I want to make a timer library. The cpp file I have written is: #include "avr/interrupt.h" #include "Arduino.h" #include "AllTimer.h" AllTimer::AllTimer() {} void AllTimer::dofun(void) { TIFR1 ...
0
votes
1answer
113 views

problem with bitwise OR

I have this code, in which I try to "glue" four bytes in order to construct an unsigned int. I shift left the bytes and "add" them using the OR operator. unsigned long number1; unsigned long ...
0
votes
1answer
62 views

Assigning an empty array row to reference [duplicate]

int colors[][3] = { { 255, 0, 0 }, { 0, 255, 0 }, { 0, 0, 255 }, { 253, 7, 210 } }; int (*EXCLUSIVE_COLOR)[3]; I have a two-dimensional array to store some color values. I have a 2nd ...
0
votes
3answers
2k views

Building a Vector class in Arduino

I'm struggling with this issue that I can seem to get around of. When defining a vector class, I'm seeming to get some issues when deleting the allocated pointer. Oddly enough, this only happens ...
0
votes
1answer
7k views

Many “expected `)' before ';' token” errors

As the title suggests, I have many "expected `)' before ';' token" errors. The issue is, I have this stuff in. So now I am confused, why am I getting this if the things are there. I am new here and ...
0
votes
2answers
371 views

Are lambdas a good way to improve readability in this instance?

Disclaimer: The following code hasn't been compiled, and probably won't work in any way. This is just for opinions relating to this Arduino question as I'm still learning and experimenting with ...
0
votes
1answer
101 views

Program doesn't read memory well

My program does not read the contents of the memory card, in this case the file "objects.txt". What I wanted to do was: the program reads the objects contained in the text file and allocates the table,...
0
votes
3answers
4k views

Arduino Mega with two Arduino Unos as slaves via I2C?

Good morning! This is my first post here, and my first time diving into the world of microcontrollers. Bear with me, as I describe this theoretical project. I've got an Arduino Mega 2560, two ...
0
votes
2answers
5k views

how to change variable when a button connected to pin 2 is pressed

Hi i am writing a code where, i have to switch a variable called toggle from 0 to 1 to 0.... every time the button is pressed (the button is on a 2 pin). I am a little lost as I am new to arduino need ...
0
votes
2answers
5k 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
3answers
265 views

Code getting stuck waiting for GPS Output

I'm basically trying to make a device that pulls the GPS information from a SIM808 and pushes it to a server online via GPRS. I am sorry as I am not good at programming so ive spent days trying to ...
0
votes
1answer
1k views

HMC5883L not working in continuous mode!

I'm just starting with the HMC5883L, I'm writing my code with C and also my own I2C library. I noticed that the values on the Arduino IDE's serial monitor are constant. Then I developed a function ...
0
votes
1answer
427 views

Trying to save .wav files with new name every loop

I have built a set up with an Arduino UNO hooked up to a switch, so that whenever the switch goes from HIGH to LOW it saves audio to an SD card. I am using the TMRpcm Library. The problem is the ...
0
votes
2answers
2k views

The fastest way to read out a digital pin state in an Arduino Due

What is the fastest way to read a digital pin status in an Arduino Due? Is it possible to achieve speed in the Nanosecond area? With which type of code I can achieve this? Edit: This question is not ...
-1
votes
2answers
77 views

Keyboardmessage on Arduino UNO

Can an Arduino UNO and Arduino Leonardo do the same things? Some of the examples in the Arduino software say to use Leonardo e.g. KeyboardMessage.
-1
votes
1answer
495 views

Arduino Uno coding problem voltage varying [duplicate]

I was wondering whether anyone could help me... I am using an Arduino Uno and I am writing my code in the Arduino IDE. I am trying to implement the code so that the output voltage can be varied from 0 ...
-2
votes
1answer
121 views

Adafruit motor shield v1 Need help Running 3 DC motors simultaneously?

My project is that I am building an animated (singing, dancing, head turning, and arm waving) snowman. I have 3 DC motors for individual functions that are to be run via Arduino Adafruit V1 card ...
-2
votes
2answers
21k 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 ...

1 2
3