Questions tagged [programming]

The process of designing and writing source code as part of a program (or sketch) for Arduino. For questions about uploading code to an Arduino board, use the [uploading] tag instead.

Filter by
Sorted by
Tagged with
-1
votes
1answer
20k views

arduino program got error expected //primary-expression before ')' token error: //expected ';' before '}' token E

#include "pulse-sensor-arduino.h" #include "Arduino.h" #define PulseSensorbegin int pulsePin = 0; int blinkPin = 13; int fadePin = 5; int fadeRate = 0;...
2
votes
3answers
45k views

Make a PC graphical interface for Arduino - Any easy software? [closed]

What's the best/easiest software to make a PC-Arduino interface? Ideally, I need to create a .exe that shows up a simple graphic interface, where the user can display data acquired from sensors ...
2
votes
0answers
78 views

Where can I find beginner tutorials for the Arduino? [closed]

I am new to all of this so anything is helpful.
3
votes
2answers
3k views

Waking Raspberry Pi on time schedule using Sleepy Pi

I'm have a Sleepy Pi and am having extreme difficulties trying to program a wake/sleep cycle. Sleepy Pi is an Arduino board with a RTC. My ultimate goal is for a time-lapse project. I have the ...
0
votes
3answers
637 views

Arduino UNO does not get recognized by PC(no USB connecting sound), also TX and RX not blinking, neither are lit

I am trying to build a robot, which needs motors to roll around. So I was trying to control two DC motors with H-Bridge that comes with Arduino StarterKit(H-bridge motor driver [L293D]). I used Sketch ...
3
votes
4answers
13k views

Can't program Arduino via Bluetooth (HC-06) with a Mac

I bought a HC-06 Module for my Arduino Uno the other day, yesterday it arrived and I'm having trouble using it with the Arduino IDE. I set it up, connecting 5V, GND and RX/TX crossed. After a bit of ...
2
votes
2answers
560 views

Programming an Array of ATTiny

I am designing a board for my electronics project and i am using a number of ATTiny85 for it. The ATTiny's will be SMD so i will not be able to remove them for programming. Moreover all of the pins ...
6
votes
2answers
3k views

Random(min,max) Function only giving ~50 range no matter what the values?

I can't get the min,max range to function properly. Monitoring the serial, only gives out ~50 difference from the min. I then added truerandom.ino to try to fix, but no help. const int ledPin = 13; //...
0
votes
1answer
721 views

Question about viability of building a Bill Counter machine

I have a need for a bill counter at my current job, but besides counting bills we also could use a machine to count admission cards. The idea is to either buy a bill counter machine (like those that ...
17
votes
6answers
5k views

How can Arduino source code be tested automatically (continuous integration)?

I'd like manage my Arduino source code (projects and libraries) under source control with continuous testing. How can I automatically compile the code with continuous integration tools, to make sure ...
0
votes
1answer
1k views

coding standards for bigger projects

I'm starting a decently sized project around arduino/ATMELavr, and I came to wonder if there are any commonly accepted C/C++ coding standards or style guidelines specifically aimed at embedded C++/...
2
votes
0answers
568 views

7 Key Educational Piano with Capacitive Sensor

I am working on a project for grade 10 computer science. I am supposed to make a piano that has 7 keys using a capacitive sensor, and the piano is supposed to teach you songs like Twinkle Twinkle ...
0
votes
3answers
265 views

Programming Arduino

I'm new to electronics. Professionally I'm a software developer. I want to know whether it is possible to program Atmel AVR 8-bit and 32-bit Microcontrollers using Arduino IDE. If yes could any one ...
1
vote
2answers
1k views

Enabling quicker and more accurate MindWave Mobile detection?

Currently I am trying to get a Mindwave Mobile device to operate with an Arduino Uno. I'm following the guide here. However the sample code given doesn't work very well. I have been trying to get a ...
0
votes
3answers
22k views

Error: Function not declared in the scope

I want to make a timer library. The cpp file I have written is: #include "avr/interrupt.h" #include "Arduino.h" #include "AllTimer.h" AllTimer::AllTimer() {} void AllTimer::dofun(void) { TIFR1 ...
0
votes
3answers
3k 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
1answer
3k views

Multiple Definition of "_Vectors"?

I'm working on an arduino project that uses the GSM Shield and the eHealthSensor from Cooking Hacks. However I ran into an issue in which the interrupt vectors from the header/cpp files used are being ...
0
votes
1answer
45 views

Use website to communicate with Arduino WirelessProtoShield

I have a small office with wireless network, is it possible to make a wireless doorbell? Practical example: Arduino is connected to the main wireless network and has a static ip, i have a website that ...
1
vote
2answers
415 views

how to make arduino as mind thought reader?

I'm trying to create arduino base mind reader... And for that I thought that EEG electrode connected to arduino and then the data send to arduino in 01 form .. But I facing problem in how to convert ...
6
votes
1answer
3k views

What are the benfits of global variables over static class members?

On an embedded system we use global variables often to keep dynamic memory consumption on heap and stack low. But global variables are also considered bad programming practice if they aren't used in a ...
0
votes
3answers
9k views

Program got so many errors about expected ) or ; before either

