#define in an IF statement
hi there,
trying use potentiometer change colour used in led strips, i've written not sure if should work or not? there similar use?
trying use potentiometer change colour used in led strips, i've written not sure if should work or not? there similar use?
code: [select]
if(val < 341){
#define colour red
}
else if(val < 682 ){
#define colour blue
}
else{
#define colour yellow
}
serial.println(val);
no, won't work, preprocesor directives global, , evaluated @ compile time-
a simple variable assignment work.
a simple variable assignment work.
Arduino Forum > Using Arduino > Programming Questions > #define in an IF statement
arduino
Comments
Post a Comment