C is a procedural programming language which is widely used in embedded systems. PLEASE NOTE: Arduino is typically programmed in C++, not C.
0
votes
0answers
24 views
Teensy 2.0++ SDA SCL pins not accesible using ARDUINO software
Hi I was looking to interface Teensy++ 2.0 with MPU6050 for a simple IMU project.
I have done this previously using Teensy 3.1 by trying the project of kriswiner however I also wanted to try it out on ...
0
votes
2answers
40 views
Compare const char * to const char
Using ArduinoJson I have assigned a value such as;
const char* id = root["id"];
in the original JSON id was "1"
if (strcmp(id, "1") == 0) {
// this executes
}
I have an array of structs that ...
4
votes
1answer
37 views
Combine bits from two ports into a single byte
I'm attempting to read the values of 8 pins at a time into a byte.
The obvious answer to this seems to be the Port registers, however with the way the Arduino is wired, I'd have to split my read ...
5
votes
2answers
104 views
Arduino DC motor causes disturbance. What can cause it?
I tried to fix this problem the whole weekend but, after no success I decided to post it here. I would really appreciate any help.
The problem
The Wi-Fi module activates the DC motor and lets it run ...
0
votes
3answers
45 views
Arduino C, Led > binary alternative all lights
I'm trying to alternatively have a random int generate a binary number with 4 lights.
This is my current code, However, it seems that all the lights(leds) go on, I don't think the minus option ...
1
vote
1answer
32 views
exit(0) function shows up an error
So I have been trying to write a code where I use the millis() function to print the milliseconds of on-time of the board using Serial. But the condition is I want to stop printing the value once it ...
0
votes
0answers
42 views
Serial Communication, Arduino and Rpi , C library
I am currently working on a project on serial communication between rpi and arduino, this is the code that I am using from Rpi Side it's in C :
int main()
{
//-------------------------
...
0
votes
1answer
169 views
ESP 8266 with sdk 1.5
By compiling using sdk v1.5 i got following error.Any idea how to resolve it?
mingw32-make.exe -f C:/Users/abc/worksorg/mesh/Makefile all
AR build/app_app.a
LD build/app.out
...
0
votes
1answer
52 views
Arduino Simple Task - sweeping a buzzer and led, not working as expected
Use of the tone() function will interfere with PWM output on pins 3 and 11 (on boards other than the Mega).
UPDATE: IT seems that there is a problem using pin 11 and 13 together but if I use a ...
-2
votes
1answer
40 views
Peer to peer communication
Hello guys ,
I want to perform a mesh network between 3-4 modules using ESP8266 . Any one have idea how to do it?
0
votes
2answers
42 views
Interface pressure Sensor
Hello folks,
I am using G1/4 Pressure Transmitter Sensor 0-1.2 MPa sensor can you guide for programming part.The conversion from bar to pascal or bar to Mpa or pascal to psi.Though I am ...
0
votes
1answer
36 views
Popen command restarts arduino
So I am trying to make a Mac OSX program with Cocoa that will be able to control my Arduino via serial. I currently have the C command
popen("echo 7 > /dev/cu.usbmodem1411", "r");
to try to ...
0
votes
2answers
79 views
Error in my Arduino code “ error: expected unqualified-id before ‘if’ ”
I cant seem to find this error is:
elevator_bug_2.ino:38:1: error: expected unqualified-id before ‘if’
Here is the code:
// these constants won't change. They are the
// lowest and highest ...
1
vote
1answer
61 views
Timer interrupt won't work if the ISR is not set
I am using an Arduino Mega 2560.
I have a code in a c file, that looks like this:
#include <avr/io.h> /* for DDRB, PORTB, etc. */
#include <util/delay.h> /* for ...
0
votes
0answers
23 views
Is there any way to import libcoap into Arduino project?
I am currently playing with libcoap (https://libcoap.net) client-server architecture. I need directions importing libcoap into Arduino project. Or any other way to implement CoAP (constrained ...
0
votes
1answer
32 views
Issue with leOS2 for one-time tasks
I'm trying to use the last version of leOS2 scheduler from Leonardo Miliani ( https://github.com/leomil72/leOS2 ) but I have a strange behavior with a very simplistic ONETIME task.
Platform : Arduino ...
0
votes
3answers
33 views
Problems with linking a library with a c program in linux
I am totally new to C and arduino. I want to run serial commands from a Bealgebone to a 4Dsystems display. Therefore I copied the c library found here into a directory and created a test program ...
0
votes
2answers
121 views
What wrong with that code? [duplicate]
Hi i have made this code
its so simple its should receive data from the computer and send it back via the serial but the problem is he do not what it is suppose to do
when its run its keep sending -1 ...
1
vote
1answer
36 views
Arduino snake on 5110 screen - some help needed
I'm trying to make a snake game using the u8g lib. But for now, only the second body part of the snake follows the head, where I want the whole body to follow the snake's head and I don't understand ...
2
votes
1answer
44 views
How does this code move the bird sprite in this sketch?
I'm teaching this sketch in my class. I understand most of the sketch and can see the class that makes the bird move, but I still don't quite understand how the code makes the sprite "move." I can ...
0
votes
2answers
35 views
Arduino ethernet need help with game logic!
I'm making a game where there are three LEDs and three buttons: 1 LED for 1 button. One has to press the button that has its LED lit. If it is correct, another (random) LED will light up and the game ...
-1
votes
2answers
80 views
arduino project for c programming language [closed]
i am a student from 2nd semester BCA (Bachelor in Computer Application). My group need some project for presentation from c programming language so i thought of using #ARDUINO project for our ...
0
votes
1answer
48 views
Interrupt not firing on motion
I'm trying to get MMA8452Q to trigger an interrupt when motion is detected and wonder if I'm missing something very obvious here.
So I setup CTRL_REG4 to 0x0B with
void MMA8452Q::setupISR()
{
...
1
vote
2answers
76 views
Not waking up more than once?
I'm trying the following code on an Uno. I'm pulling the high side of a pull down 10K resistor to 5V, but it can only be woken once. Just once. Does anyone know why this might be the case?
It works ...
0
votes
1answer
51 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
51 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
60 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
36 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
102 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
175 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
287 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
64 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
5answers
2k 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
229 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
268 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.
1
vote
1answer
611 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
38 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
64 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
633 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
187 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
127 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
48 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
1k 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
748 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
107 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
731 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
72 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
2k 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
225 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
73 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 ...