Codeing Error in MegaPi Firmware; ledMx.showNum(readFloat(8),3);


#1

There seems to be an error in the MegaPi firmware, the last line of code listed under case LEDMATRIX: is ledMx.showNum(readFloat(8),3);. After several attempts to compile the code failed, so I added two forward slashes to the code so it now reads // ledMx.showNum(readFloat(8),3); , it now compiles and uploaded successfully.
so now for the question. Does anyone know what the line of code is used for?


#2

Hi Brag,

Thanks for your sharing.
Here we tested the program on MegaPi, both the compile and upload work properly without delete the ledMx.showNum(readFloat(8),3).

Please check if you use the latest version Library file, here is the link to download the latest one:
https://github.com/Makeblock-official/Makeblock-Libraries/archive/master.zip

This code is to display numbers on face panel.


#3

Thank you for quick response.

I’ve pasted the error message below for your review.

Thank you, Brad

Arduino: 1.6.9 (Windows 10), Board: “Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)”

In file included from C:\Users\bbartik\Documents\Arduino\libraries\makeblock\src/MeMegaPi.h:62:0,

             from C:\Users\bbartik\AppData\Local\Temp\arduino_modified_sketch_476491\Firmware_for_MegaPi.ino:20:

C:\Users\bbartik\Documents\Arduino\libraries\makeblock\src/MeStepperOnBoard.h:73:0: warning: “SLOT_1” redefined [enabled by default]

#define SLOT_1 1

^

In file included from C:\Users\bbartik\Documents\Arduino\libraries\makeblock\src/Me7SegmentDisplay.h:65:0,

             from C:\Users\bbartik\Documents\Arduino\libraries\makeblock\src/MeMegaPi.h:39,

             from C:\Users\bbartik\AppData\Local\Temp\arduino_modified_sketch_476491\Firmware_for_MegaPi.ino:20:

C:\Users\bbartik\Documents\Arduino\libraries\makeblock\src/MePort.h:114:0: note: this is the location of the previous definition

#define SLOT_1 SLOT1

^

In file included from C:\Users\bbartik\Documents\Arduino\libraries\makeblock\src/MeMegaPi.h:62:0,

             from C:\Users\bbartik\AppData\Local\Temp\arduino_modified_sketch_476491\Firmware_for_MegaPi.ino:20:

C:\Users\bbartik\Documents\Arduino\libraries\makeblock\src/MeStepperOnBoard.h:74:0: warning: “SLOT_2” redefined [enabled by default]

#define SLOT_2 2

^

In file included from C:\Users\bbartik\Documents\Arduino\libraries\makeblock\src/Me7SegmentDisplay.h:65:0,

             from C:\Users\bbartik\Documents\Arduino\libraries\makeblock\src/MeMegaPi.h:39,

             from C:\Users\bbartik\AppData\Local\Temp\arduino_modified_sketch_476491\Firmware_for_MegaPi.ino:20:

C:\Users\bbartik\Documents\Arduino\libraries\makeblock\src/MePort.h:115:0: note: this is the location of the previous definition

#define SLOT_2 SLOT2

^

In file included from C:\Users\bbartik\Documents\Arduino\libraries\makeblock\src/MeMegaPi.h:62:0,

             from C:\Users\bbartik\AppData\Local\Temp\arduino_modified_sketch_476491\Firmware_for_MegaPi.ino:20:

C:\Users\bbartik\Documents\Arduino\libraries\makeblock\src/MeStepperOnBoard.h:77:0: warning: “SLOT1” redefined [enabled by default]

#define SLOT1 SLOT_1

^

In file included from C:\Users\bbartik\Documents\Arduino\libraries\makeblock\src/Me7SegmentDisplay.h:65:0,

             from C:\Users\bbartik\Documents\Arduino\libraries\makeblock\src/MeMegaPi.h:39,

             from C:\Users\bbartik\AppData\Local\Temp\arduino_modified_sketch_476491\Firmware_for_MegaPi.ino:20:

C:\Users\bbartik\Documents\Arduino\libraries\makeblock\src/MePort.h:112:0: note: this is the location of the previous definition

#define SLOT1 (1)

^

In file included from C:\Users\bbartik\Documents\Arduino\libraries\makeblock\src/MeMegaPi.h:62:0,

             from C:\Users\bbartik\AppData\Local\Temp\arduino_modified_sketch_476491\Firmware_for_MegaPi.ino:20:

C:\Users\bbartik\Documents\Arduino\libraries\makeblock\src/MeStepperOnBoard.h:78:0: warning: “SLOT2” redefined [enabled by default]

#define SLOT2 SLOT_2

^

In file included from C:\Users\bbartik\Documents\Arduino\libraries\makeblock\src/Me7SegmentDisplay.h:65:0,

             from C:\Users\bbartik\Documents\Arduino\libraries\makeblock\src/MeMegaPi.h:39,

             from C:\Users\bbartik\AppData\Local\Temp\arduino_modified_sketch_476491\Firmware_for_MegaPi.ino:20:

C:\Users\bbartik\Documents\Arduino\libraries\makeblock\src/MePort.h:113:0: note: this is the location of the previous definition

#define SLOT2 (2)

^

C:\Users\bbartik\AppData\Local\Temp\arduino_modified_sketch_476491\Firmware_for_MegaPi.ino: In function ‘void runModule(uint8_t)’:

Firmware_for_MegaPi:1472: error: ‘class MeLEDMatrix’ has no member named ‘showNum’

       ledMx.showNum(readFloat(8),3);

             ^

C:\Users\bbartik\AppData\Local\Temp\arduino_modified_sketch_476491\Firmware_for_MegaPi.ino: In function ‘void readSensor(uint8_t)’:

Firmware_for_MegaPi:1786: error: ‘class MeGyro’ has no member named ‘getDevAddr’

     if((port == 0) && (gyro_ext.getDevAddr() == 0x68))      //extern gyro

                                 ^

C:\Users\bbartik\AppData\Local\Temp\arduino_modified_sketch_476491\Firmware_for_MegaPi.ino: In function ‘void loop()’:

Firmware_for_MegaPi:2739: error: ‘class MeGyro’ has no member named ‘fast_update’

gyro_ext.fast_update();

        ^

Firmware_for_MegaPi:2744: error: ‘class MeGyro’ has no member named ‘getGyroY’

angle_speed = gyro_ext.getGyroY();

                      ^

exit status 1
’class MeLEDMatrix’ has no member named ‘showNum’

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.


#4

Hi Brag,

Have no idea how these error message happen, the makeblock libraries has contain all the files.
Did you download the latest makeblock file and replaced the previous one.


#5

Yes twice, I even removed the arduino ide and reinstalled it.


#6

Hi Brad,

Did you compile this file?

How about install the Arduino and download the latest libraries on another PC, I am afraid that there are files on current PC messed.
Btw, may I have your skype account?


#7

Thank you for the quick response and i was considering the same idea about using a different computer. I’m actually considerIng the possibility of using a different OS also. I’m presntly using Windows 10 and had no problems upgrading the firmware in an Uno, and an Orin, shortly after attempting the upgrade to the MegaPi.

I presently don’t have a Skype account and I keep getting asked why, so I guess it’s time to open one.


#8

The name is correct, however the location was listed with the other firmware.


#9