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
8 views
Multichannel communication with arduino and Hc-12 transmitter
The hc12 module has 100 possible channels starting at 433mhz. But is there someone who can tell me how to program the arduino to use multiple channels at the same time? My goal is to build an RC ...
0
votes
0answers
10 views
Is it possible to make a tracking program in Arduino Uno using RFID?
So uhm, I'm an 9th grade student. I wanted to know if it is possible for arduino to track objects that are tagged by an RFID and display it in the tft touch screen. Considering arduino' specs.
-2
votes
1answer
36 views
Making games on Arduino [on hold]
I have an Arduino and a 2.4 inch touchscreen. Is it possible to make a game like Pokemon Emerald? I have a controller.
Can anyone give the code for this game?
3
votes
1answer
56 views
Making an automated watering system with Arduino
I am trying to make an automated watering system using an Arduino.
Here is my wiring diagram:
And here is my circuit wired up:
Here is the code that I'm using with Arduino. The code seems alright ...
0
votes
1answer
43 views
Why is the loop() stopping?
I would like to move my servo motor (SM-S2309S) between random angles. In order to do so, I used this simple code:
#include <Servo.h>
Servo servoMain; // Define our Servo
// SM-S2309S angular ...
2
votes
2answers
50 views
Looking for learning resources to teach the “principles” rather than “follow this” projects [closed]
I just got the Arduino starter kit as my background is software developer (C++, python, etc) and I'm interested to get into the electronics side, and I love LED effects and home automation of all ...
-1
votes
2answers
46 views
I keep on getting a stray '\302' in program error.How do I fix it.This is in arduino uno
#include <LiquidCrystal.h>
int trigPin = 13; //sensor's trigger pin connected to pin 13
int echoPin = 7; //sensor's echo pin connected to pin 11
float pingTime; //time for the ping to hit ...
-2
votes
0answers
28 views
Arduino Protothread <pt.h> Library Timing [closed]
i am using protothread library by "Author: Jan Clement". It works like, you first determine how often a thread should start and than it works. But i need to have a code like for 1 seconds (200. ms -> ...
1
vote
2answers
28 views
How to insert into table in database after every 5 minutes using Real time clock module
I have RTC module attached to arduino mega,
to calculate time difference of minutes I am getting minute from the RTC module
and checking if passed time is greater than 5 minutes then insert to ...
0
votes
1answer
26 views
Why does Keyboard.Print adds random values to url?
I'm trying to print a sequence of power shell commands including a url to the powershell interpreter but every time I execute it with the Arduino Micro it adds random values to the url. Here's the ...
0
votes
2answers
43 views
While doesn't the loop terminate?
I have a have project of Up Down counter using Arduino with seven segments, in which when I continuously press the push button, the counter moves upward from 0 to 99. When I release the push button, ...
0
votes
0answers
69 views
Why is IF statement staying true even when argument inside is false?
Once the third IF statement in my program goes true it will remain true for several iterations, even when the temp has fallen below the set variable, which should make the statement false. But it ...
0
votes
1answer
35 views
Minimum circuitry required to program an AVR
Where is the information what is the minimum-required circuitry to program any AVR via ICSP?
Sometimes I see schematics that show just the chip and the six wires for the ICSP header (RESET, VCC, GND, ...
0
votes
1answer
19 views
Reading values from SQL Arduino ethernet
I'm about to do this project where I will make some lights flash up depending on some values that are in an SQL database on a server. I have already bought my Arduino and waiting for it to arrive. But ...
2
votes
1answer
41 views
Arduino Uno Bluetooth connection
I'm trying to connect two Arduino Unos with Bluetooth modules (HC-06 and HC-05). Does anyone know the steps required to do that?
I still haven't figured out:
How to pair the two Bluetooth devices,...
0
votes
1answer
23 views
Does this code work as a PWM?
I'm working on an Arduino project and I need to write some code that controls the frequency and duty cycle of a square wave signal (pulse width modulation). I'm not allowed to use the PWM function, I ...
0
votes
0answers
31 views
SIM800L GSM Module, no network signal RSSI
I am using a GSM 800L module to send SMS messages. When I test the module with Arduino, it shows a 0 : -115dbm signal strength.
So basically there is no signal. SIM800L is a quad-band GSM/GPRS module ...
0
votes
2answers
33 views
How to load page from SD card and still show live data from sensors?
I am just wondering, how can we display page from SD card and still show live data from sensors?
I have web server running on Arduino mega using ethernet shield, in my sketch I am doing client.print ...
-3
votes
0answers
24 views
computer science [migrated]
#include <iostream>
using namespace std;
struct dateofbirth{
char day[2];
char month[2];
char year[4];
};
struct address{
char city[20];
char address[20];
};
struct ...
0
votes
4answers
44 views
Arduino write/handle long programs [duplicate]
I'm writing a "sketch" in the Arduino IDE which has at this very moment 1500 lines and is going to become much longer. I splitted it in several tabs, but that's not very comfortable to use (I need to ...
0
votes
1answer
48 views
2 if-else in one program
Hey guys i have made an automatic plant watering system. Its really basic. the code is:-
char yo = 0;
void setup() {
pinMode(2, INPUT);//moisture sensor
pinMode(3, OUTPUT);// pump
Serial.begin(...
1
vote
1answer
41 views
Using MMA8451 accelerometer to count steps
I'm trying to use an Adafruit MMA8451 accelerometer to create a pedometer-type device that counts steps. I'd like to initiate a counter that says "if the x-axis readout is > some threshold, add 1 to ...
0
votes
0answers
36 views
Microcontroller program upload
I'm new Arduino and trying to program Attiny13a microcontroller for Servo.
I have connect succesfully 13a microcontroller with arduino and light is blinked after select board.
My question is I have ...
0
votes
1answer
55 views
Global variables use to much space in the dynamic memory
I use two simple libraries (see 1, 2) I found online for my code on the Arduino Uno, unfortunately I also use ROS and all those libraries take away to much space, when I compile my code I get this ...
0
votes
0answers
22 views
Ladder Diagram to Arduino Converter [closed]
I am student in Engineering Education and I want to make a simple trainer for PLC. But I just want to make a simple trainer which is when I make a Ladder Diagram on a simulator, then it will convert ...
0
votes
1answer
32 views
Arduino Due: ADC gain adjustment problem
I want to increase gain of the ADC channel. To achieve this I'm using adc_set_channel_input_gain function from adc.h. Here is the entire sketch:
const byte aPin = A6;
void setup() {
...
0
votes
0answers
28 views
Sinusoidal motion of a stepper motor
I was looking to run a stepper motor in a sinusoidal manner i.e. Asin(wt+c). I am unable to change the amplitude of motion. How do I implement this? I am currently unable to change velocity (Awcos(wt+...
0
votes
1answer
70 views
How to use this Arduino code to control multiple different LEDs?
I am making an Android-controlled LED system over Bluetooth but I need to use 4 LEDs. I have done Android app but I am not able to figure out this Arduino code. Can some please help me get this done?
...
1
vote
2answers
39 views
Getting different results from function. How to retrieve values correctly?
Trying to implement PI controller in function.
Already worked for one controller.
However, for more than one controller, the results are shifting.
Suppose to get same values in the following code.
...
3
votes
3answers
249 views
Why do I get a compiler error when I'm pretty sure I have such method?
Code
(I've omitted much of the code, and left just the outline and code probably relating to the error.)
SelfDrivingCar.ino
#include "JKMain.h"
void setup() { JKMain::setup(); }
void loop() { ...
1
vote
1answer
33 views
How convert eight hex characters to uint32_t using strtol() function?
I want to control 4 pins using hexa code like this ff00ff00 (255, 0, 255, 0).
strtol() function works fine with three pins like 00ff00, but when i add two extra caracters to &payload[1] variable ...
0
votes
1answer
29 views
Using SPI Interrupt causes two servos to lose functionality
My Arduino MEGA clone (ATMEGA 2650) reads SPI data as a slave using an interrupt.
There are also two servos that make an arm (shoulder and elbow).
When I comment out the line that attaches the SPI ...
-5
votes
1answer
33 views
Arduino Skill Stop Push button error
I made a skill stop game from Arduino Uno and a pushbutton.Here is the code:
byte led_one=2;
byte led_two=3;
byte winner_led=4;
byte led_four=5;
byte led_five=6;
byte pushbutton=12;
byte score=0;
int ...
3
votes
2answers
46 views
Bootloader on Atmega328p overwrites whenever it gets programmed
I built my first custom circuit board with an Atmel ATMega328p-AU the tqfp-32 form factor. I connected xtal1 and xtal2 to an external 16mhz crystal to 22pf caps tied to ground. It seems to work great, ...
1
vote
1answer
16 views
How come `MyClass.MyStaticMethod()` doesn't work, but `Serial.begin()` does?
MyProject.ino:
#include "MyClass.h"
void setup()
{
Serial.begin(9600);
// MyClass.MyStaticMethod();
MyClass::MyStaticMethod();
}
Both uncommented lines work, but the commented (when ...
0
votes
2answers
22 views
Why can't my .cpp file have a class of the same name?
I made a new Arduino IDE project ABC, and am given ABC.ino. Then I create a XYZ.h and XYZ.cpp.
ABC.ino:
#include "XYZ.h"
void setup() {}
void loop() {}
XYZ.h:
#ifndef XYZ
#define XYZ
#include "...
3
votes
2answers
48 views
How does an 8bit MCU make use of data-types over 8bits?
how does an 8bit MCU handle 16bit output?
How does an 8bit MCU store values higher than 8bits?
I am using an attiny, on an adafruit trinket. and other 8bit MCUs.
http://www.atmel.com/devices/attiny85....
0
votes
2answers
70 views
How does Arduino determine whether the given condition provided to it is true or false?
I want to understand how does the microcontroller determine that the conditions provided to it in the input are true or false. eg:
if (someVariable > 50)
{
// do something here
}
Then how does ...
1
vote
2answers
90 views
What programming practices should be adopted while coding sketches for Arduino?
What are some of the best programming practices that can be adopted while coding sketches for Arduino, so that it uses the least memory and performance should not suffer from memory outage, and still ...
-1
votes
1answer
30 views
How to plot YPR from mpu6050 on arduino IDE?
I have an mpu6050 attached to an arduino micro and I'm getting the data from it just fine, the ypr values. Now I want to know how I would graph that on the arduino IDE. Since there is x,y and z what ...
1
vote
1answer
37 views
How do I change PGA gain in this Arduino program?
Below is the link to three files I am using with a 32 bit ADC from TI, ADS1262, plus a link to it's datasheet. It works fine but I'm not getting any better voltage resolution than with a 16 bit ADC. I ...
0
votes
2answers
56 views
“return” not working to break out of a loop
I'm fairly new to this, and I haven't been able to find any answers after searching repeatedly.
I have a Startscreen() function that I run during my setup sequence, and within that function i use ...
0
votes
0answers
27 views
Avoiding global objects
I am curious if there is a better way than what I am currently doing for creating an object and running a function of it every time in the loop. For example:
Obj foo();
void setup() {
foo.init();
}
...
1
vote
0answers
23 views
Can I get my RGBW Neopixel strip to loop perfectly by adjusting rainbowFade2White function in strandtest?
I have been working on adjusting the code for the strandtest RGB and strandtest RGBW to get exactly what I want, which in this case is for the LED strip to transition from one color to another nicely (...
3
votes
2answers
87 views
Arduino not running the sketch with external power supply of 9v, but runs the program when connected to pc
Can anyone please help me figure out/ point the reason of this arduino problem? I uploaded a simple arduino sketch (blink an LED ) just to test if my real program was the reason of the "abnormality" ...
0
votes
2answers
39 views
Continuous Rotation
I was wondering how can I make a Servo rotate continuously by using an Arduino code.
I looked through several forums and websites already, but all of them just show how to make it run by changing the ...
0
votes
1answer
55 views
How to calibrate a PID?
I'm working on a pid-controlled levitating magnet device. It uses a hall-sensor to turn on and off an electro magnet in ordet to achieve levitation.
When I hold a magnet close to the hallsensor, I ...
1
vote
1answer
35 views
not able to tick the checkbox of page generated by client object
I have green LED attached on Digital pin 2 which is by default set to LOW,
and I am trying to turn it on and off from a checkbox added on web page as shown in the code below, but I think something ...
0
votes
2answers
42 views
Cannot set Pins to LOW
I am controlling 2 motors from my Arduino Pro Mini and L293D motor driver module. Problem is, I have to set a pin high and after 1 second set it to LOW. But that doesn't happen... The pin just stays ...
-1
votes
2answers
43 views
IRRemote send and receive same Arduino
I am an Arduino (and C/C++) newbie so apologies if I am missing something obvious.
I am using IRremote (github link) as my IR library.
I can get the simple send and receive demos working ...