C is a procedural programming language which is widely used in embedded systems. PLEASE NOTE: Arduino is typically programmed in C++, not C.

learn more… | top users | synonyms

1
vote
1answer
26 views

Blinking cursor on Arduino is inconsistent and misses inputs

I am trying to write a part of a program that prints time and allows the user to move a cursor across it. I have the following code, but there are a few issues with it. #include <...
1
vote
1answer
23 views

Moving cursor on LCD and changing highlighted value

I have the code shown below. The goal is to change the value of hours, minutes or seconds based on where the cursor is placed. #include <Adafruit_RGBLCDShield.h> #include <utility/...
0
votes
1answer
15 views

Make action happen after time is passed using interrupts

I am trying to create a code which prints to the LCD a message once a certain time is passed. #include <Time.h> #include <TimeLib.h> #include <Adafruit_RGBLCDShield.h> #include <...
1
vote
0answers
40 views

Using EEPROM to write a counter value

I have made a program that increments a counter everytime the up button is pressed. I am trying to write this value to EEPROM, so that when I turn my board off and on again, the value before power off ...
1
vote
1answer
29 views

Formula for decision making when in contact with an obstacle using Arduino

I am currently working on an obstacle avoidance robot project and I have seen numerous algorithms for obstacle avoidance a very good example is this one but unfortunately non of those algorithm works ...
3
votes
1answer
34 views

ESP8266 not sending temperature data to text message

i am trying to use a ESP8266 module to send temperature data using twilio and send it to my phone via text message. However it does not send the sensor data but the text i placed. Is it possible if i ...
1
vote
0answers
19 views

Arduino -> Processing conversion: creating mux channels

As the title alludes to, I'm in the process of converting an Arduino sketch to a Processing sketch. So far, mostly pretty straightforward. I'm running into an issue with creating an array of ints for ...
1
vote
0answers
22 views

Having difficulty figuring out angles x and y from Quaternions obtained from MPU6050! [closed]

I have a mpu6050 which I am transmitting the quaternions from it and I want to calculate angles x and y from it. I have data from quarternions in which i transposed it to axisAngles. The setup I have ...
0
votes
1answer
44 views

How to convert uint8 to int for maths operation in Arduino? [closed]

I am receiving a string from my bluetooth terminal in uint8 format. I want to convert it to integer for further processing. How can I do this? I tried toInt() but it is not working. Please help. ...
1
vote
1answer
28 views

how to send argument to ESP8266WebServer objects on function

this probably simple thing to do however I can't think of a way to pass argument to function call ESP8266WebServer server ( 80 ); void toggleRelayOne() { char temp[400]; String msg = ""; if (...
0
votes
1answer
60 views

How to read NodeMCU GPIO pin status? [on hold]

I am setting up a page on NodeMCU running as a web server and I want to be able to turn on and off a light based on the url being clicked. I want to know how I can get the status so that I can set ...
0
votes
2answers
72 views

Obstacle avoidance algorithm

TARGET The task I have taken as a challenge is to make a GPS-guided robot incorporated with features like Arduino for programming, ultrasonic sensors for obstacle avoidance and a GPS module to ...
0
votes
3answers
59 views

DC Motor's don't stop immediately

Functionality I have written this code below for a buggy to continue moving forward until there is an obstacle which is <= 25cm both motors should stop. Result both motors stop when there is an ...
1
vote
1answer
29 views

How to convert macros for Arduino code?

I have a piece of code I'd like to make Arduino editor friendly. The code is written in C and contains macros the Arduino IDE can't deal with. Is it a good idea to turn those macros into functions? #...
1
vote
5answers
113 views

How to execute three functions at the same time? [closed]

How to implement three functions, which can execute in the same time (function of input random variables)?
1
vote
2answers
78 views

Weird result printing an array using a loop

first of all I'm sorry for my english. My problem is that I want to use an array of numbers on a funcion, but I'm getting a weird result inside a for loop. Doing some tests I've seen that it happen ...
1
vote
2answers
59 views

Arduino whack-a-mole game not working

