Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
1 answer
365 views

I have a set of buttons and a set of NeoPixel LEDs. There's lots of very similar constants (button1pin, button2pin, etc) so there's almost certainly a more efficient way of coding this. Any ideas? #...
Shpigford's user avatar
  • 484
0 votes
4 answers
335 views

int r = 12; int g = 11; int b = 10; int sw = 4; int x; int c = 0; void setup() { pinMode(r, OUTPUT); pinMode(g, OUTPUT); pinMode(b, OUTPUT); pinMode(sw, INPUT); pinMode(13, OUTPUT)...
USF's user avatar
  • 1
0 votes
2 answers
7k views

I am trying to send packets of via bluetooth data that include 6 bytes read from a sensor and stored in a uint8_t array. Instead of sending over the data as numerical digital, I would like to send the ...
Alex K's user avatar
  • 229
2 votes
2 answers
270 views

I'm working on an Arduino program but am getting bogged down on what is the 'correct' implementation. I understand that multiple versions may work, so for my needs the 'correct' version will be the ...
Ramrod's user avatar
  • 187
-3 votes
1 answer
171 views

Can you help me writing a code for this question guys?? You have an Arduino Uno with 8 LEDs connected to digital pins 2 to 9. Create an array of 8 elements. Fill it with random numbers between 2 and 9 ...
user19167's user avatar
1 vote
2 answers
1k views

Background: I'm using an Atmega1284P to add sensors to an off road racing truck onto a CANBUS network. The standard automotive sensors are thermistors, but the Dallas 1 wire temp sensors (DS18B20) ...
TheAutomator's user avatar
4 votes
2 answers
259 views

During the last two months I have been working on a project that consists of using a Seeeduino Stalker V2.3, two AM2305 sensors, a TSL2561 sensor, an HC-05 XBee module, a 1,800 mAh 3.7V LiPo, a 7 cm x ...
OpenAGRO's user avatar
0 votes
2 answers
561 views

How do you save space by preventing the inclusion of unnecessary binaries? When I compiled the ROS Blink example, I received the warning: Global variables use 1,951 bytes (76%) of dynamic memory, ...
Cerin's user avatar
  • 1,698
4 votes
4 answers
27k views

I was creating Arduino function which sends two int and additional chars between them and at the beginning and end of char array - then print that array to the serial port in almost real time. (For ...
ErnestW's user avatar
  • 109
1 vote
1 answer
2k views

I need to reduce the SPI clock speed of the Arduino Due down to about 100 kHz. Unfortunately my hardware doesn't support higher speeds. With the current maximum divider of 255, I can only reach a ...
Thomas's user avatar
  • 143
2 votes
2 answers
3k views

I am new with coding, and I was wondering how I could run something once and define it as a constant. Here is my code: int sensorValue1 = analogRead(A0); int sensorValue2 = analogRead(A1); int g0 ...
Andreas's user avatar
  • 23
0 votes
3 answers
2k views

I have learned Arduino for a month, and I want to bulid a car with 2 modes, Remote and Auto. Auto mode needs to have while() loop, so it can receive data from sensors. When I choose Auto mode via ...
user avatar
0 votes
1 answer
4k views

I notice problems with my output pins when I use this method of setting their pinMode: int allOutputPins[] = {3, 4, 9, 10, 5, A3, 11, 12, 7, 8, A1, A2}; for(int a = 0; a < sizeof(allOutputPins); a+...
Michael Rader's user avatar
0 votes
3 answers
389 views

I'm trying to controll an AC unit but the issue is space - right now, I store the data like this: consts PROGMEM unsigned int Signal_Heat_Fan0_Temp30[] = {233,636,17884,3032,8944,500,496,492,1496,524,...
vlad b.'s user avatar
  • 749
1 vote
3 answers
3k views

For my code I use a couple of static variables. But when I search the internet, they seem "evil". For example: I have a function which will be executed every loop (5ms looptime). to increase the ...
KoenR's user avatar
  • 177
0 votes
2 answers
2k views

I'm trying to write into a file using this code from the example of the library: String dataString = ""; int sensor = 0; dataString += String(sensor); dataString += ","; sensor +=1; File dataFile = ...
Facorazza's user avatar
  • 439
0 votes
3 answers
113 views

I want to skip all '\r' and '\n' chars and I have IF statment: char c = Serial.read(); if (c != '\r' || c != '\n') { // <- This line interesting mAnswer[mAnswerLength] = c; mAnswerLength++; ...
Martynas's user avatar
  • 538
1 vote
2 answers
13k views

we can upload a code into Arduino UNO from our computers, but how about reading code? Can we read and get C codes from compiled codes from Arduino hardwares? My second question is that will we read ...
Bay's user avatar
  • 303
1 vote
2 answers
307 views

I have a light sensor that works fine and outputs the correct data to the serial monitor when I only upload the following code to the nano: const int lightSensorPin = A0; int lightSensorValue = 0; ...
Michael Rader's user avatar
1 vote
1 answer
52 views

I'm using int with 14 LEDs to specify pins, but I don't want to use int 14 times, like this: int led1 = 2; int led2 = 3; int led3 = 4; int led4 = 5; int led5 = 6; int led6 = 7; int led7 = 8; int led8 ...
智障的人's user avatar
3 votes
1 answer
214 views

I am using Adafruit motor shield, I am running multiple DC motors for different amounts of time, but to start at the same time - I have researched that to do this I have to monitor the elapsed time of ...
Steve's user avatar
  • 33
0 votes
1 answer
276 views

Some of the code that I have is unbearably long and drives me insane. I don't know if there were simpler ways to doing what I am doing. long turn1; long turn2; long turn3; long turn4; long turn5; ...
智障的人's user avatar
9 votes
1 answer
1k views

When I compile my code, the Arduino IDE returns the binary sketch size in byte. Is there a good way to find out (approximately) what function or what part of my code takes up how much memory in ...
fuenfundachtzig's user avatar
0 votes
2 answers
4k views

There is a function on one of my programs I want to be switch on and off by pressing a button. The button is unbiased otherwise I would set the function to read the button's status of HIGH or LOW. So ...
Gabe Ruiz's user avatar
  • 295
1 vote
1 answer
880 views

I'm brand new to arduino but I'm trying to figure out how to set up a WASD steering system for my robot I made. I have the physical setup all ready but I don't know the code to use that would allow ...
ruckus's user avatar
  • 123
0 votes
1 answer
118 views

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,...
letsjak's user avatar
  • 143
0 votes
2 answers
457 views

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 ...
GEPD's user avatar
  • 131
5 votes
1 answer
3k views

I am running out of code and data memory space on ATMega328P. Code size is big as I used several libraries, but, I only use a few functions of those library. Apparently, the default IDE is only ...
EEd's user avatar
  • 904
1 vote
3 answers
406 views

I am trying to build a 36-line cable tester, using the Digistump DigiX (99 i/o pins). Digital pins 0-35 are outputs, connected via the cable in question, to (in a perfect world) digital input pins 36-...
user4057's user avatar
19 votes
5 answers
191k views

I'd like to make three arrays of the same length. According to the documentation, Arrays must be defined as int myArray[10]; where 10 can be substituted for a known length (another integer), or filled ...
user3.1415927's user avatar
1 vote
2 answers
201 views

So I am learning arduino code by going through examples and playing with them, and I came across something interesting. I am not fluent in any coding language but I am fully familiarized with computer ...
Sciiiiience's user avatar
7 votes
4 answers
3k views

I recently noticed how the map() function in Arduino was bulky in both terms of flash space used and time taken to execute, largely because it deals with long and involves a division and ...
Cybergibbons's user avatar
  • 5,430