ISO C++ forbids comparison between pointer and integer [-fpermissive]
Posted: Mon Oct 14, 2019 3:45 pm
HI
I'm building a Wordclock,for that i wrote this code:
now comes the error message: ISO C++ forbids comparison between pointer and integer [-fpermissive]
at the line: "if(zeit_h[Wort] == stunden ) {" im void loop
What have I done wrong here and what do I have to change?
Thanks for helping!
Selectronics50
I'm building a Wordclock,for that i wrote this code:
Code: Select all
const int wort_1[]={99,100}; //ES
const int wort_2[]={102,103,104}; //IST
const int wort_3[]={106,107,108,109}; //FÜNF
const int wort_4[]={98,97,96,95}; //ZEHN
const int wort_5[]={94,93,92,91,90,89,88}; //ZWANZIG
const int wort_6[]={81,82,83,84,85,86,87}; //VIERTEL
const int wort_7[]={76,75,74}; //VOR
const int wort_8[]={69,68,67,66}; //NACH
const int wort_9[]={55,56,57,58}; //HALB
const int wort_10[]={60,61,62}; //ELF
const int wort_11[]={62,63,64,65}; //FÜNF
const int wort_12[]={54,53,52,51}; //EINS
const int wort_13[]={47,46,45,44}; //ZWEI
const int wort_14[]={33,34,35,36}; //DREI
const int wort_15[]={40,41,42,43}; //VIER
const int wort_16[]={32,31,30,29,28}; //SECHS
const int wort_17[]={25,24,23,22}; //ACHT
const int wort_18[]={11,12,13,14,15,16}; //SIEBEN
const int wort_19[]={17,18,19,20,21}; //ZWÖLF
const int wort_20[]={10,9,8,7}; //ZEHN
const int wort_21[]={7,6,5,4}; //NEUN
const int wort_22[]={2,1,0}; //UHR
const int zeit_1m[]={};
const int zeit_2m[]={};
const int zeit_3m[]={5,25,35,55};
const int zeit_4m[]={10,50};
const int zeit_5m[]={20,40};
const int zeit_6m[]={15,45};
const int zeit_7m[]={25,40,45,50,55};
const int zeit_8m[]={5,10,15,20,35};
const int zeit_9m[]={25,30,35};
const int zeit_10m[]={};
const int zeit_11m[]={};
const int zeit_12m[]={};
const int zeit_13m[]={};
const int zeit_14m[]={};
const int zeit_15m[]={};
const int zeit_16m[]={};
const int zeit_17m[]={};
const int zeit_18m[]={};
const int zeit_19m[]={};
const int zeit_20m[]={};
const int zeit_21m[]={};
const int zeit_22m[]={0};
const int zeit_1h[]={};
const int zeit_2h[]={};
const int zeit_3h[]={};
const int zeit_4h[]={};
const int zeit_5h[]={};
const int zeit_6h[]={};
const int zeit_7h[]={};
const int zeit_8h[]={};
const int zeit_9h[]={};
const int zeit_10h[]={11,23};
const int zeit_11h[]={5,17};
const int zeit_12h[]={1,13};
const int zeit_13h[]={2,14};
const int zeit_14h[]={3,15};
const int zeit_15h[]={4,16};
const int zeit_16h[]={6,18};
const int zeit_17h[]={8,20};
const int zeit_18h[]={7,19};
const int zeit_19h[]={12,0,24};
const int zeit_20h[]={10,22};
const int zeit_21h[]={9,21};
const int zeit_22h[]={};
const int* zeit_m[]={zeit_1m, zeit_2m, zeit_3m, zeit_4m, zeit_5m, zeit_6m, zeit_7m, zeit_8m, zeit_9m, zeit_10m, zeit_11m, zeit_12m, zeit_13m, zeit_14m, zeit_15m, zeit_16m, zeit_17m, zeit_18m, zeit_19m, zeit_20m, zeit_21m, zeit_22m};
const int* zeit_h[]={zeit_1h, zeit_2h, zeit_3h, zeit_4h, zeit_5h, zeit_6h, zeit_7h, zeit_8h, zeit_9h, zeit_10h, zeit_11h, zeit_12h, zeit_13h, zeit_14h, zeit_15h, zeit_16h, zeit_17h, zeit_18h, zeit_19h, zeit_20h, zeit_21h, zeit_22h};
const int* wort_LEDs[]={wort_1, wort_2, wort_3, wort_4, wort_5, wort_6, wort_7, wort_8, wort_9, wort_10, wort_11, wort_12, wort_13, wort_14, wort_15, wort_16, wort_17, wort_18, wort_19, wort_20, wort_21, wort_22};
int Anzahlwoerter = 22;
#include <NTPClient.h>
#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
const char *ssid = "Glattalp";
const char *password = "toedel99%";
WiFiUDP ntpUDP;
NTPClient timeClient(ntpUDP, "ch.pool.ntp.org", 7200, 60000);
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h> // Required for 16 MHz Adafruit Trinket
#endif
#define PIN 14 // Anschluss PIN
#define NUMPIXELS 110 //Anzahl LED's
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
#include <sstream>
#include <string>
#include <iostream>
void setup(){
Serial.begin(115200);
WiFi.begin(ssid, password);
while ( WiFi.status() != WL_CONNECTED ) {
delay ( 500 );
Serial.print ( "." );
}
pixels.begin();
}
void loop(){
const int minuten = timeClient.getMinutes();
const int stunden = timeClient.getHours();
pixels.show();
for (int Wort = 0; Wort < Anzahlwoerter; Wort++) {
if(zeit_m[Wort] == minuten) {
pixels.setPixelColor(wort_LEDs[Wort], pixels.Color(150, 150, 150));
}
}
for (int Wort = 0; Wort < Anzahlwoerter; Wort++) {
if(zeit_h[Wort] == stunden ) {
pixels.setPixelColor(wort_LEDs[Wort], pixels.Color(150, 150, 150));
}
}
timeClient.update();
Serial.print(timeClient.getHours());
Serial.print(":");
Serial.print(timeClient.getMinutes());
Serial.println();
}
now comes the error message: ISO C++ forbids comparison between pointer and integer [-fpermissive]
at the line: "if(zeit_h[Wort] == stunden ) {" im void loop
What have I done wrong here and what do I have to change?
Thanks for helping!
Selectronics50