This is my first time to try program arduino, and I am clueless. I have a friend who told me about things work, and he told me the programming language is C (or similar to C) which we have learned in ...
0
votes
1answer
871 views

Leonardo with xbee shield?

I'm trying to get a XBEE shield to operate on an Arduino Leonardo. Usually i use the AltSerialLibrary to emulate an extra serial for the xbee. However since the Leonardo comes with two sets of serial, ...
0
votes
3answers
310 views

Controlling Arduino from Raspberry Pi

I am trying to control an Arduino Leonardo R3 to run some code when "triggered" from a Raspberry Pi. This would be in a loop so that it can be run multiple times. I have set up the Raspberry Pi and ...
1
vote
0answers
55 views

Controlling Arduino from Raspberry Pi [duplicate]

I am trying to simply send a digital output from the Raspberry Pi to trigger some code on an Arduino. I have setup the Pi with the digital output working fine (tested using LED) however, I cant seem ...
1
vote
1answer
248 views

How to avoid the code interrupting itself?

I have this code, which I am using with a potentiometer to control the speed of a automotive fuel injector. In it, I have specified how long the injector shall stay open by using the delay functions. ...
0
votes
1answer
6k views

"void does not name a type"

Hi I'm new at this and can't figure out why I get this error "void does not name a type" on lines 3,5,8,26 // _2-5 set Debounce Button const int BUTTON=2; const int LED=9; boolean lastButton = LOW; ...
2
votes
1answer
424 views

Homemade soil moisture analog value reading jumping from 0 to max

I made a soil moisture sensor out of two metal poles, adjustable resistor, for a project I am making. The first run with the project the sensor worked amazing and gave clear and concise readings, 0-...
0
votes
1answer
968 views

How to return the value in Arduino function (that can be read by the connected device)?

