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
11 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
1answer
345 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 ...
1
vote
0answers
29 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 ...
0
votes
3answers
105 views
ISR executes even though an interrupt is not trigerred
I am trying to implement a function queue scheduling system. INT1 is connected to a button and int1task causes a LED to flash.
typedef void (*funcptr)(void);
TPrioQueue *queue = NULL;
void ...
1
vote
2answers
97 views
Programming arduino with Objective-C
Can you use Objective-C to program Arduino? I know you can use C/C++, and Objective C is theoretically a subset of C/C++, so would it be possible?
1
vote
4answers
583 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
...
3
votes
1answer
276 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
108 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
33 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
26 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
80 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 ...
0
votes
0answers
89 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
224 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
100 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 ...
1
vote
2answers
65 views
Where can I see the output of printf?
I would like to know where I can see the output when I use the command printf. I am programming using the Arduino interface.
Update
I'll add a few lines of code for better understanding:
#include ...
0
votes
1answer
48 views
Sweep with two shift registers
I am working with 8 dual color LED's and 2 shift registers. My connections are in place. But I do not understand how to work with 2 shift registers.
So I am trying to make this: turn the first led ...
1
vote
3answers
163 views
Comparing a char with the symbols '.-'
I'm using the Arduino software to create a Morse code decoder using the serial monitor.
I enter a Morse code such as .- as a text string and it's displayed in the LCD as a alphanumeric text. So if I ...
1
vote
1answer
73 views
How to prevent Ardiuno compiler from merging changing of port pin outputs into a single operation
I want to set one pin's output value, and then set a different pin's output value so that the two pins change value one after the other.
However, the compiler optimises the two calls to change both ...
2
votes
4answers
309 views
ATtiny85 minimum setup to blink led
What would be the (very) minimum schematic to make a ATtiny85 blink a led?
Restrictions are:
There must be a C program compiled and uploaded to it, just like an Arduino board would have. The code ...
0
votes
1answer
230 views
Arduino server to read from multiple clients
Socket programming question here.
My interface comprises of an Android device(client), A wireless module hosting an access point, and an Arduino Uno(server).
My Android client class works when 1 ...
0
votes
1answer
192 views
Read data from 3 ColorPal 28380 simultaneously on Uno/Mega
I've been trying to get an Arduino (I have a Mega and Uno lying around) to read values from a small array of 3 ColorPal 20380, which individually, work as intended with some reflective material. The ...
0
votes
0answers
16 views
Using PBC library on Arduino
I want to know if there is a way to install/use the PBC library on Arduino UNO. I want to implement some cryptographic primitives using PBC library.
Thank you.
1
vote
3answers
118 views
Arduino if else code
I have made this If-Then-Else code, but it doesn't work.
First I tough only the analog code is wrong, but if I take a digital port, the code doesn't work either.
What did I do wrong?
int sensorPin ...
0
votes
0answers
44 views
Using MIDI Callback for receive and send ping?
I have programmed my MEGA2560 to Hiduino firmware in an effort to fabricate an RS-232 <> Midi converter, instead of using Hairless MIDI<>Serial running in the background, to use my fader ...
2
votes
1answer
100 views
ctc mode on atmega 328
I'm trying to use CTC mode on Arduino 1 but I have the following problem.
I need to generate an interrupt on threshold B and A and I have set the prescaler to 1 since I want to generate interrupt A at ...
0
votes
0answers
108 views
Why can't I read anything but Pin 0 of PORTC?
So I am working on this lab for my Embedded Systems class, but I can't seem to read anything but the first bit of PORTC. What's even weirder is that if any of the pins go low the first bit will go to ...
0
votes
1answer
80 views
Using an Arduino for learning embedded C programming
I'm a computer systems engineering student and was planning to buy an Arduino to learn embedded C programming. After researching I found mention that an Arduino may not be a good choice for a beginner ...
0
votes
1answer
57 views
Receiver xbee receiving data while the Transmitter is powered off?
My receiver xbee is receiving data even if the transmitter is disconnected , so if i am sending the string hello world , the receiver will repeat this string .
void loop() {
...
1
vote
1answer
658 views
Receiver xbee receiving data even if the Transmitter is not sending?
TX code:
#include <SoftwareSerial.h>
const int MAX_LENGTH = 2;
char buffer[MAX_LENGTH];
char lineFeed = 2;
SoftwareSerial Xbee(10, 11);
void setup() {
Serial.begin(9600);
...
2
votes
1answer
65 views
How does Arduino IDE for mac deal with functions in other files
I'm a longtime C programmer. I've also done a little C++, a little Java, and a LOT of Objective-C, but am fairly new to the Arduino platform and it's IDE.
So far all my sketches have had a single ...
0
votes
2answers
105 views
Serial data to arduino problem
I cant understand what is going on here , I was trying to find way to send through Serial a number for example 12 and then extract from it number 1 and 2 and store them in two different variables , ...
0
votes
1answer
81 views
Serial input parallel output shift registers with arduino
I need a way to rewrite the switch case part in a more efficient way.
int y , x ;
byte dataArray[6];
void setup () {
pinMode(8,OUTPUT);
pinMode(11,OUTPUT);
pinMode(12,OUTPUT);
...
-1
votes
1answer
599 views
sample average of analog of current sensor
Here is my code. I have 2 problem in below code. This ACS712 sensor is too noisy so i am not getting count value properly .since i need approximate reading i consider curve is linear. and calculate ...
0
votes
0answers
68 views
avr digital lock resetting keys
I am writing a C code for a digital lock with 4 digit password for ATMEGA32. The first part of the code generates numbers upon pressing the buttons on a 4x4 keypad through an interrupt.
I have three ...
2
votes
1answer
97 views
Knowing the Arduino memory capacity
I am using Arduino uno. My data is storing into EEPROM whenever i run my program, it will store multiple data depend on the loop. For my program it calculate 10 sample in 0.1 sec, so 100 sample in 1 ...
2
votes
1answer
378 views
Cannot read from 2 I2C slaves consecutively
I am currently trying to communicate between 3 Arduinos using I2C. One of them acts as a master, while the rest act as slaves.
I can request data correctly from the master. But if I were to do 2 ...
0
votes
1answer
209 views
How do I set Grove GPS to use A-GPS?
I am using a grove GPS http://www.seeedstudio.com/wiki/Grove_-_GPS
I attached the GPS to Serial1 of Arduino Mega 2560.
The baudrate of the GPS is set to 9600.
Library wise, I am using TinyGps to ...
0
votes
0answers
51 views
Open loop solar tracking system
I am trying to build open loop solar tracking using actuator . My algorithm gives degree of solar position 9AM as -45 degree and 4PM as +45 degree with actuator system .since i don't have any feedback ...
1
vote
0answers
78 views
GPS - Speed doesn't update as should - EM408 & Arduino Mega & GSM
I'm developing a system that will get the GPS signal and send it though the GSM with information about position, speed and temperature from some digital sensors.
Currently I'm using the GPS EM408, ...
0
votes
0answers
20 views
How to send sensor data with decimals using radio.write() [duplicate]
I'm modifying a found sketch to send data from a sensor. The initial sketch would simulate sensor data like so:
//generate a random number to represent a sensor reading
uint16_t sensorValue = ...
1
vote
2answers
495 views
Arduino Interrupt Debouncing
I have an issue with debouncing.
I am using a MCP23017 as an I/O-extender with an Arduino. This uses I2C to communicate with each other.
A variable amount of switches is connected to the MCP23017 ...
2
votes
0answers
11 views
Sending variable in url [duplicate]
Working on a arduino code, but its C code. Having the problem that I want a variable with int to increase in a loop to run with the url:
student.cs.hioa.no/~s180343/updatedb.php?verdi=%d
The ...
4
votes
3answers
1k views
How to call C functions from Arduino sketch?
I would like to know if there is a way to call functions that are contained within C files using an Arduino sketch?
My C file declares and defines a function. To save putting the messy function ...
2
votes
2answers
110 views
Replicate a Waveform Exactly with An Arduino Uno
So I've got a waveform that's high for 16ms and low for 2ms repeating forever. I need to recreate that and offsets of that waveform time exactly on a different pin. Right now, I've got an interrupt on ...
3
votes
2answers
404 views
What are the tools that I need to program the Arduino in C?
The Arduino IDE by default is oriented towards C++. The linker for example requires .cpp files and not .c files, otherwise it leads to errors during the linking process. See name mangling if you want ...