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

0
votes
0answers
23 views

Split a string by a chosen character [duplicate]

My question is very simple but with thorough googling I couldn't find anything I could understand. In Python there's a function which allows you to take a string for example: "String String String" ...
0
votes
2answers
43 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
49 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
0answers
24 views

Controlling Adafruit Neopixel, function not displaying?

while I'm relatively new to the arduino/neopixel community, I'm fairly experienced with C programming and am confused as to what the issue I'm having here is.. I wrote a function to control my ...
0
votes
1answer
58 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
49 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
83 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
42 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
30 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
47 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
30 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
41 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
115 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
62 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
28 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
52 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
44 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
51 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
129 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 ...
0
votes
1answer
37 views

Get pin input status without using the arduino library

I am not allowed to use the Arduino Library (or any Library) for this program. How would I check the input of a pin? I found two different functions: In Arduino.h: #define bitRead(value, bit) (((...
1
vote
1answer
40 views

How to correctly code a LED STRIP?

I recently bought a 5050 RGB 12V 3A LED strip and I set it all up with my Arduino and run this code (from adafruit website), everything is good: Example Code Once you have the strip wired up, it is ...
0
votes
1answer
113 views

From Wiring to pure C

I'm using the Teensy 2.0 (atmega32u4) and decided to switch from Arduino IDE with Wiring to pure C. I think it's much more useful to master programming microcontrollers on that level. Wiring seems to ...
1
vote
0answers
35 views

Arduino code not starting at beginning after poweroff

I created a few Arduino-XBee temperature sensor nodes that send data to another XBee node.js server. I'm running into a few issues trying to write a function to initiate a handshake and receive an ...
1
vote
1answer
27 views

Pass custom element of an array from an inherited class to main sketch

I'm building a base class that creates color patterns using FastLed's CRGB structure. I use the base class as inheritance for another more specific class that modifies a vector of colors (Pixels[]) ...
1
vote
2answers
65 views

AVR (Arduino Uno) Serial.print and Serial.println only printing 1 or 2 chars

I first used the Arduino IDE but now I'm using PlatformIO which is awesome. But I have some big trouble with Serial.print() and Serial.println(). To show this error I have the following example code: ...
-3
votes
2answers
55 views

Errors in code, LM35 temperature logging to web server

trying to experiment with Wemos D1 and LM35. Need to have temperature reading on the ESP IP. Found the following project to be exactly matching my requirements but I am having certain errors in it. ...
0
votes
0answers
14 views

Iqs316 proximity sensors using with Arduino?

Does anyone know how to use the iqs316 touch sensor using for Arduino? I only found the setup code for pic18. I don't know how to setup the iqs316 in Arduino. Please share with me if you know.
0
votes
2answers
66 views

The most effective way to format numbers on Arduino

I made a big search about how to Format Numbers with the Arduino. I want to format unsigned Longs into a String in this format: "23,854,972". The most of the snippets I found work only with the ...
1
vote
1answer
50 views

max7219 chained display showing text only on the first display

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 and changed the display with the chained ...
2
votes
0answers
42 views

Issues graduating to AVR-C

I'm trying to make the transition from coding in the arduino language to AVR-C, but I'm having some issues with my microcontrollers. I don't have an ISP, so I'm using one of my Arudino UNOs with the ...
1
vote
2answers
669 views

How do I convert a float into char*?

Asked this question on Electrical Engineering Stack Exchange and was directed here: Pretty self explanatory; how would I go about converting a float into a char*? I have code in which the float '...
1
vote
2answers
303 views

Arduino- how do I convert a float into char*?

Pretty self explanatory; how would I go about converting a float into a char*? I have code in which the float 'resistance' is constantly being updated. I would like to be able to update the variable '...
1
vote
1answer
57 views

What does 16u and 128u mean?

The below is a snippet of a code for operating SI4455 Rf module with Arduino. I have some doubts which I'd like to seek some help in clearing. byte numOfBytes = *pSetPropCmd++; if (numOfBytes &...
0
votes
1answer
32 views

How to convert char[] to int with fail\success control?