Right now I have an RC car program for Arduino. The code is like this: void loop() { distance = Dist.getDistanceCentimeter(); if(distance<=5 & distance>1) if(Serial.available()) { ...
0
votes
1answer
4k views

Get the uploaded code from arduino by using arduino IDE 1.0.6 [duplicate]

Recently bought a arduino device which already have program, it is model AR-293D and I have already connect it with my PC(windows 7) through usb when I open the IDE , It seems there is no function ...
0
votes
1answer
90 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 on,...
3
votes
1answer
12k views

Difference between void setup() and void setup(void)

As it says in the title. I have been searching but I cant seem to find the answer. What is the difference between void setup() and void setup(void) as well as void loop() and void loop(void)?
5
votes
4answers
30k views

Convert long to char array and back

I'm trying to store a state in my data logger. I can read/write fine to SD, but I can't wrap my head around reading/writing a long value correctly - I've build it down to converting it to char array ...
0
votes
1answer
565 views

Assigning values to char array causes program to not run

I have the following code: #include "LCD12864RSPI.h" #include "DFrobot_bmp.h" #include "DFrobot_char.h" #define AR_SIZE( a ) sizeof( a ) / sizeof( a[0] ) unsigned char ...
1
vote
1answer
3k views

How to use bitset/read on 16bit numbers (Arduino)

I'm working on an Arduino powered Tetris game. To keep track of the pieces that have fallen and become fixed I have an array of bytes byte theGrid[] = { B00000000, B00000000, B00000000, ...
0
votes
1answer
834 views

Multiple timers with different frequencies

I have to use multiple timers (for example, to blink different LEDs) with different frequency (for example, 7.3 Hz). Cannot you tell me, what is the preferred way to implement it? Just now I use one ...
0
votes
1answer
2k views

How to make Arduino communicate with MySQL?

I am trying to send data from my Arduino to my database but it seems that the process is not successfully beginning. Here is my code for Arduino: #include <Process.h> #include <Bridge.h> ...
1
vote
1answer
2k views

lcd.print and 2D arrays

Click here to see my program running I have created a 2D array (see my full code below), and each row contains one state of a battery here is a schematic : row [0] : "▯▢▢▷" // this row represents ...
-3
votes
2answers
5k views

Garbage value Serial Monitor

I am building my own arduino.Here is my code Below. I found code working for Digital Ios like blink example ; analog reading, Problem i am facing in Serial Monitor.Whenever i open Serial monitor i get ...
1
vote
2answers
3k views

Delay not working in function other than loop

So I just got an Arduino and thought I would play around a bit. However not five minutes in I already ran into a problem. I tried programming a simple SOS blinking light sequence. To get rid of code ...
0
votes
2answers
429 views

releasing memory in sub-function

I'm doing a program who get a line from the SD and shows it, this function is called getData() FULL CODE: #include <SD.h> #include <MemoryFree.h> File myFile; int stringIndex = 0; int ...
1
vote
1answer
827 views

MFRC522 minor problems

I'm working on a small project for a presentation. My goal is to read the UID of multiple Mifare Classic cards and compare it to a hardcoded list for different actions. All is well (the reading and ...
1
vote
1answer
441 views

What in the example code is different from my test code? LED matrix lights up differently

I'm trying to get my LED matrix to run Conway's Game of Life. After 4 different pin configurations, I've finally been able to run a separate test code, that lights all the LED's in order, and then ...
0
votes
1answer
400 views

Getting Push Button Logic To Stick?

I'm trying to get a sensor to activate if a push button is clicked. And deactivate when a certain condition is met and reactivate when the push button is pressed again. #include <SPI.h> // ...
0
votes
1answer
158 views

Lily Pad mp3, nested loops with timing and play randomly choosen mp3, coding problem

The best way to explain my problem is in form of code... const int ringerPin = A0; const int offhook = A4; const int onhook = A5; void setup(){ pinMode(ringerPin, OUTPUT); ...
0
votes
2answers
4k views

Necessary sampling rate

I'm using an Arduino pro mini to receive the analog signals from three sensors. I was wondering what sampling rate I should sample at in order to properly represent these signals. I know it should be ...
0
votes
1answer
5k views

Sending Serial Hex Command from Pin 1 (Tx) [closed]

Using Arduino Uno with 3.5mm Jack connected to ground and pin 1 for TX Need to send two commands I want to send 0XAA13FE010113 for Mute on, and 0XAA13FE010012 for Mute off. Simple Serial Command ...
0
votes
1answer
7k views

Many "expected `)' before ';' token" errors

As the title suggests, I have many "expected `)' before ';' token" errors. The issue is, I have this stuff in. So now I am confused, why am I getting this if the things are there. I am new here and ...
2
votes
2answers
870 views

How to parse array to x,y positions?

I have 16x16 LED matrix and I want to show some custom characters on it. I saw font made with array like this. const byte zero[16] = { // Create byte array number 0 B0111110, B1111111,...
0
votes
2answers
141 views

Led on when not supposed to be

So I made a program that controls two LED's when two buttons are pressed, but one of the LED's comes on when the button isn't pressed. And what's weird is that if I literally move around the ...
0
votes
1answer
3k views

Modbus master slave

I need Help in two thing Here. 1)My main project is i have 23 hallsensors with analog output. There are connected to arduino UNO analog pins using 16:1 Mux or 8:1 mux circuit. The currently i can ...