everyone , I am new to this. Currently I am trying to make a Whack-a-mole game for my school project. There will be a total of 6 moles (correspond to 6 led which will light up randomly). At each ...
0
votes
2answers
34 views

Need clarification with arduino syntax

I've been learning how to program this fine piece of equipment but i seem stuck. I came upon the "Knight rider" example where you are supposed to blink LED's from one side to another and i can't ...
0
votes
2answers
52 views

What is the opposite of this data operation?

If I store in an array a double-value in this format, in which format I should be able to read the same double out? double myDouble = 12.123456; byte myArray[] = {0x00, 0x00, 0x00, 0x00}; myArray[0] ...
0
votes
2answers
40 views

Showing chronometer on PC controlling the begining and end of time by Arduino

I'm really new on this Arduino thing, so I don't know whether what I'm gona ask is feasible or not. I'd like to make a chronometer in the computer but the controlling button (beginning and end of ...
1
vote
0answers
43 views

One of my my buttons is interfering with the other (i think)

So for school i have to make a code for my arduino, that let's me turn 4 led's on and off (as an input) with 2 buttons (one to select the led, one to toggle the led), run the inputs trough a logic ...
1
vote
1answer
50 views

Setting the sampling rate for timer interrupt

I had performance problems with the data acquisition and after some reading on the web, someone told to define a timer with the frequency I need (50hz): // TIMER 1 for interrupt frequency 50 Hz: ...
0
votes
1answer
50 views

Weird formatting behavior with sprintf function

I don't know why but since yesterday, my Arduino sketch returns weird data. I've check eaches inputs and the returns values are ok. But that line: sprintf(read, "%d;%d;%d;%d;%d;%d;%d;%d\r", x, ...
0
votes
3answers
109 views

How can I concatenate multiple byte Arrays into one Array

I have three byte arrays. I first change their values during runtime and after that I want to combine them into one bigger 4th array. byte a1[] = { 0x01, 0x00, 0x01 }; byte a2[] = { 0x00, 0x11, 0x01 }...
0
votes
2answers
37 views

Push to 2D array (log) but last value pushed is everywhere

I have this simple that is supposed to keep a log for me with a fixed number of entries. When I add to the log the oldest replaced is by the second oldest etc and the new entry added. Except when I ...
0
votes
0answers
64 views

max7219 chained display showing mirrored text

I'm using a max7219 like this one max7219. When I first tested my circuit, I used an 8x8 display and the code worked just fine. Now, after I modified the code with the one that can be found online at ...
0
votes
1answer
167 views

Help: convert Arduino code to avr-gcc code [closed]

I need to convert Arduino code to avr-gcc code. This is code: #include <Servo.h> Servo myservo; void setup() { myservo.attach(11); } void loop() { myservo.write(67); } I use Arduino ...
0
votes
1answer
22 views

Wait for serial input otherwise start with preconfigured options

I need to input config parameters from serial input. After a period (1 min) with no input I would like the program to start with preconfigured parameters. Currently in the loop() section I use Serial....
-3
votes
2answers
45 views

Led cube circuit [closed]

I want to make a Led cube of 8*8*8 and I want to control all the led. Can you tell me ho to build the circuit and the cube without multiplexing so that all the led can be controlled? Thank you.
2
votes
1answer
106 views

while(1) loop blocks program to enter interrupt

I want to build a program in C that enables / disables a passive matrix display. But my problem occurs before I can even implement one function of this display. I have a simple switch connected to ...
1
vote
1answer
71 views

How to send information from a web-site to the arduino?

I currently have an Arduino Mega + an Arduino Ethernet shield, I would like to know if it's possible to send data to the arduino from a web-site hosted on the shield itself. So that when someone press ...
3
votes
1answer
84 views

Making an automated watering system with Arduino

I am trying to make an automated watering system using an Arduino. Here is my wiring diagram: And here is my circuit wired up: Here is the code that I'm using with Arduino. The code seems alright ...
0
votes
1answer
37 views

Printing multiple double qoutes in print statement

I'm trying to print multiple quotes in a Keyboard.print() function but when i try to escape the character with \ at $output =\"$HOME\Misc\nc.zip\"" and the string does not get recognized by the ide. ...
0
votes
2answers
53 views

Timer for how long button is not pressed

I would like to timer for how long a button is not pressed. So actually if(buttonState == LOW 'for two seconds') than execute the code that comes after it. But the problem is while the user is still ...
0
votes
2answers
127 views

Use of struct and sizeof in C for Arduino

I am a newbie in C and I can not understand the point of using a structure in C. Could someone explain to me what is the point of defining a structure in C programming? For example, this code(written ...
0
votes
1answer
159 views

How to break out of a loop if it is contained in a function

I am trying to figure out how to break out of a loop if it is being called from a function. I have a similar post, here, that I've decided to do something with the Arduino onboard LED, to isolate it ...
1
vote
3answers
140 views

Traffic lights using timer

My traffic light code for the ardunio doesn't run as I was wondering if anyone could point out where my issues lie. The red and green LEDs should be on for 15 seconds and the amber on for 5 seconds. #...
4
votes
2answers
99 views

How to move my robot in the right direction?

After all there is more question poping up then answers i decide to upload the pdf where is everything writen, like the wire, motor type and what we can and can't use. Here is the link pdf format of ...
1
vote
1answer
112 views

AVR timer overflow interrupt not working

My problem is an interrupt service routine (ISR) that seemingly never executes! Here's some info on my set up: I am flashing an avr attiny85. I have the bare bones of a project set up so far with ...
0
votes
1answer
38 views

Comma between two values in a macro

I am working on a project involving an Aduino and screen. As i was going through the u8glib (Arduino Monochrome Graphics Library for LCDs and OLEDs), something caught my attention: #define ...
1
vote
2answers
68 views

Arduino creating delay function

I am trying to make my own delay function. Briefly mydelay function is calling toggled function every secs seconds. The code is not well written, i know (this is the first version). But i am just ...
1
vote
0answers
89 views

troubleshooting - Turn on a single led in a ws2811 ledstrip with an arduino Uno with FastLed

I want to to turn on a single led in a ledstrip running on ws2811 with an Arduino Uno. The problem is that when I try to turn just one of them on, they all three light up. The strip is a 3-wire ...
0
votes
2answers
75 views

digispark - 2 pin push button to iterate through an hashmap

I'm trying to create a project with my digispark where i can iterate through an hashmap, when i press the push button the digispark writes via digikeyboard the values from an hashmap. Each time i ...
0
votes
5answers
161 views

How to run multiple functions one after another?

I want to fade a red LED up and down, then a green LED up and down, and repeat the whole cycle indefinitely. I've been trying to run multiple functions one after another. However my current code ...
0
votes
2answers
100 views

Inconsistent response AT command

I'm building a vehicle tracker with Arduino shield with Waveshare SIM 808. I am communicating with the Arduino via AT commands, and came across the following problem: The method "leserial ()" returns ...
1
vote
1answer
36 views

Binary message formatter

I am currently developing an IoT device with arduino and i want to minimise the data payload. First i used json which is not very efficent in fixed messages (the format will always be the same). Then ...
2
votes
2answers
62 views

How to animate a LED Strip via wifi? [closed]

I'm remotely connecting my phone to an arduino MKR1000 via wifi, and sending data via HTTP GET (so to switch on the debug LED, I just need to navigate to http://192.168.1.1/debug/H, for example). Now, ...
-1
votes
1answer
47 views

Keep References Between Objects

I'm trying to recreate a small tween engine so I can interpolate values, leds hue, saturation and brightness in a easy way. I'm having trouble to reference the value to interpolate into my tween ...
0
votes
1answer
110 views

Using pointers with Arduino

I am learning about pointers. I was wondering how the memory address is defined in programming. I get different outputs depending on the format I choose for memory address. So I was wondering if it ...
1
vote
2answers
163 views

Most memory efficient way to program

I currently know 3 ways to do a program. Which one of them is the most memory friendly. Note that the example code is simple (blinking a led) and the final code will be VERY VERY complex. Also, the ...