[API] Driver EEPROM - Thomas-Broussard/hackberry-enableFrance GitHub Wiki
class Hackberry_eeprom
Summary
| Members | Descriptions | 
|---|---|
| public  Hackberry_eeprom() | Constructor of the EEPROM driver (no pins required) | 
| public void SetHand(bool hand) | Save the hand type in the eeprom | 
| public bool GetHand() | Get the hand type saved in the eeprom | 
| public void ChangeHand() | |
| public void SetMinServo(unsigned char member,unsigned char value) | Save the minimum position of a servomotor in the eeprom | 
| public void SetMaxServo(unsigned char member,unsigned char value) | Save the maximum position of a servomotor in the eeprom | 
| public unsigned char GetMinServo(unsigned char member) | Get the minimum position of a servomotor saved in the eeprom | 
| public unsigned char GetMaxServo(unsigned char member) | Get the maximum position of a servomotor saved in the eeprom | 
| public void SetSensorType(unsigned char type) | Save the sensor type in the eeprom | 
| public unsigned char GetSensorType() | Get the sensor type saved in the eeprom | 
| public void SetSensorMax(int value) | Get the max sensor value saved in the eeprom | 
| public int GetSensorMax() | Get the min sensor value saved in the eeprom | 
| public void SetSensorMin(int value) | Save the sensor maximum value in the eeprom | 
| public int GetSensorMin() | Get the sensor minimum value saved in the eeprom | 
| public void printMemoryMap() | Display the memory map on the serial monitor (debug usage only) | 
| public void printMemoryContent() | Display the memory content on the serial monitor (debug usage only) | 
| public void SetMagicWord() | Save the magic word in the eeprom Remark : The magic word is a predefined code save at the beginning of the eeprom memory. It is used to check if the memory had been previously initialized or not. | 
| public bool IsMagicWordCorrect() | Check if the Magic Word is present in eeprom memory or not Remark : The magic word is a predefined code save at the beginning of the eeprom memory. It is used to check if the memory had been previously initialized or not. | 
Members
public  Hackberry_eeprom()
Constructor of the EEPROM driver (no pins required)
public void SetHand(bool hand)
Save the hand type in the eeprom
Parameters
- handRIGHT_HAND or LEFT_HAND
public bool GetHand()
Get the hand type saved in the eeprom
Returns
RIGHT_HAND or LEFT_HAND
public void ChangeHand()
public void SetMinServo(unsigned char member,unsigned char value)
Save the minimum position of a servomotor in the eeprom
Parameters
- 
memberTHUMB, INDEX or FINGERS
- 
valueminimum position (between 0 and 180 degrees)
public void SetMaxServo(unsigned char member,unsigned char value)
Save the maximum position of a servomotor in the eeprom
Parameters
- 
memberTHUMB, INDEX or FINGERS
- 
valuemaxmimum position (between 0 and 180 degrees)
public unsigned char GetMinServo(unsigned char member)
Get the minimum position of a servomotor saved in the eeprom
Parameters
- memberTHUMB, INDEX or FINGERS
Returns
minimum position (between 0 and 180 degrees)
public unsigned char GetMaxServo(unsigned char member)
Get the maximum position of a servomotor saved in the eeprom
Parameters
- memberTHUMB, INDEX or FINGERS
Returns
maximum position (between 0 and 180 degrees)
public void SetSensorType(unsigned char type)
Save the sensor type in the eeprom
Parameters
- typetype of the sensor (TYPE_IR_SENSOR , TYPE_EMG_SENSOR, etc..)
public unsigned char GetSensorType()
Get the sensor type saved in the eeprom
Returns
type of the sensor (TYPE_IR_SENSOR , TYPE_EMG_SENSOR, etc..)
public void SetSensorMax(int value)
Get the max sensor value saved in the eeprom
Returns
sensor max sensor value (MAX_ADC by default)
public int GetSensorMax()
Get the min sensor value saved in the eeprom
Returns
sensor min sensor value (MIN_ADC by default)
public void SetSensorMin(int value)
Save the sensor maximum value in the eeprom
Parameters
- valuemax sensor value (MIN_ADC by default)
public int GetSensorMin()
Get the sensor minimum value saved in the eeprom
Returns
sensor min value (MAX_ADC by default)
public void printMemoryMap()
Display the memory map on the serial monitor (debug usage only)
public void printMemoryContent()
Display the memory content on the serial monitor (debug usage only)
public void SetMagicWord()
Save the magic word in the eeprom Remark : The magic word is a predefined code save at the beginning of the eeprom memory. It is used to check if the memory had been previously initialized or not.
public bool IsMagicWordCorrect()
Check if the Magic Word is present in eeprom memory or not Remark : The magic word is a predefined code save at the beginning of the eeprom memory. It is used to check if the memory had been previously initialized or not.
Returns
true if correct. false otherwise