compiling firmware for specialized chip as Mega

We have printed a hand designed by Open Bionics and are trying to control it using an Arduino Mega. shows the firmware for their Almond control board using Artichoke firmware. I can open the artichoke firmware in the Arduino IDE, but cannot compile it successfully. I get an error, “‘MYSERIAL’ was not declared in this scope”. MYSERIAL was called in several of the libraries that were included with the code. I am including a few- please just let me know if I should post more of them!
I am working under the assumption that the original posted code compiled and that I have to change something due to trying to use this code on the Mega. But I have not been successful in finding what I might have to change to make this work. I would appreciate any help!

Code for Artichoke:

/*	Open Bionics - Artichoke
*	Author - Olly McBride
*	Date - December 2015
*	This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.
*	To view a copy of this license, visit
*	Website -
*	GitHub -
*	Email - 
*	OpenBionics_Artichoke.ino

#include <FingerLib.h>			// This library can be downloaded from
#include <Wire.h>  
#include <EEPROM.h>

#include "Globals.h"
#include "GripControl.h"
#include "CircleBuff.h"
#include "Demo.h"
#include "EMGControl.h"
#include "MotorControl.h"
#include "PinManagement.h"
#include "SerialControl.h"
#include "TimerManagement.h"
#include "Utils.h"

#ifdef USE_I2C_ADC
#include <I2C_ADC.h>			// This library can be downloaded from

#ifdef HANDLE_EN
#include "Wiichuck.h"			// Nunchuck library, written by	
#include "HANDle.h"

*	Open Bionics - Artichoke Release Notes
*	Version	|	Date		|	Notes
*	V1.0.0	|	08/01/16	|	Initial release for Ada hand and Almond boards using Atmega 2560
*	V1.0.1	|	03/02/16	|	Modified formatting and cleaned up
*	V1.1.0	|	31/03/16	|	Added research and HANDle mode. Fixed motorEn and muscle graph
*	V1.1.1	|	17/05/16	|	Increased PWM timer freq to prevent hum and implemented customDelay() instead of delay()		
*	V1.2.0	|	22/08/16	|	Re-written EMG control (now allows both 1 & 2 channel control)
*	Artichoke Description
*		- Simple hand control software designed to run on the Open Bionics Almond hand controller
*		- Uses FingerLib.h for low level finger control, which allows fingers to be treated as servos
*		- Can be controlled via the following methods:
*			- Serial control (baud 38400)
*			- Muscle control (EMG)
*			- HANDle control (Nunchuck)
*		- Uses either inbuilt ADC or external I2C ADC for muscle sensing and hand control
*		- Enter '?' to view available serial commands

void setup()
//	MYSERIAL.begin(38400);    // start serial

#if defined(USE_I2C_ADC) || defined(HANDLE_EN)
	Wire.begin();				// if using I2C for I2C_ADC or for HANDle control, initialise I2C
	timerSetup();				// start timer interrupts
	setDefaults();				// initialise serialCmd.buffs, finger positions and muscle control, read EEPROM presets
	IOconfig();					// config finger pins, initialise port expander

	startUpMessages();			// print welcome message, current hand configuration/settings

void loop()
	if (advancedSettings.muscleCtrlFlag > 0)	// muscle/EMG control

	if (demoFlag)								// demo mode

	// if researchFlag == 1, and no other command is recognised, use CSV string as target motor positions
	if (advancedSettings.researchFlag == 1)		// if 'A10'

#ifdef HANDLE_EN			
	if (advancedSettings.HANDle_en)				// HANDle (Nunchuck) control

Globals.h (5.27 KB)

Globals.cpp (932 Bytes)

SerialControl.cpp (19.3 KB)

SerialControl.h (2.23 KB)

The declaration of 'MYSERIAL' was commented out of FingerLib.h in version 2.0.7:

I guess the code you are using was designed to use an earlier version of FingerLib. You can work around the problem by putting "#define MYSERIAL Serial" at the top of any file where MYSERIAL is "Not declared in this scope".

MYSERIAL is an object from one of the libraries that you likely did not include in the libraries subdirectory of the Arduino IDE. Also, since this seems to be part of a special board (Almond), it may hot work with the Mega. The first step is to make sure all of the libraries are in the right place so you can compile the code. After that, you can determine if the Mega will work or not. If it simply won't compile, that pretty much answers the question.

Never used that but had a quick look at the lib and if you downloaded the FingerLib library, it seems you need to define MYSERIAL in the FingerLib.h file. remove the comment // and set the Serial Port that you are connected to.

as you are on a MEGA you have multiple Serial ports possible, you can use Serial, Serial1, Serial2 or Serial2 (pins --> Serial: 0 (RX) and 1 (TX); Serial 1: 19 (RX) and 18 (TX); Serial 2: 17 (RX) and 16 (TX); Serial 3: 15 (RX) and 14 (TX)).

MYSERIAL is such a crappy name....

Thank you all for the responses:

I commented out the MYSERIAL line to see if that would make the error go away before I could truly solve it. When I did that, it moved the problem to the next occurrence.

I added the declaration to just the globals library and it compiled. Thank you for that suggestion. As mentioned, since I am trying to use this on a different board, I expected more problems than that- I guess I will find all those other issues when I connect the hardware!!

Thank you for the assistance! You all rock!