The process of designing and writing source code as part of a program (or sketch) for Arduino. Do not use for uploading to an Arduino board.
0
votes
0answers
14 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
39 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>
...
0
votes
1answer
20 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 contaisn one state of a battery here is a schematic :
row [0] : "▯▢▢▷" // this row represents ...
0
votes
0answers
15 views
Arduino Transceivers
I've been using a raspberry pi for a while now and wanted to attempt some home automation.
From reading around I've seen lots of people saying that the raspberry pi can't generate the timing for the ...
-3
votes
1answer
21 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 ...
0
votes
1answer
22 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
28 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 ...
0
votes
0answers
19 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 ...
0
votes
0answers
10 views
Configuring XBee coordinator to propagate data to routers?
Currently I have three XBee. Two is configured as routers and one as a coordinator. For serial data that is being sent using two of the xbee (router-->coordinator, coordinator --> router) this works ...
0
votes
0answers
19 views
Using XBEE on Relay Shield v2.1?
I am unable to get the XBee running on my relay shield. I'm looking to have two Xbee communicate with each other.
Here is a test script I drafted.
// We'll use SoftwareSerial to communicate with the ...
0
votes
1answer
86 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
35 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
16 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
0answers
41 views
Checking string condition?
I'm looking for my Arduino board to jump to a function based on an if condition, where a string (content) is checked to see if it matches the word FALLEN. However, the if condition never occurs ...
0
votes
1answer
27 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 ...
-1
votes
1answer
43 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
60 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 ...
1
vote
2answers
57 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,
...
0
votes
2answers
74 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
0answers
33 views
How to Convert C++ StreamSend Class to Processing (Java)
In the post Sending Large Amounts of Serial Data Steven10172 posted a StreamSend class to send data to and from Arduinos. I was able to incorporate it into my app with no problems. The question is ...
0
votes
1answer
66 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 ...
0
votes
3answers
62 views
Help with a function that accepts different parameter types
I'm trying to create a function that prints out an XML tag with a value. I have the code below, but kind of stuck. I'd like to be able to call the function, and pass a value that could be a float, ...
0
votes
2answers
87 views
How to convert byte array to floate
How can I convert the byte array to float?
Code:
void send_data() {
CCPACKET data;
data.length=2;
float lon=26.533255;
float lat=27.533463;
data.data[0]=lon;
...
0
votes
1answer
34 views
ATmega168a Breadboard - can't load via Arduino IDE
I have ATmega168a on a breadboard. I am programming it via the Arduino IDE and a FT232RL USB adapter. When I select my board for 168 and upload, I get the following error:
stk500_getsync(): not in ...
1
vote
1answer
33 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
1answer
53 views
error: ‘sleep’ was not declared in this scope
I am trying to use the sleep function in lieu of delay(), but when I include sleep(), I get Sweep.cpp:60:10: error: ‘sleep’ was not declared in this scope
I read some place, about #include ...
0
votes
0answers
21 views
Good book to learn arduino programming? [duplicate]
I am looking for a good book to learn arduino programming , I am fairly good in c++ .
1
vote
2answers
250 views
Error: 'SofwareSerial' does not name a type
I have trouble compiling this sketch. The error I get is
'SoftwareSerial' does not name a type
Any ideas how could I fix it?
#include SoftwareSerial.h
SoftwareSerial mySerial(10, 11); // RX, ...
0
votes
2answers
49 views
Ruby and Arduino over Serial
I'm trying to send data over serial and pick it up in a ruby script. I'm using the serialport gem (https://rubygems.org/gems/serialport) as stated in the Arduino docs ...
1
vote
1answer
76 views
Arduino function to fade from one RGB color to the next
For my Arduino project I have a Neopixel RGB Strip with 72 LED's.
I can successfully change the colour of any of the LED's (at the moment I'm only setting the first one 0 for testing purposes) so I ...
1
vote
1answer
47 views
I want to be able to upload a batch of tweets to a twitter bot to be qued' for tweeting
I have built a twitter bot with my Arduino and an Ethernet shield
right now, the way to make it tweet something is to manually add a phase into the code and upload it to the board for each new tweet,
...
0
votes
1answer
73 views
What is the use of ISP and ICSP in Arduino?
I am trying to connect gsm module with my arduino uno. confused about the use of isp and icsp
0
votes
0answers
137 views
Pixy(CMUcam5) robot Distance code
Can anyone help me with the code-ing to allow the robot to stop at a certain distance when the robot is approaching the tracked object. I am trying to implement it as a colour tracking wheel chair. ...
0
votes
1answer
131 views
Guide to code for multitasking and non blocking timers
I'm beginning to to kind of sophisticated things (well.. for my entry level skill) and I have to control a display with 3 LED and 4/5 types of events and status.
I'm using the BlinkWithoutDelay ...
-2
votes
2answers
132 views
Need help for RPM counter with Arduino on ubuntu
Following is RPM counting program.
It worked in windows perfectly.
However, in ubuntu it always shows weird value.
int pin = 7;
float rpm;
float duration;
unsigned long val;
float rps;
void ...
4
votes
1answer
128 views
From transfer function to arduino
This question might seem stupid, but I have been curious about it for a long time.
So I am a new engineering student, and we learned a lot about "designing a controller". For example, design ...
1
vote
1answer
37 views
Do we need another controller when using ArduPilot?
I'm a newbie on the all Arduino platform and I'm currently building a drone with Autopilot functionality. I've heard about ArduPilot and I'm wondering if that is all I need, in terms of controllers ...
-2
votes
1answer
47 views
Relay activation
I am posting my simple code here, I wanted to print the Output_Current Inspite when delay function called.Below is my code.
#include <MsTimer2.h>
int Analog_Pin=5;
int newaverage;
float ...
1
vote
2answers
174 views
4-digit 7 Segment LED displaying numbers in the wrong order
I am a novice Arduino programmer and am currently having trouble with a SH5461AS 4-digit/7-segment LED when using it with an Arduino Uno. I have struggled to find an accurate datasheet/tutorial of any ...
-1
votes
1answer
140 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
235 views
Aduino Due Can messages
I am trying to read/send CanBus messages using a Arduino Due.
As of now I have used https://github.com/collin80/due_can library to setup my Can Bus interface.
I am using Vector Software CanAylzer ...
1
vote
4answers
185 views
Unable to terminate “void loop”
I have loaded an example sketch that came with the installation of the Arduino software onto my Uno.
void setup() {
Serial.begin(9600);
}
void loop() {
int sensorValue = analogRead(A0);
...
4
votes
3answers
287 views
Is setup and loop provided for convenience?
Arduino sketches usually feature a setup and loop function. Are these functions only provided for convenience or do they actually have special purposes? (e.g.: are some operations disallowed or ...
-2
votes
2answers
223 views
Break statement terminating loop() [closed]
I am experiencing some very strange behavior with my arduino. I have a switch-case statement in the loop() method, and the break methods are not only breaking out of the case block, but also out of ...
0
votes
1answer
71 views
AT+CSTT throws an error
I am getting an error on
AT+CSTT="TATA.DOCOMO.INTERNET","",""
What am I missing here?
Code
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while ...
0
votes
0answers
42 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 ...
0
votes
2answers
377 views
how to use strstr() in serial communication?
I have a SIM900 module and Arduino, both are working fine. In my previous programs I have use strstr() command to find specific word from a string but they were constants and pre defined in the ...
0
votes
2answers
397 views
Scroll String Only On Second Line Using 2x16 LCD
I'm trying to scroll a string in the second row of the LCD while letting the string on the first row stay intact. I use Serial to run that part of the code as you can see. It work at first but when I ...
0
votes
0answers
135 views
USB Keyboard in Retro Emulators
I have created a retro keyobard using a ZX spectrum and a PRO MICRO based on the info here: http://blog.tynemouthsoftware.co.uk/2013/04/arduino-leonardo-based-zx81-usb-keyboard.html
When plugged into ...
0
votes
1answer
60 views
Arduino Uno- Analog serial monitor not reading values over 174
I am simultaneously using a LEGO sound sensor in pin A5 and a RadioShack Tricolor LED Strip (Product #2760339) in pin A0.
The sound sensor alone works as expected (producing values based on volume) ...