no matching function for call to 'println(const char [41], int&)'

avtodor
Offline
Зарегистрирован: 04.02.2019
#define ONE_THOUSAND 1000
#define SIXTY 60
#define TWENTY_FOUR 24
#define PORT_MONITOR_VELOCITY 9600
#define INP_0 0
#define BATTARY_AMOUNT 5
 
struct BattaryDischargingTimeType
{
  int Days;
  int Hours;
  int Minutes;
  int Seconds;
  int Milliseconds;     
};
 
enum BattaryCurrConditionType{Charge, Discharge};
enum AmountOfDischargeBattariesConditionType{noOne, One, Two, Three, Four, Five, Six};
 
void setup();
void loop();
void initBattaryDischargingTimeArray(BattaryDischargingTimeType *BattaryDischargingTimeArray);
void setBattaryCurrConditions(BattaryCurrConditionType *BattaryCurrConditionArray);
 
void setup() {
  // put your setup code here, to run once:
  Serial.begin(PORT_MONITOR_VELOCITY);
  BattaryDischargingTimeType BattaryDischargingTimeArray[BATTARY_AMOUNT];
  BattaryCurrConditionType BattaryCurrConditionArray[BATTARY_AMOUNT];
  initBattaryDischargingTimeArray(BattaryDischargingTimeArray);
  setBattaryCurrConditions(BattaryCurrConditionArray);
  AmountOfDischargeBattariesConditionType AmountOfDischargeBattaries = noOne;
  
  for(int currBattary = INP_0; currBattary <= BATTARY_AMOUNT; currBattary++)
  {
    Serial.println("Time of discharging of battary number ", currBattary);
  }
 
 
  
}
 
void loop() {
  // put your main code here, to run repeatedly:
   
}
 
void initBattaryDischargingTimeArray(BattaryDischargingTimeType *BattaryDischargingTimeArray)
{
  for(int currBattary = INP_0; currBattary <= BATTARY_AMOUNT; currBattary++)
  {
    BattaryDischargingTimeArray[currBattary].Days = 0;
    BattaryDischargingTimeArray[currBattary].Hours = 0;
    BattaryDischargingTimeArray[currBattary].Minutes = 0;
    BattaryDischargingTimeArray[currBattary].Seconds = 0;
    BattaryDischargingTimeArray[currBattary].Milliseconds = 0; 
  }
}
 
void setBattaryCurrConditions(BattaryCurrConditionType *BattaryCurrConditionArray)
{
  for(int currBattary = INP_0; currBattary <= BATTARY_AMOUNT; currBattary++)
  {
    BattaryCurrConditionArray[currBattary] = Charge;
  }
}
 
Почему компилятор ругается на строку Serial.println("Time of discharging of battary number ", currBattary);? Как написать правильно эту инструкцию?
 
bwn
Offline
Зарегистрирован: 25.08.2014

Потому что код вставлять не умеете.((((

avtodor
Offline
Зарегистрирован: 04.02.2019
#define ONE_THOUSAND 1000
#define SIXTY 60
#define TWENTY_FOUR 24
#define PORT_MONITOR_VELOCITY 9600
#define INP_0 0
#define BATTARY_AMOUNT 5
 
struct BattaryDischargingTimeType
{
  int Days;
  int Hours;
  int Minutes;
  int Seconds;
  int Milliseconds;     
};
 
enum BattaryCurrConditionType{Charge, Discharge};
enum AmountOfDischargeBattariesConditionType{noOne, One, Two, Three, Four, Five, Six};
 
void setup();
void loop();
void initBattaryDischargingTimeArray(BattaryDischargingTimeType *BattaryDischargingTimeArray);
void setBattaryCurrConditions(BattaryCurrConditionType *BattaryCurrConditionArray);
 
void setup() {
  // put your setup code here, to run once:
  Serial.begin(PORT_MONITOR_VELOCITY);
  BattaryDischargingTimeType BattaryDischargingTimeArray[BATTARY_AMOUNT];
  BattaryCurrConditionType BattaryCurrConditionArray[BATTARY_AMOUNT];
  initBattaryDischargingTimeArray(BattaryDischargingTimeArray);
  setBattaryCurrConditions(BattaryCurrConditionArray);
  AmountOfDischargeBattariesConditionType AmountOfDischargeBattaries = noOne;
  
  for(int currBattary = INP_0; currBattary <= BATTARY_AMOUNT; currBattary++)
  {
    Serial.println("Time of discharging of battary number ", currBattary);
  }
 
 
  
}
 
void loop() {
  // put your main code here, to run repeatedly:
   
}
 
void initBattaryDischargingTimeArray(BattaryDischargingTimeType *BattaryDischargingTimeArray)
{
  for(int currBattary = INP_0; currBattary <= BATTARY_AMOUNT; currBattary++)
  {
    BattaryDischargingTimeArray[currBattary].Days = 0;
    BattaryDischargingTimeArray[currBattary].Hours = 0;
    BattaryDischargingTimeArray[currBattary].Minutes = 0;
    BattaryDischargingTimeArray[currBattary].Seconds = 0;
    BattaryDischargingTimeArray[currBattary].Milliseconds = 0; 
  }
}
 
void setBattaryCurrConditions(BattaryCurrConditionType *BattaryCurrConditionArray)
{
  for(int currBattary = INP_0; currBattary <= BATTARY_AMOUNT; currBattary++)
  {
    BattaryCurrConditionArray[currBattary] = Charge;
  }
}

 

asam
asam аватар
Offline
Зарегистрирован: 12.12.2018

avtodor пишет:

 
Почему компилятор ругается на строку Serial.println("Time of discharging of battary number ", currBattary);? Как написать правильно эту инструкцию?
 

 

Потому что Serial.println принимает только один параметр. Разделите на Serial.print и Serial.println

mykaida
mykaida аватар
Offline
Зарегистрирован: 12.07.2018

asam пишет:

Потому что Serial.println принимает только один параметр. Разделите на Serial.print и Serial.println

Ну не совсем так - Serial.println может еще иметь параметр формата вывода, но выводит, конечно, только что-то одно. Уважаемый ТС - почитайте про Serial.println, Serial.print или вы читать не умеете?