6 years, 11 months ago.

Solve this error? (Compiler Error L6218E)

Having trouble compilling the following code: ```

  1. include "mbed.h"
  2. include "m3pi.h"
  3. include "wattmeter.h"

wattmeter::wattmeter() { m3pi pi; Photo diode to see when to start meter AnalogOut photdio(p18); Timer for charging time Timer timer; Variable containing with all collected data float Ws; Collects temporary data and adds to "Ws" float Ws_0; Placeholder for pi.battery function (Gets float value for voltage) float bat = pi.battery(); while(photdio == 1) { timer.reset(); timer.start(); Clear LCD pi.cls(); Locate the cursor on the display pi.locate(0,0); pi.printf("Charging: Watt second"); if(timer.read()==1) { Watt calculation - "0.16" = Current (160 mA) - "1" = 1 second Ws_0 = bat*0.16*1; Ws+=Ws_0; Clear LCD pi.cls(); Locate the cursor on the display pi.locate(0,0); Print the total Watt second to LCD pi.printf("%.2f Ws",Ws); } } } ```

I have made a class header for the "wattmeter":

The error that shows up is the following:

Be the first to answer this question.