Questions tagged [coding-standards]
The coding-standards tag has no summary.
19 questions
2
votes
1
answer
90
views
Doubt in coding part in blink without delay
Code 1 (here unsigned long currentmillis = millis() is in loop area):
const int LED = 2;
unsigned long previousmillis = 0 ;
const long delaytime = 1500;
int ledstate = HIGH;
void setup() {
pinMode(...
1
vote
0
answers
64
views
Why does the LED state behave differently?
I wanted the sensor to be high when I press the button, but when DigitalRead does low, the LED turns on, when it does high, the LED goes off.
Whereas when the digitalRead is high, isn't it supposed to ...
1
vote
1
answer
335
views
Are there any standard ways of reporting a runtime error?
I'm new to Arduino but I'm an experienced programmer. I'm wondering if there are any common functions for reporting errors in Arduino programs? For example, in JavaScript we have the alert() function, ...
0
votes
1
answer
90
views
Do You Put a Break after the Last case in a Switch? [closed]
The Arduino Switch Case Reference has a switch structure written two different ways:
First in the Syntax as:
switch (var) {
case label1:
// statements
break;
case label2:
// ...
0
votes
2
answers
182
views
GPS and Arduino [closed]
I am working on a project with an Arduino Uno. I want to know if the latitudes and longitudes can be input to the Arduino for the Arduino to move to that particular location. If it's possible then ...
0
votes
2
answers
113
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, ...
2
votes
0
answers
185
views
Encoding clock signal into linear block codes
In the VirtualWire library, it is possible to encode the clock signal as the library is doing with 4b/6b coding. This is possible because VirtualWire uses convolutinal coding, where the information is ...
-1
votes
1
answer
412
views
How to send a group message to multiple receivers using GSM900 and Arduino Mega2560?
I'm working on a project and it can send to one receiver only. What I need is to send a message to multiple receivers. I need a code sample that would satisfy my needs. Please help! I need to finish ...
0
votes
1
answer
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++/...
32
votes
4
answers
60k
views
Is it better to use #define or const int for constants?
Arduino is an odd hybrid, where some C++ functionality is used in the embedded world—traditionally a C environment. Indeed, a lot of Arduino code is very C like though.
C has traditionally used #...