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
1answer
39 views

Interrupt variable not getting called while executing another part

volatile byte _incomingFlag = 0; void onIncoming () { _incomingFlag = 1; Serial.println(F("You got an interrupt")); mySerial.println("ATH0"); } void setup () { /* First Start the ...
1
vote
2answers
34 views

Arrays and Functions

How can I return a char array from a function? char c[] = getFloat(val, valid); char getFloat(float val, bool valid){ if(valid){ char stringFloat[16]; dtostrf(val, 10, 8, ...
0
votes
0answers
42 views

Two identical functions, one works one doesn't. why?

I'm cross-posting this with the Arduino exchange because I'm not sure if it's a problem with my C or something else entirely. I'm attempting to communicate over WiFi using the process library (Part ...
1
vote
1answer
28 views

Why is my variable not getting updated?

I have the following snippet of code: const unsigned long fiveMinutes = 5 * 60 * 1000UL; unsigned long lastCheck = 0 - fiveMinutes; unsigned long now = 0; void loop() { now = millis(); if ( now ...
0
votes
0answers
43 views

Adafruit Trinket & Ultimate GPS & Google Earth Realtime

I'm using a 5v Pro Trinket that has an Adafruit Ultimate GPS connected and is connected over serial to my laptop. I am not using any fancy parsing code, I'm just letting the GPS spit out the raw data. ...
1
vote
1answer
72 views

Software I2C - Atmega8

I am using Atmega8 with 12MHz crystal, on my breadbord. I can use SDA and SCL pins with default arduino library wire.h, and it works. But I want another pins to use I2C protocol. I tried library, ...
0
votes
3answers
86 views

AES Simplified for Arduino - Having hard time achieving desired result

Okay, here's the story. I'm not very familiar with how Arduino works but learning. I have a project that requires AES encryption on the Arduino Uno. As per a previous question we managed to figure out ...
1
vote
2answers
41 views

Empty char variable

How do I empty all the values inside a variable char array[256];? I tried a for loop assigning an empty value at each iteration, but it doesn't compile.
0
votes
4answers
216 views

deprecated conversion from string constant to 'char*'

What does this error means? I can't solve it in any way. warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
0
votes
2answers
69 views

Number of elements in an array char

What kind of function can I use to know how many elements are in an array char? sizeof() gives the number of 'spaces' available so it doesn't work for me.
0
votes
1answer
83 views

Converting float to String

How can I convert a float value into a String object without implementing any library? I'd like to avoid using char array.
0
votes
1answer
121 views

How to use C Libraries for Arduino code

I have a code in Visual studio that I want to implement in Arduino. But there is a problem. Many libraries usable in Visual Studio aren't usable in the Arduino IDE. How can I use them in my Arduino ...
0
votes
1answer
27 views

Conver char value to variable?

I want to pass the preprocessor values(AT commands) to the Serial.println function. Im trying TCP connection using arduino-SIM900A. I've declared all AT commands to each preprocessor variables like ...
0
votes
0answers
36 views

Linear equation solver Arduino Calculator, printing wrong answer

I wrote a code in C to solve equations, but I don't know why some equations that I input into this calculator, give me wrong values, the algorithm is correct because I execute it in C and give me the ...
1
vote
2answers
258 views

How to read code from Arduino Uno to Arduino IDE? [duplicate]

we can upload a code into Arduino UNO from our computers, but how about reading code? Can we read and get C codes from compiled codes from Arduino hardwares? My second question is that will we read ...
0
votes
1answer
103 views

GPS logging on the intel edison breakout board

I'm working on my project car, and I have decided I would like to have a GPS and log some sensors too. I'm just at a bottle neck here, the sensors I have brought pull about 7v each where I can't pull ...
0
votes
0answers
48 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 ...
0
votes
1answer
36 views

Arduino Yun doesn't link any library

I'm writing code for a project with Arduino Yun. My project is quite simple: it takes a picture with a webcam and saves it in a PNG or JPEG file format. I've already installed the uvc driver for ...
4
votes
1answer
438 views

Basic makefile for avr-gcc

I would like to make a makefile for compiling c programs for the arduino. I am somewhat familiar with make but have never used it with avr-gcc. What is the simplest way I could put the commands below ...
0
votes
1answer
256 views

Reading/writing to Arduino GPIO pins from raw C code

I'm interested in writing a C program without the Arduino IDE and related libraries and am trying to figure out how I can access the GPIO pins for read and write. My assumption is that the GPIO pins ...
0
votes
2answers
86 views

Arduino UNO code ignores variables selectively

This is the first code I wrote for my UNO R3 just to feel out the functions and I've already got some jankiness. Throughout this description I am referring to the first two if statements one inside ...
5
votes
2answers
697 views

Why doesn't my code work in a function, yet works inline?

I'm trying to write a faster shiftOut function, which does not use the slow digitalWrite. In my code I have the original shiftOut, the new shiftOutFast, and the same as shiftOutFast, but inline. The ...
1
vote
2answers
53 views

cannot convert error with pointers

I write a code to store patterns for LED blinking, but I got this error: led_basics:39: error: cannot convert 'char (*)[17][2]' to 'char*' in initialization led_basics:39: error: cannot convert ...
7
votes
3answers
598 views

Writing C Program outside of Arduino IDE?

I like the idea of using the Arduino IDE for simple projects and for getting started with Arduino, but the consensus I've gotten so far is that it is for those who are new to Arduino and/or ...
0
votes
1answer
117 views

Arduino/DuinOS vs Normal C/ARM Programming

I'm trying to understand the difference between programming Arduino hardware (Atel/ARM based) versus 'normal C-based ARM programming'. My understanding is that the Arduino language is cross-compiled ...
0
votes
2answers
47 views

Problems splitting a string to get authentication and command

Good afternoon, In a nutshell I'm having some difficulty with splitting and returning part of a string. Essentially I'm working on the code for transmitting a password (24 character string) and ...
1
vote
2answers
64 views

Why does my LED turn off auomatically after about 18 seconds on its own?

I am using the Arduio Due and I am programing it with Atmel studio 6.2. I have had a HUGE learning curve using this IDE and the Atmel ASF. Nothing is straightforward as it is in the Arduino IDE. None ...
0
votes
0answers
147 views

send SMS for 1 time with arduino GPRS SIM900 if an iput is HIGH (4 Digi inputs)

I faced a problem to send 1 SMS if an input is HIGH,and if it is LOW==> no SMS to send,if LOW to HIGH==> send 1 SMS. this code not working,just sent SMS when I turn the GPRS on,and after nothing is ...
1
vote
0answers
79 views

Sending SMS once with arduino GPRS SIM900 if an input is HIGH

I faced a problem to send 1 SMS if an input is HIGH and if it is LOW no SMS will be sent. The code not working, just sends SMS when I turn the GPRS on and after that nothing happens. Please check ...
2
votes
3answers
189 views

Arduino error in code

i'm making a project and i came across the follwing error. Whan i'm trying to compile and upload the code i'm getting those errors: ShiftRegisterTest1.ino:In function 'int* return_pins(int)' ...
0
votes
0answers
14 views

How to get read user input from DAQ for a given time interval?

I'm using a built-in DAQ simulator. When it opens, it shows 3 different LEDs with 3 pushbuttons, one corresponding to each LED. I'm trying to read the user input from 3 pushbuttons for a time ...
0
votes
1answer
69 views

Running C for arduino

Is there a compiler that I can use to run C on an arduino or any other way so that I can upload C programs to my arduino?
1
vote
2answers
689 views

Convert uint8_t array to uint32_t array

I have this array of bytes, that I need to convert to an array of unsigned ints. Also the function (btea) that needs it, seems to need a pointer. I'm currently using reinterpret_cast which seems to ...
4
votes
2answers
380 views

Problem importing a library in .h file

I have following code: MyApp.ino: #include "DfRobotLcdShield.h" void setup() { } void loop() { } DfRobotLcdShield.h: #include <LiquidCrystal.h> When I try to compile, I'm getting the ...
0
votes
0answers
31 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 ...
3
votes
3answers
291 views

How to calculate phase shift between two square waveforms with Arduino DUE

I have two square wave signals with the same frequency. I want to measure the phase shift between these two signals. There will be a small phase difference between two signals. (0-90 degree) and the ...
3
votes
1answer
447 views

Port manipulation using C code

I'm trying to manipulate the ports of Arduino using C code. I have attached an LED to pin 8 and a tact switch to pin 13 (with a pull down resistor). The code works fine, and the results are printed on ...
6
votes
2answers
582 views

SAM3X8E (Arduino Due) Pin IO registers

How does IO registers of Arduino Due work? On Arduno Uno just set DDRx, then PINx to read, PORTx to write, I'd like to do the same thing with an Arduino Due, but it has many more registers, such as ...
6
votes
2answers
337 views

Arduino interruption (on pin change)

I use the interrupt function to fill an array with values received from digitalRead(). void setup() { Serial.begin(115200); attachInterrupt(0, test_func, CHANGE); } void ...
1
vote
3answers
159 views

ISR executes even though an interrupt is not triggered

I am trying to implement a function queue scheduling system. INT1 is connected to a button and int1task causes an LED to flash. typedef void (*funcptr)(void); TPrioQueue *queue = NULL; void ...
1
vote
3answers
232 views

Programming arduino with Objective-C

Can you use clang, with --mpu=arm, etc. and avrdude to program an Arduino Due (Arm Cortex M3)?
1
vote
4answers
2k views

New to Arduino: Should I learn C, C++ or both (C & C++)?

From what i've researched here is my thoughts on both C++ I heard that you can create libraries using C++ in arduino. And you can use the Arduino IDE to do that stuff. Here is the proof ...
4
votes
1answer
283 views

Chain of, or one big if sentence

(This might be more of a common C question) I want to test several conditions in an IF-sentence if(variable) { // fastest check if(register) { // a bit slower ...
1
vote
2answers
140 views

Is Arduino IDE enough to program with C or C++?

I am using Arduino IDE to program my ATmegas with bootloaders. I can directly manipulate ports, use timers, interrupts, PWM pins and timers, etc. Everything is working. But this question arises: Does ...
0
votes
1answer
64 views

OSC parsing code. Can it be optimised?

I'm using this OSC library and TouchOSC to controls some motors. Right now I'm receiving those two kind of messages: /u/1 // move motor 1 of default steps /u/2 // move motor 2 of default ...
-1
votes
0answers
40 views

DhcpAddressPrinter Example Has No Output in Serial Monitor [closed]

I am new to the Ethernet shield, and I tried to use the DhcpAddressPrinter example but I can't get any output. What I did was.. I connected the ethernet shield to the router using my Ethernet cable ...
0
votes
1answer
351 views

Concatenate two non constant char arrays in Arduino

I have two non constant char arrays. One is "buff" and other is "buffa". I get values in buffa via rf transmitter of other Arduino and I want to append those data to the data inside of buff. Then I ...
1
vote
0answers
254 views

Reading arduino output from serial line

I'm attempting to read data from the serial line coming from the arduino and return it as a string. I have found/modified the following code to do so: #include <sys/types.h> ...
0
votes
3answers
360 views

Can I program Arduino with Python? [closed]

I know that I can program Arduino with python but is it possible to make every project, which can be completed by normal IDE?
1
vote
0answers
167 views

TinyDuino Bluetooth Le to Android or Iphone

I have not used the Arduino in quite sometime so i am rusty in programming the device, but i am getting back into it through the tinyduino. I was wondering if someone could help me? I currently have 2 ...