Arduino Code: Declare an Enum Type, a Variable and Compare it
Arduino C Code-Sample
1. Declare an enum typdef
2. compare== the enum
Arduino C Code-Sample
1. Declare an enum typdef
2. compare== the enum
//declare enum Type typedef enum { enum_var1, enum_var2, } enum_Test ;
void setup() { Serial.begin(115200); Serial.println("Test Enum Enumaration in Ardino"); }
void loop() { //----< loop()>---- //*create variable var1 of type enum enum_Test enum_Test var1=enum_var1;
//*compare variable with enum-value if(var1==enum_var1) { Serial.println("Enum of type Operand== matched"); }
//----</ loop()>---- } |
zur Lösung von Arduino Compiler Fehlermeldung
exit status 1
no match for 'operator==' (operand types are 'String' and 'enum_SetCommands')