this is more like C question, but i failed to google this. i expect a command parameter in char[], but there may be no argument passed at all, so i need to try to parse this char[] to int and if ...
0
votes
1answer
48 views

Data transfer using SPI

Sorry for my code is long and my English is not good. I'm working with 8x8x8 LED cube project using Arduino nano. I tried to understand code, but I don't understand how cube[][] data write on pins. ...
0
votes
0answers
216 views

cannot convert ‘String’ to ‘const char*’ for argument ‘1’ to… How to send a String by wifi?

When I try to send a normal string like "Hello" my example code works, but if I try to send it like a String variable it calls an error. cannot convert ‘String’ to ‘const char*’ for argument ‘1’ to ...
0
votes
0answers
44 views

Good guides to learn Arduino preferably with C and without IDE

I have played around with Arduino Uno and browsed through some basic introduction guides. I really like that it has been made easy to start programming via IDE and you get the led blinking in no time. ...
3
votes
1answer
48 views

Informations lost in a string

At first, I sorry if I make some English faults but I'm French. So, I'm making a connection between a client and an Arduino Uno. I receive all data that I need but when I send a response to my ...
0
votes
0answers
61 views

Response to a client

I am new (and French) so, sorry for my English. I am developing an Arduino application with an Arduino Uno and an Ethernet Shield 2. I need to receive some data from a client (like, e.g. which ...
0
votes
1answer
42 views

PWM output voltage too high

I'm experimenting with PWM with the code below, but (according to my analog multimeter) the voltage on the output pins reach up to 5V whilst the largest analogRead(IN1) value is only around 700: ...
0
votes
1answer
286 views

compare uint8_t to char array

I am not actually using ad arduino but an atmel chip. but my question is c microprocessor related I am reading an uart which returns data in the form uint8_t [100] I can print the return just fine, ...
1
vote
1answer
76 views

Unable to replicate Arduino code into ATmega8 code

I am trying to replicate an LTC Audio Decoder code from Arduino Uno into AVR ATmega8 which I got from here. My Arduino Uno code is working great. Here is my Arduino Uno code: #define one_time_max ...
0
votes
2answers
96 views

Issue with IF statement condition

I am using 2 accelerometers connected to an arduino. The code below does not work. > if((acc1 >= 20 && acc1 <= 40) && (acc2 >= 20 && acc2 <=40)) //If acc1 is ...
0
votes
0answers
66 views

Low Power Mode on Blend Micro

I am making a project which envolves an arduino (redbear blend micro) . Basically I followed the getting start procedure to put things working in the IDE and it's done. For now, in order to save ...
3
votes
2answers
93 views

What is the Arduino compiler's version of `__unused` for function parameters?

When I first started with the Arduino environment I noticed that it had File | Preferences | Compiler Warnings set to None, so I set it to All - and there were many, many warnings in the supplied ...
3
votes
1answer
115 views

How to Implement Simple, Quick HMAC on Arduino

Hi I am a research student working on securing the communications in Controlled Area Networks (CANs), and I am using Arduinos to simulate one of these CANs. My goal is to use HMAC to implement ...
0
votes
2answers
98 views

Would rewriting my code in C help reduce RAM usage? [duplicate]

So my program fails to run because there is not enough room for my variables as well as the Arduino Core and Stack. I can't find any more ways to optimize my program so I'm thinking about just ...
0
votes
0answers
36 views

Modscan Request format

I have downloaded the modbus RTu library from below link. The code seems working for me. I Need help in Modify sending request format with same library function. Here is My part of code. I am also ...
1
vote
1answer
177 views

Reading a .csv file element wise

I'm fairly new to arduino programming and C/C++. I would like to read a .csv file element wise, and send each element via. a nRF24L01 tranceiver to a raspberry pi. Right now I'm able to read the .csv ...
1
vote
0answers
51 views

Modbus Protocol RTU

I have simple code working on Serial Communication asn below. With Same data i would impliment Modbus protocol> I have Used Modbus library for arduino earlier which works fine with 9600 baudrate and ...