Most Popular
1500 questions
13
votes
1 answer
Arduino IDE #ifdef
I use my Arduino IDE to either upload my sketch to a Arduino or ATTiny or ATmega328. As you know each device can have a different pinout. Does the Arduino compiler support ifdef, depending on the board I am connected to?
For example
#ifdef Attiny85
…
PhillyNJ
- 1,128
- 3
- 10
- 20
13
votes
4 answers
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 allowed in setup and loop)
Are these two pieces of code…
Sebazzz
- 231
- 2
- 6
13
votes
1 answer
Is there a preprocessor constant for memory size
I would like my compiles to exclude some code depending upon the flash/program space available. To be used in the demo code of a library I support. Whereas my current solution is to use a #ifdef of processor type. But I would like to be more general…
mpflaga
- 2,443
- 11
- 13
13
votes
4 answers
Does ADC conversion to a voltage rely on the actual value of the +5 V pin?
Questions:
Does the conversion of the ADC count to voltage depend on the actual voltage of the +5 V pin?
If yes, what is the accepted method of getting that voltage from the board?
Background/Detail:
I have a circuit in which I have an Arduino…
Caribou
- 233
- 3
- 10
13
votes
2 answers
Post Data To a Web Service From Arduino
If you want to submit sensor data such as temperature to a remote server/database somewhere you need to use some kind of call to a web server since it isn't possible to connect directly to a database from the Arduino.
How do you post data to a JSON…
HK1
- 367
- 1
- 4
- 10
13
votes
4 answers
Why do sketches take up so much space and memory?
When I compile this sketch for the Yún:
int led = 7;
void setup() {
pinMode(led, OUTPUT);
}
void loop() {
digitalWrite(led, HIGH);
}
I get:
Sketch uses 5,098 bytes (17%) of program storage space.
Maximum is
28,672…
hichris123
- 327
- 1
- 3
- 19
13
votes
1 answer
What's the difference between all the Software Serial Libraries? Which one is Arduino Nano compatible?
There are so many Software Serial Libraries, what are the differences between them? And which one I can use with my Arduino Nano? For my Arduino Nano I need one Hardware Serial Port and one Software Serial port at a baud rate of 115200.
On which…
William Roy
- 495
- 3
- 10
- 22
13
votes
6 answers
How to output a true analog voltage at output pin
Regarding my program, it is a program that does some calculations and then outputs a voltage based on the result using analogWrite function. However my problem is that I had done my programming based on a misconception that analogWrite function via…
bytk
- 133
- 1
- 1
- 8
13
votes
3 answers
Returning an int array from a function
I have a function that needs to return 3 int values. I currently use an array declared in the global scope and I ask the function to write into them. Is there a way to make a function return an array?
Here is what I want to do:
int function()
{
int…
Dat Ha
- 2,883
- 6
- 21
- 44
13
votes
2 answers
WiFi Password Safety
Are there any best practices regarding password safety? The following is taken from a wifi tutorial sketch.
#include
#include
char ssid[] = "yourNetwork"; // your network SSID (name)
char pass[] = "secretPassword"; //…
Skiddles
- 233
- 2
- 6
13
votes
3 answers
Serial data showing up weird
I have a simple sketch that prints out "Hello World" to the serial, but I'm getting a bunch of gibberish instead.
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println("Hello World");
delay(1000);
}
Why isn't it printing…
sachleen
- 7,365
- 4
- 37
- 55
13
votes
5 answers
How to change baudrate of ESP8266 (12e) permanently?
IMPORTANT: DO NOT USE AT+IPR=9600! (see update)
I have an ESP8266 12E module that communicates at 115,200 bauds. Since I use it with an Arduino Nano with SoftwareSerial things get messy. So I found that I should reduce the baud rate of the ESP…
mvermand
- 349
- 1
- 4
- 15
13
votes
6 answers
Sending Large Amounts of Serial Data
So in the fields of robotics sometimes you need multiple boards and or computers linked together to share information or save statistical data. Currently I need to send a few different variables over a serial connection and was wondering what was…
Steven10172
- 501
- 2
- 4
- 11
13
votes
5 answers
Reducing lag between the arduino and a processing sketch on my computer
I'm currently on project #14 of the Arduino project book.
I'm trying to control a processing sketch on my laptop using my Arduino. This is accomplished by using a potentiometer to control the background of an image.
Arduino code:
void setup(){
…
Kenneth .J
- 393
- 1
- 4
- 11
13
votes
2 answers
Making analog telephone calls?
How can we make the Arduino board interact with old, analog telephone, and to make phone calls?
I guess it involves connecting the board to the telephone with some specific cable (how it's called?)
In addition, I assume it will require us to use the…
Reflection
- 231
- 2
- 3