It is currently 20 Apr 2018 02:10

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: 09 Dec 2017 18:14 
Offline

Joined: 02 Mar 2016 15:45
Posts: 15
when i try to convert ardunio code to mikroc i take some errors and i dont know how they fix. anyone help?
this the my header file from ardunio.
     


class HX711
{
   private:
      byte PD_SCK;   // Power Down and Serial Clock Input Pin
      byte DOUT;      // Serial Data Output Pin
      byte GAIN;      // amplification factor
      long OFFSET = 0;   // used for tare weight
      float SCALE = 1;   // used to return weight in grams, kg, ounces, whatever

   public:
      
      HX711(byte dout, byte pd_sck, byte gain = 128);

      HX711();

      virtual ~HX711();

      void begin(byte dout, byte pd_sck, byte gain = 128);

         bool is_ready();

   
      void set_gain(byte gain = 128);

   
      long read();
   
      long read_average(byte times = 10);

   
      double get_value(byte times = 1);

   
      float get_units(byte times = 1);

      void tare(byte times = 10);

      void set_scale(float scale = 1.f);

      float get_scale();

      void set_offset(long offset = 0);

      long get_offset();

      void power_down();

      void power_up();
};

 


when i implement i take these errors:
   

4 371 Specifier needed hx711-2.h
4 396 Invalid declarator expected'(' or identifier hx711-2.h
8 402 ; expected, but 'DOUT' found hx711-2.h
9 402 ; expected, but 'GAIN' found hx711-2.h
9 393 'byte' Identifier redefined hx711-2.h
13 371 Specifier needed hx711-2.h
13 396 Invalid declarator expected'(' or identifier hx711-2.h
17 300 Syntax Error: ')' expected,  but 'dout' found hx711-2.h
17 402 ; expected, but 'pd_sck' found hx711-2.h
17 393 'byte' Identifier redefined hx711-2.h
17 402 ; expected, but ',' found hx711-2.h
17 312 Internal error '' hx711-2.h
0 122 Compilation Started hx711ardunio.c
0 123 Compiled Successfully hx711ardunio.c
-1 122 Compilation Started hx711ardunio2.c
-1 123 Compiled Successfully hx711ardunio2.c
0 102 Finished (with errors): 09 Ara 2017, 19:29:59 hx711.mcppi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron