test

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Uchida0923
Date:
Wed May 30 02:34:33 2018 +0000
Commit message:
???????;

Changed in this revision

DRV2605.cpp Show annotated file Show diff for this revision Revisions of this file
DRV2605.h Show annotated file Show diff for this revision Revisions of this file
Footile.cpp Show annotated file Show diff for this revision Revisions of this file
Footile.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
wave.h Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DRV2605.cpp	Wed May 30 02:34:33 2018 +0000
@@ -0,0 +1,115 @@
+#include "DRV2605.h"
+
+DRV2605::DRV2605(PinName sda, PinName scl, PinName en): i2c(sda, scl), _en(en) {
+    _en = 1;
+    wait_us(250);   // Device datasheet specified wait time before I2C
+    // comms should be used
+    // Exit Standby Mode; Enter Auto- Cal Mode
+    mode(AUTO_CAL);
+    
+    /* Set the following registers to the appropriate values:
+        • Rated Voltage (0x16)
+        • Overdrive Voltage (0x17)
+        • Feedback Control (0x1A) – Bits [1:0] can be left blank and will be
+          populated by the auto-calibration engine
+        • Control 1 (0x1B), Control 2 (0x1C), and Control 3 (0x1D)
+        • Mode (0x01) – Set mode to Auto-Calibration
+        • Auto-calibration Memory Interface (0x1E) – the auto-calibration time
+          can be increased to improve calibration, but can be left as default
+          for the initial calibration
+    */
+    // Rated Voltage (0x16), use default values
+
+    // Calc and Set Overdrive Voltage Register (0x17), use default values
+
+    // Set Feedback Control Register (0x1A), set LRA
+    i2cWriteByte(FEEDBACK_CONTROL, i2cReadByte(FEEDBACK_CONTROL) | LRA); // set LRA
+
+    // Set Control 1 Register (0x1B), use default values
+
+    // Set Control 2 Register (0x1C), use default values
+
+    // Set Control3 Register (0x1D), use default values
+    i2cWriteByte(CONTROL3, i2cReadByte(CONTROL3) | 0x08); // set data format rtp unsigned
+
+    // Set Control 4 Register (0x1E), use default values
+
+    // Device already set to Auto- Cal Mode at top of this code block
+
+    // Start auto- calibration
+    i2cWriteByte(GO, 0x01);
+
+    // Wait for calibration to complete
+    while(i2cReadByte(GO));
+}
+
+void DRV2605::i2cWriteByte(char reg, char value)
+{
+    char buff[2] = {reg, value};
+    i2c.write(SLAVE_ADDR_7_BIT<<1, buff, 2);
+}
+
+uint8_t DRV2605::i2cReadByte(char reg)
+{
+    char result;                                    // Temp result storage
+    i2c.write(SLAVE_ADDR_7_BIT<<1, &reg, 1, true);
+    i2c.read(SLAVE_ADDR_7_BIT<<1, &result, 1);
+
+    return result;
+}
+
+void DRV2605::mode(Mode mode)
+{
+    i2cWriteByte(MODE, mode);
+}
+
+int DRV2605::init(float actuator_peak_voltage, Library lib)
+{
+    i2cWriteByte(LIBRARY_SELECTION, lib);     // Select ROM Library
+    mode(STANDBY);                            // Put device into low- power mode
+    return 0;                            // Cal/Init Result 0: Pass 1: Fail
+}
+
+uint8_t DRV2605::diagnostics()
+{
+    mode(DIAG);
+    i2cWriteByte(GO, 1);
+    while(i2cReadByte(GO));     // Wait for GO bit to clear
+
+    return i2cReadByte(STATUS); // Return Status Reg Value
+}
+
+void DRV2605::play_waveform(int waveform_effect)
+{
+    mode(INTERNAL_TRIG);                                 // Bring device out of standby and set to internal trigger
+    i2cWriteByte(WAVEFORM_SEQUENCER_1, waveform_effect); // Load waveform index to play
+    i2cWriteByte(WAVEFORM_SEQUENCER_2, 0);               // Insert stop condition so we don't play other registers if filled
+    i2cWriteByte(GO, 0x01);                              // Set GO bit to start playback
+}
+
+void DRV2605::load_waveform_sequence(int effect1, int effect2,
+                                     int effect3, int effect4,
+                                     int effect5, int effect6,
+                                     int effect7, int effect8)
+{
+    i2cWriteByte(WAVEFORM_SEQUENCER_1, effect1);
+    i2cWriteByte(WAVEFORM_SEQUENCER_2, effect2);
+    i2cWriteByte(WAVEFORM_SEQUENCER_3, effect3);
+    i2cWriteByte(WAVEFORM_SEQUENCER_4, effect4);
+    i2cWriteByte(WAVEFORM_SEQUENCER_5, effect5);
+    i2cWriteByte(WAVEFORM_SEQUENCER_6, effect6);
+    i2cWriteByte(WAVEFORM_SEQUENCER_7, effect7);
+    i2cWriteByte(WAVEFORM_SEQUENCER_8, effect8);
+}
+
+void DRV2605::play()
+{
+    i2cWriteByte(MODE, INTERNAL_TRIG);      // Internal Trigger Mode
+    i2cWriteByte(GO, 1);
+}
+
+void DRV2605::rtp(char amp)
+{
+    i2cWriteByte(MODE, RTP);      // RTP Mode
+    i2cWriteByte(REAL_TIME_PLAYBACK, amp);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DRV2605.h	Wed May 30 02:34:33 2018 +0000
@@ -0,0 +1,210 @@
+/*
+    Taku Hachisu 06/01/2017
+    Modifined by Masayuki Uchida 10/18/2017
+    
+    Library for the TI DRV2605L for LRA
+    Modifined from Bryce WilliamsBryce Williams's code
+     
+    References:
+    http://www.ti.com/product/DRV2605L/description&lpos=Middle_Container&lid=Alternative_Devices
+    http://www.ti.com/lit/ds/symlink/drv2605l.pdf (Datasheet) 
+    http://www.ti.com/lit/an/sloa189/sloa189.pdf (Setup Guide; SLOA189)
+    https://developer.mbed.org/users/electromotivated/code/DRV2605/
+*/
+
+#ifndef DRV2605_H
+#define DRV2605_H
+
+#include "mbed.h"
+
+/******************************************************************************
+***** DRV2605 Addresses
+******************************************************************************/
+#define SLAVE_ADDR_7_BIT 0x5A // 7-bit slave address 
+
+/******************************************************************************
+****** DRV2605 REGISTERS ******************************************************
+******************************************************************************/
+#define STATUS                               0x00
+#define MODE                                 0x01
+#define REAL_TIME_PLAYBACK                   0x02
+#define LIBRARY_SELECTION                    0x03
+#define WAVEFORM_SEQUENCER_1                 0x04
+#define WAVEFORM_SEQUENCER_2                 0x05
+#define WAVEFORM_SEQUENCER_3                 0x06
+#define WAVEFORM_SEQUENCER_4                 0x07
+#define WAVEFORM_SEQUENCER_5                 0x08
+#define WAVEFORM_SEQUENCER_6                 0x09
+#define WAVEFORM_SEQUENCER_7                 0x0A
+#define WAVEFORM_SEQUENCER_8                 0x0B
+#define GO                                   0x0C
+#define OVERDRIVE_TIME_OFFSET                0x0D
+#define POSITIVE_SUSTAIN_TIME_OFFSET         0x0E
+#define NEGATIVE_SUSTAIN_TIME_OFFSET         0x0F
+#define BRAKE_TIME_OFFSET                    0x10
+#define AUDIO_TO_VIBE_CONTROL                0x11
+#define AUDIO_TO_VIBE_MINIMUM_INPUT_LEVEL    0x12
+#define AUDIO_TO_VIBE_MAXIMUM_INPUT_LEVEL    0x13
+#define AUDIO_TO_VIBE_MINIMUM_OUPUT_DRIVE    0x14
+#define AUDIO_TO_VIBE_MAXIMUM_OUTPUT_DRIVE   0x15
+#define RATED_VOLTAGE                        0x16
+#define OVERDRIVE_CLAMP_VOLTAGE              0x17
+#define AUTO_CALIBRATION_COMPENSATION_RESULT 0x18
+#define AUTO_CALIBRATION_BACK_EMF_RESULT     0x19
+#define FEEDBACK_CONTROL                     0x1A
+#define CONTROL                              0x1B
+#define CONTROL2                             0x1C
+#define CONTROL3                             0x1D
+#define CONTROL4                             0x1E
+#define CONTROL5                             0x1F
+#define LRA_OPEN_LOOP_PERIOD                 0x20
+#define VBAT_VOLTAGE_MONITOR                 0x21
+#define LRA_RESONANCE_PERIOD                 0x22
+
+class DRV2605{
+    
+    public:
+        //// modes defines the possible modes of the DRV2605L
+        enum Mode{
+            INTERNAL_TRIG,   // 0x00: Waveforms fired by Setting GO bit in Register 0x0C
+            EXTERNAL_EDGE,   // 0x01: Rising Edge on IN/TRIG pin set GO Bit.
+            EXTERNAL_LEVEL,  // 0x02: GO bit follows state of edge on IN/TRIG pin. 
+            PWM_ANALOG,      // 0x03: PWM or Analog Signal accepted at IN/TRIG pin.
+            AUDIO_TO_VIBE,   // 0x04: An AC-coupled audio signal is accepted at the IN/TRIG pin.
+            RTP,             // 0x05: Real- Time Playback
+            DIAG,            // 0x06: Set to perform actuator diagnostics
+            AUTO_CAL,        // 0x07: Set to perform auto calibration of device for actuator 
+            STANDBY = 0x40,  // 0x40: Set Device to Software Standby (Low- Power Mode)
+            RESET = 0x80,    // 0x80: Reset Device (equivalent of power cycling the device)
+         };
+         
+         //// FeedBack_Controls Fields Bitmasks (Register Addr: 0x1A)
+         enum Actuator_Type{ERM = 0, LRA = 0x80}; // bit-7
+         enum Brake_Factor{x1 = 0x00, x2 = 0x10, x3 = 0x20, 
+                           x4 = 0x40, x6 = 0x80, x8 = 0x50, 
+                           x16 = 0x60, DISABLE = 0x70}; // bit-6..4
+         enum Loop_Gain{LOW = 0x00, 
+                        MED = 0x04, 
+                        HIGH = 0x08, 
+                        VERY_HIGH = 0x0C};  // bit-3..2
+                    
+         enum Library{EMPTY, A, B, C, D, E,
+                      LRA_LIB, F};              // ROM Waveform Library Selections
+        
+        enum AUD {
+            a=0x00,b=0x44,c=0x55
+            };
+        
+        /**
+            Constructor for DRV2605 Objects
+        */
+        DRV2605(PinName sda, PinName scl, PinName en);
+        
+        /**
+            Write value to specified register of device
+            @param reg      The device register to write 
+            @param value    The value to write to the register
+        */
+        void i2cWriteByte(char reg, char value);
+        
+        /**
+            Read value from register of device
+            @param reg  The device register to read
+            @return     The result
+        */
+        uint8_t i2cReadByte(char reg);
+        
+        /**
+            Place device into specified mode
+            @param mode     The mode to place device into
+        */
+        void mode(Mode mode);
+        
+        /**
+            TODO: Expand to allow initialization for LRAs and Closed Loop operation 
+            Initialize the device for Open- Loop ERM mode using specified ROM 
+            Waveform Library as specified in Section 9.3 of Device Datasheet.
+            See also Device Setup Guide 1.6.1 ERM Initialization Example
+            @param actuator_peak_voltage    The Peak Voltage Rating of Actuator
+            @param lib  The ROM Waveform Library to use
+        */
+        int init(float actuator_peak_voltage, Library lib = B);
+        
+        /**
+            Runs diagnostics on the Actuator and Device and returns the results. 
+            The results indicate if an actuator is detected, over- current events, 
+            etc. Refer to STATUS Register (0x00) in device datasheet for more 
+            description register values.
+            
+            Note: This should be run if the user is having trouble getting the actuator 
+            to work.
+            
+            @return The results of the diagnostics (i.e. Status Reg (0x00))
+        */
+        uint8_t diagnostics();
+        
+        /**
+            Play single waveform from ROM Library as outlined in Section 9.3.2.1
+            of Device Datasheet.
+            The library used is the one that is currently written 
+            to the Library_Selection Register (0x03). This library
+            is set in the init(Library lib) method, but can be 
+            changed manually.
+            @param waveform_effect  The Waveform Effect Library Index value to play
+                                    (valid values are 1 to 123)
+        */
+        void play_waveform(int waveform_effect);
+        
+        /**
+            Load Wave Sequence into DRV2605 Sequence Registers
+            @param effect1... effect8   The effect to play. Valid inputs are 
+                                        0 to 123; 0: Stop Condition, 
+                                                  1- 123: Waveform Index
+        */
+        void load_waveform_sequence(int effect1 = 0, int effect2 = 0, 
+                                    int effect3 = 0, int effect4 = 0,
+                                    int effect5 = 0, int effect6 = 0, 
+                                    int effect7 = 0, int effect8 = 0);
+        
+        /**
+            Plays the currently loaded waveform or waveform sequence. 
+            Call this after calling play_waveform() or after calling 
+            load_waveform_sequence()
+            Preconditions: User must have already loaded waveform(s) 
+                           using play_waveform() or load_waveform_sequence()
+        */
+        void play();
+        
+        /**
+            hogehoge
+        */
+        void rtp(char amp);
+        
+        /**
+            TODO: Add Closed Loop Calibration
+            
+            Run basic DRV2605L Auto- Calibration as detailed in Section 2 of 
+            the Device Setup Guide for OPEN- LOOP ONLY.
+            This must be done before using the device in closed- loop mode 
+            (unless cal has been done before with values stored in non-volatile
+             mem; see datasheet for more info). 
+                
+            NOTE: It is NOT recommended to store cal values into device 
+            non-volatile memory as this can be done only once. Thus do not 
+            use this feature unless the device is being used in a final 
+            project AND values have been confirmed to result in satisfactory 
+            performance).
+                
+            This uses many of the default device register values such as
+            the default DRIVE_TIME .
+
+            @param actuator_peak_voltage The maximum/peak voltage rating of the actuator
+        */
+        uint8_t auto_cal_open_loop(float actuator_peak_voltage);        
+          
+    private:
+    I2C i2c;
+    DigitalOut _en;
+};
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Footile.cpp	Wed May 30 02:34:33 2018 +0000
@@ -0,0 +1,277 @@
+#include "Footile.h"
+#include <math.h>
+
+//myFootile(P0_8, P0_9, P0_10, P0_11, P0_12, P0_19, P0_18, P0_7, P0_17, P0_5, P0_4, P0_22);
+Footile::Footile(PinName led1, PinName led2, PinName led3, PinName trg, PinName ad, PinName tx, PinName rx, PinName io1, PinName io2, PinName sda, PinName scl, PinName en):
+    _led1(led1), _led2(led2), _led3(led3), _trg(trg), _prssr(ad), _bt(tx, rx), _btDummy1(io1), _btDummy2(io2), _Vibration(sda, scl, en)
+{
+
+    //_Vibration.i2cWriteByte(LIBRARY_SELECTION, _Vibration.LRA_LIB);
+    //_Vibration.i2cWriteByte(MODE, _Vibration.PWM_ANALOG);
+    
+
+    _led1 = 1;
+    _led2 = 1;
+    _led3 = 1;
+    _volumeBuf=255;
+    
+    //flag
+    /*
+    SteadyMode=false;
+    SinewaveMode=true;
+    ChangeFlag=true;
+    CorrespondMode=false;
+    ConnectCheck=false;
+    snowMode=false;
+    grassMode=false;
+    */
+    SteadyMode=false;
+    SinewaveMode=false;
+    CorrespondMode=false;
+    ChangeFlag=true;
+    snowMode=true;
+    grassMode=false;
+    
+    _sens=0.8;
+    
+    _countSize=0;
+    
+    _on=0;
+
+    _trans.attach(this,&Footile::_transmission,0.5);
+    _bt.attach(this, &Footile::_onReceive, Serial::RxIrq);
+    _btDummy1 = 0;
+    _btDummy2 = 0;
+    
+    
+    //_Vibration.rtp((char)(255)); 
+    
+    _heart.attach(this, &Footile::_beat, 2.0);
+}
+
+
+
+void Footile::doFunctions()
+{
+    static int prv_on = 0,Volume=0;
+    
+
+
+    // make hysteresis
+    if(_prssr > _sens)
+        _on = 1;
+    if(_prssr < 0.2)
+        _on = 0;
+
+    if(_on && !prv_on||ChangeFlag==true) {
+        _trg = 1;
+        _led1 = 0;
+        Volume=_volumeBuf;
+        if(SinewaveMode==true){
+            _Vibration.rtp((char)(Volume)); 
+        }
+        _bt.printf("%d\n",_prssr);
+    }
+    if(!_on && prv_on||ChangeFlag==true) {
+        _trg = 0;
+        _countSize=0;
+        if(SteadyMode==false&&SinewaveMode==true){
+            Volume=0;//When Not c=125
+            _Vibration.rtp((char)(Volume)); 
+        }
+    }
+    
+    prv_on = _on;
+
+    
+    if(snowMode==true||grassMode==true){
+        _viber.attach(this, &Footile::VibeTimer,0.001);
+    } else{
+       _viber.detach();     
+    }
+    
+    ChangeFlag=false;
+        
+    if(CorrespondMode==true){  
+        _Vibration.rtp((char)(_volumeBuf*_prssr));
+    }
+    wait(0.001);
+}
+
+
+void Footile::OnVibe(const float* wave, int size){
+    if(_countSize < size){
+        _Vibration.rtp((char)(wave[_countSize]*255));
+            _countSize++;
+    }
+    else  {
+            _Vibration.rtp((char)0);     
+    }
+}
+
+
+void Footile::VibeTimer(){
+    if(_on==1&&snowMode==true){
+        OnVibe(snowwave500, (int)(sizeof(snowwave500)/sizeof(snowwave500[0])));
+    }else if(_on==1&&grassMode==true){
+        OnVibe(grasswave, (int)(sizeof(grasswave)/sizeof(grasswave[0])));
+    }
+    else if(_on==0){
+        _Vibration.rtp((char)0);    
+    }
+}
+
+
+
+
+
+
+
+
+
+
+// interruption on receiving
+void Footile::_onReceive(void)
+{
+    unsigned short num[5];
+    unsigned short data_index = 0;
+    unsigned short index;
+    unsigned short data=0;
+    
+    ConnectCheck=true;
+    
+    for(int i=0;i<sizeof(num);i++){
+        num[i]=0;    
+    }
+
+    while(1) {
+        if (!_bt.readable()) continue;
+        
+        char let = _bt.getc();
+        //_bt.printf("%c",let);
+        data_index++;
+        
+        if (let == '\n')
+        {
+           // num[data_index-1] = 0;
+            break;          
+        }else{
+            num[data_index]=let-'0';
+            }
+    }
+        
+    index=data_index-1; 
+    
+    for(int i=0;i<data_index-1;i++){
+        data+=(unsigned short)(pow(10.0,(double)i))*num[index];//get unsigned short values
+        index--;
+    }
+     
+     data_index = 0;
+    // echo back    
+    _bt.printf("%d",data);
+    _modeChange(data);
+    data=0;
+   
+}
+
+
+
+
+
+
+
+
+
+
+
+
+void Footile:: _modeChange(unsigned short c){
+    
+        // PWM mode
+    if(c == 0) {
+        SteadyMode=false;
+        SinewaveMode=true;
+        ChangeFlag=true;
+        CorrespondMode=false;
+        snowMode=false;
+        grassMode=false;
+        /*_Vibration.i2cWriteByte(MODE, _Vibration.PWM_ANALOG);
+        _heart.attach(this, &Footile::_beat, 1.0);
+        ChangeFlag=true;*/
+        // Wavefrom sequencer mode
+    } else if (0 < c && c <= 123) { //Change waveform
+        SteadyMode=false;
+        SinewaveMode=false;
+        ChangeFlag=false;
+        CorrespondMode=false;
+        snowMode=false;
+        grassMode=false;
+        _Vibration.i2cWriteByte(WAVEFORM_SEQUENCER_1, c);
+        _Vibration.i2cWriteByte(MODE, _Vibration.EXTERNAL_LEVEL);
+        _heart.attach(this, &Footile::_beat, 1.0);
+        // Standby mode
+        
+    }else if(c==124){   //SteadyMode
+        SteadyMode=true;
+        SinewaveMode=true;
+        ChangeFlag=true;
+        CorrespondMode=false;
+        snowMode=false;
+        grassMode=false;
+    }else if (125<=c&&c<=255) {   //Change Magnituide
+        if(SteadyMode==false&&SinewaveMode==false){
+            ChangeFlag=false;    
+        }else{
+            ChangeFlag=true;
+        }
+        _volumeBuf=(c-125)*255/(255-125);
+        
+    }else if(c==256){ //Change Amplitude Mode
+        CorrespondMode=true;
+        ChangeFlag=false;
+    }else if(257<=c&&c<=261){   //Change Sensitvty(257<=c<=266)
+        _sens=(c-257)*0.5/4.0+0.3;
+    }else if(262<=c&&c<=266){
+        _sens=(c-262)*0.15/4.0+0.8;
+    }
+    
+    else if(c==267){
+        SteadyMode=false;
+        SinewaveMode=false;
+        CorrespondMode=false;
+        ChangeFlag=true;
+        snowMode=true;
+        grassMode=false;
+    }else if(c==268){
+        SteadyMode=false;
+        SinewaveMode=false;
+        CorrespondMode=false;
+        ChangeFlag=true;
+        snowMode=false;
+        grassMode=true;        
+    }
+    else {
+        _Vibration.i2cWriteByte(MODE, _Vibration.STANDBY);
+        _heart.attach(this, &Footile::_beat, 2.0);
+    }
+    
+    
+    
+}
+
+void Footile::_transmission(void)
+{
+    _bt.printf("a");
+    
+    if(ConnectCheck==true){
+        _trans.detach();
+    }
+}
+
+
+// heart beat
+void Footile::_beat(void)
+{
+    _led2 = !_led2;
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Footile.h	Wed May 30 02:34:33 2018 +0000
@@ -0,0 +1,71 @@
+/*
+    Taku Hachisu 06/01/2017
+
+    Footile demo for WHC2017
+*/
+
+#ifndef FOOTILE_H
+#define FOOTILE_H
+
+#include "mbed.h"
+#include "DRV2605.h"
+
+#include "wave.h"
+
+
+
+class Footile
+{
+
+public:
+    /**
+        Constructor for Footile Objects
+    */
+    Footile(PinName led1, PinName led2, PinName led3, PinName trg, PinName ad, PinName tx, PinName rx, PinName io1, PinName io2, PinName sda, PinName scl, PinName en);
+
+    /**
+        functions
+    */
+    void doFunctions(void);
+
+private:
+    DRV2605 _Vibration;
+    DigitalOut _led1;   // for debugging
+    DigitalOut _led2;   // for debugging
+    DigitalOut _led3;   // for debugging
+    DigitalOut _trg;
+    AnalogIn _prssr;
+    Serial _bt;
+    DigitalOut _btDummy1; // LPC11U24 does not support flow control
+    DigitalOut _btDummy2; // LPC11U24 does not support flow control
+    Ticker _heart;
+    Ticker _trans;
+    
+    Ticker _viber;
+    
+    int _volumeBuf;
+    float _sens;
+    char _buf[5];
+    int _countSize;
+    int _on;
+    
+    
+    bool ChangeFlag;
+    bool SteadyMode;
+    bool SinewaveMode;
+    bool CorrespondMode;
+    bool ConnectCheck;
+    bool snowMode;
+    bool grassMode;
+    
+    void _onReceive(void);
+    void _beat(void);
+    void _transmission(void);
+    unsigned short ctoi(char c);
+    void _modeChange(unsigned short c);
+    void VibeTimer();
+    void OnVibe(const float* wave, int size);
+    
+};
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed May 30 02:34:33 2018 +0000
@@ -0,0 +1,10 @@
+#include "mbed.h"
+#include "Footile.h"
+
+Footile myFootile(P0_8, P0_9, P0_10, P0_11, P0_12, P0_19, P0_18, P0_7, P0_17, P0_5, P0_4, P0_22);
+
+int main() {
+    while(1){
+        myFootile.doFunctions();
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed May 30 02:34:33 2018 +0000
@@ -0,0 +1,1 @@
+https://mbed.org/users/mbed_official/code/mbed/builds/0f02307a0877
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wave.h	Wed May 30 02:34:33 2018 +0000
@@ -0,0 +1,36 @@
+
+const float sinewave[]={
+0.00, 0.19, 0.37, 0.54, 0.68, 0.81, 0.90, 0.97, 1.00, 0.99, 0.95, 0.88, 0.77,
+0.64, 0.48, 0.31, 0.13, -0.06, -0.25, -0.43, -0.59, -0.73, -0.84, -0.93, -0.98,
+-1.00, -0.98, -0.93, -0.84, -0.73, -0.59, -0.43, -0.25, -0.06};
+
+const float gravelwave[]={
+    0.7,1,0.75,0,0,0,0,0,1,1,1,0.85,0,0,0,0.05,1,1,1,0,0,0,1,1,1,0.5,0,0,0.15,1,1,1,0.9,0,0,0.4,1,1,1,0.7,0.1,0.25,0.85,1,1,0.95,0.95,0.65,0.6,0.65,0.75,1,0.9,0.8,0.75,0.9,0.85,0.75,0.65,0.6,0.55,0.8,0.85,0.75,0.65,0.55,0.5,0.65,0.8,0.7,0.7,0.6,0.5,0.55,0.55,0.65,0.7,0.6,0.6,0.6,0.55,0.6,0.5,0.65,0.6,0.6,0.55,0.55,0.55,0.5,0.55,0.55,0.5,0.5,0.5,0.55,0.45,0.45,0.45,0.45,0.55,0.5,0.45,0.45,0.45,0.45,0.4,0.45,0.45,0.45,0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.35,0.35,0.4,0.4,0.35,0.35,0.35,0.35,0.4,0.35,0.3,0.25,0.3,0.35,0.4,0.35,0.3,0.2,0.25,0.35,0.35,0.35,0.3,0.25,0.2,0.3,0.3,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.2,0.25,0.25,0.25,1,0.15,0.2,0.2,0.25,0.25,0.25,0.2,0.2,0.25,0.15,0.25,0.2,0.2,0.2,0.2,0.15,0.1,0.2,0.15,0.25,0.25,0.2,0.1,0.15,0.1,0.1,0.1,0.2,0.2,0.2,0.15,0.15,0.05,0.05,0.15,0.2,0.2,0.15,0.1,0.05,0.15,0.15,0.1,0.1,0.1,0.05,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.05,0.05,0.15,0.1,0.15,0.05,1,0.1,0.1,0.05,0.05,0.05,0.05,0.1,0.1,0.05,0.05,0,0,0.05,0.05,0.15,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0,0,0,0.05,0.1,0.1,0,0,0,0,0,0,0.05,0.05,0,0,0,0,0,0,0.05,0,0,0,0,1,0,0,0.05,0.05,0,0,0,0.05};
+
+const float snowwave150[]={
+    0.333 ,0.037 ,0.074 ,0.000 ,0.500 ,0.222 ,0.241 ,0.130 ,0.130 ,0.093 ,0.074 ,0.037 ,0.019};
+
+const float snowwave500[]={
+    1,1,0.15,0,0,0,1,1,1,0.45,0,0,0,1,1,1,0.1,0,0,0,1,1,1,0,0,0,0.45,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,0,0,1,1,1,0.9,0,0,0.5,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,1,1,1,1,0.35,0,0,0.65,1,1,1,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,0,0,0,0.95,1,1,1,0,0,0,1,1,1,1,0,0,0.55,1,1,1,0.6,0,0,1,1,1,1,0.05,0,0.15,1,1,1,1,0,0,1,1,1,1,0.4,0,0.5,1,1,1,0.85,0.2,0.5,1,1,1,0.9,0.4,0.6,1,1,1,0.75,0.2,0.45,1,1,1,0.7,0,0.15,1,1,1,1,0.05,0,0.4,1,1,1,0.7,0,0,0.6,1,1,1,0.55,0,0.05,0.7,1,1,1,0.55,0.2,0.25,0.65,1,0.75,0.75,0.75,0.7,0.65,0.7,0.65,0.7,0.7,0.65,0.65,0.65,0.65,0.6,0.6,0.6,0.6,0.6,0.6,0.6,0.6,0.55,0.6,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.5,0.55,0.55,0.55,0.5,0.5,0.55,0.5,0.45,0.5,0.5,0.5,0.45,0.5,0.45,0.45,0.45,0.45,0.45,0.45,0.45,0.45,0.45,0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.35,0.3,0.35,0.3,0.35,0.35,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.25,0.3,0.25,0.3,0.25,0.25,0.25,0.25,0.25,0.25,0.3,0.25,0.25,0.25,0.2,0.25,0.25,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.15,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.15,0.2,0.2,0.2,0.15,0.15,0.2,0.15,0.15,0.15,0.2,0.15,0.1,0.15,0.2,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.1,0.15,0.15,0.15,0.1,0.1,0.1,0.1,0.15,0.1,0.05,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.15,0.1,0.05,0.1,0.1,0.05,0.1,0.1,0.1,0.1,0.1,0.05,0.05,0.1,0.05,0.05,0.05,0.05,0.05,0.05,0.1,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0,0,0.05,0.05,0.05,0.05};
+
+const float leafwave[]={
+    0.357,0.142,0.428,0.5,0.142,0,0.285,0.071,0,0,0.142,0,0.0714,0.214,0.357,0.214};
+
+const float leafwave2[]={
+    0.25,1,0,0.35,0,0.05,0,1,0.55,0,0.95,0,1,0,1,0,0.65,0,1,1,0.05,1,0,0,0,1,1,1,0.2,1,1,0,0,1,0,1,0.95,0,1,0.45,0.7,0,0,0,1,0,0,0.65,0.85,1,1,0,1,1,0.85,1,1,1,0,1,1,0.8,1,1,1,1,1,1,1,1,1,1,0.4,1,0,0,1,1,1,0,1,0,1,1,0.15,0,0,1,1,0,1,1,0.1,0,1,1,0.15,1,1,0,0.55,1,1,1,0,0.9,0,1,1,1,0,1,0,1,0.35,1,1,1,1,1,0,1,0,1,1,0.5,0.5,1,0.75,1,1,0,0,0.25,0.8,1,0.75,0.15,0.75,1,0.55,0.7,0,1,0,1,1,1,0.15,0.15,1,0.3,1,1,0,1,1,0.65,0,0.15,1,1,1,1,1,0,1,1,1,0.35,1,1,1,1,1,0.75,1,0.45,1,0.7,0.85,0.75,0,0.85,1,0.9,0.8,0.85,1,0.85,0.1,0.7,0.6,1,1,0.75,1,0.25,0.95,0,0.65,0.75,0.6,1,1,0.85,1,0.45,1,0.8,0.85,0.45,0.55,0,0.4,0,1,1,1,0.8,1,1,1,0.55,0.85,1,1,0.35,1,0.6,0.75,0.95,0.4,0.2,0.6,0,0.6,0.45,0.1,1,1,0.75,0.9,0.45,0.8,1,0,0.45,0.2,0,0.55,0,0,0,0.55,0,0.1,0,0.25,0.45,0.8,0.35,1,0.1,0,0.75,0.15,0,0,0,1,0.5,1,0.3,0.55,1,0.05,0,0.35,0.65,0.15,0,1,0,0,0.95,0.35,0,1,1,1,0,0,1,0.3,0.55,0,0,1,0.8,0,0.65,1,0.05,1,1,1,0.8,1,1,0.65,1,0.8,0.9,1,0.1,1,0.6,1,0,0,0.85,0,0.7,0.4,0,1,0.4,0.75,0.65,0.7,0.95,1,0.8,0.6,0.85,0.55,0,0.65,0,0.2,0.55,1,0.7,0.5,0.4,0.95,0.05,0.95,0.6,1,0.7,0.1,0.65,0.45,0.75,1,0.1,0.6,1,0.7,0.3,0.5,0.45,0.3,0.4,0.4,0.95,0.85,0.65,0.6,0.2,0.45,0.55,0.65,0.5,0.35,0.5,0.45,0.6,0.25,0.2,0.4,0.4,0.95,0.35,0.75,0,0.25,0.7,0.2,0.55,0.15,0.4,0.4,0.5,0.35,0.35,0.2,0.2,0.25,0.4,0.35,0.35,0.4,0.35,0.45,0.35,0.1,0.2,0.35,0.15,0.35,0.75,0.3,0.6,0.2,0.35,0.45,0.3,0.05,0.1,0.1,0.4,0.15,0.3,0.35,0.35,0.15,0.25,0.4,0.25,0.25,0.05,0.35,0.4,0.4,0.1,0,0.55,0.45,0.2,0.15,0.05,0.1,0.35,0.25,0.25,0.2,0.2,0.2,0.2,0.15,0.2,0.2,0.15,0.2,0.15,0.15,0.15,0.15,0.15,0.2,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.1,0.1,0.15,0.15,0.15,0.15,0.15,0.1,0.15,0.1,0.1,0.15,0.1,0.1,0.15,0.1,0.1,0.05,0.1,0.1,0.1,0.1,0.1,0.1,0.05,0.1,0.1,0.05,0.1,0.05,0.1,0.1,0.05,0.05,0.1,0.05,0.1,0,0.05,0.05,0.1,0.05,0.05,0.05,0.05,0.05,0.05,0,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0,0.05,0.05,0.05,0.05,0.05,0.05,0,0,0.05,0,0,0.05,0.05,0.05,0,0,1
+};
+
+const float floorwave[]={
+    0.7,1,0.8,0,0,0,0.3,1,1,1,0,0,0,0.15,1,1,1,0,0,0,0.15,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,0,0,0.8,1,1,1,0.95,0.2,0.4,1,1,1,1,0.95,0.8,1,1,1,1,1,1,1,1,1,1,0.9,0.85,1,1,1,1,0.9,0.8,0.85,0.95,1,1,1,0.9,0.85,0.85,0.9,0.95,0.95,0.9,0.9,0.85,0.85,0.8,0.85,0.85,0.85,0.8,0.8,0.8,0.8,0.8,0.75,0.75,0.75,0.75,0.7,0.75,0.65,0.75,0.7,0.7,0.7,0.65,0.7,0.65,0.65,0.65,0.65,0.65,0.65,0.65,0.65,0.6,0.6,0.6,0.6,0.6,0.55,0.6,0.55,0.55,0.55,0.55,0.55,0.55,0.55,0.6,0.55,0.55,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.45,0.45,0.45,0.45,0.5,0.45,0.45,0.45,0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.4,0.35,0.4,0.4,0.4,0.35,0.35,0.35,0.35,0.3,0.35,0.4,0.35,0.35,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.25,0.3,0.3,0.25,0.3,0.25,0.3,0.25,0.3,0.3,0.25,0.3,0.25,0.25,0.25,0.2,0.25,0.2,0.25,0.2,0.2,0.2,0.25,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.15,0.2,0.2,0.2,0.2,0.2,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.15,0.1,0.1,0.1,0.1,0.1,0.15,0.15,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.05,0.05,0.1,0.1,0.1,0.1,0.1,0.1,0.05,0.05,0.05,0.05,0.1,0.05,0.1,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0,0.05,0.05,0.05,0.05,0.05,0,0.05,0,0.05,0,0.05,0.05};
+
+const float waterwave[]={
+        0.831 ,1.000 ,0.986 ,0.000 ,0.000 ,0.000 ,0.451 ,0.789 ,0.676 ,0.465 ,0.296 ,0.127 ,0.085 ,0.239 ,0.507 ,0.634 ,0.507 ,0.211 ,0.000 ,0.000 ,0.141 ,0.535 ,0.803 ,0.718 ,0.282 ,0.000 ,0.000 ,0.141 ,0.718 ,0.845 ,0.437 ,0.000 ,0.000 ,0.254 ,0.352 ,0.239 ,0.183 ,0.338 ,0.479 ,0.352 ,0.127 ,0.113 ,0.310 ,0.437 ,0.310 ,0.099 ,0.042 ,0.155 ,0.282 ,0.338 ,0.324 ,0.310 ,0.254 ,0.211 ,0.169 ,0.155 ,0.183 ,0.239 ,0.254 ,0.211 ,0.141 ,0.127 ,0.225 ,0.324 ,0.324 ,0.225 ,0.141 ,0.127 ,0.155 ,0.197 ,0.239 ,0.254 ,0.211 ,0.127 ,0.056 ,0.113 ,0.239 ,0.310 ,0.239 ,0.141 ,0.127 ,0.183 ,0.197 ,0.169 ,0.155 ,0.169 ,0.197 ,0.169 ,0.113 ,0.113 ,0.155 ,0.197 ,0.197 ,0.183 ,0.169 ,0.141 ,0.113 ,0.127 ,0.141 ,0.155 ,0.155 ,0.141 ,0.141 ,0.155 ,0.155 ,0.141 ,0.113 ,0.113 ,0.127 ,0.141 ,0.169 ,0.169 ,0.141 ,0.113 ,0.099 ,0.099 ,0.099 ,0.113 ,0.127 ,0.141 ,0.155 ,0.141 ,0.113 ,0.099 ,0.085 ,0.099 ,0.127 ,0.127 ,0.099 ,0.085 ,0.099 ,0.141 ,0.141 ,0.127 ,0.085 ,0.070 ,0.085 ,0.099 ,0.113 ,0.099 ,0.099 ,0.099 ,0.099 ,0.099 ,0.085 ,0.085 ,0.099 ,0.099 ,0.099 ,0.099 ,0.085 ,0.070 ,0.070 ,0.085 ,0.099 ,0.099 ,0.085 ,0.085 ,0.085 ,0.070 ,0.070 ,0.085 ,0.070 ,0.070 ,0.070 ,0.070 ,0.085 ,0.085 ,0.085 ,0.070 ,0.056 ,0.056 ,0.056 ,0.070 ,0.070 ,0.056 ,0.056 ,0.056 ,0.070 ,0.070 ,0.085 ,0.070 ,0.056 ,0.042 ,0.056 ,0.070 ,0.070 ,0.070 ,0.056 ,0.056 ,0.042 ,0.056 ,0.042 ,0.056 ,0.056 ,0.056 ,0.056 ,0.056 ,0.056 ,0.056 ,0.042 ,0.042 ,0.042 ,0.056 ,0.056 ,0.056 ,0.056 ,0.042 ,0.042 ,0.042 ,0.042 ,0.042 ,0.042 ,0.042 ,0.042 ,0.042 ,0.042 ,0.042 ,0.042 ,0.042 ,0.042 ,0.042 ,0.042 ,0.042 ,0.042 ,0.028 ,0.028 ,0.042 ,0.042 ,0.056 ,0.042 ,0.028 ,0.014 ,0.028 ,0.042 ,0.028 ,0.042 ,0.056 ,0.042 ,0.028 ,0.014 ,0.014 ,0.028 ,0.042 ,0.042 ,0.028 ,0.028 ,0.014 ,0.014 ,0.028 ,0.028 ,0.028 ,0.014 ,0.028 ,0.028 ,0.028 ,0.014 ,0.028 ,0.014 ,0.028 ,0.028 ,0.014 ,0.014 ,0.014 ,0.014 ,0.028 ,0.014 ,0.014 ,0.014 ,0.014 ,0.028 ,0.014 ,0.014 ,0.014 ,0.028 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.000 ,0.014 ,0.014 ,0.000 ,0.014 ,0.000 ,0.014 ,0.014 ,0.014 ,0.000 ,0.000 ,0.000 ,0.000 ,0.014 ,0.014 ,0.000 ,0.000 ,0.014 ,0.000 ,0.000 ,0.000 ,0.000 ,0.000 ,0.014};
+
+const float nukarumiwave[]={
+        0.257 ,0.365 ,0.041 ,0.000 ,0.000 ,0.189 ,0.054 ,0.000 ,0.000 ,0.095 ,0.419 ,0.297 ,0.000 ,0.000 ,0.000 ,0.662 ,0.946 ,0.946 ,0.000 ,0.000 ,0.108 ,0.932 ,1.000 ,0.527 ,0.162 ,0.000 ,0.000 ,0.000 ,0.041 ,0.608 ,0.973 ,0.878 ,0.473 ,0.095 ,0.000 ,0.041 ,0.243 ,0.338 ,0.270 ,0.284 ,0.527 ,0.662 ,0.392 ,0.000 ,0.000 ,0.014 ,0.419 ,0.541 ,0.432 ,0.297 ,0.216 ,0.203 ,0.324 ,0.500 ,0.459 ,0.122 ,0.000 ,0.000 ,0.216 ,0.514 ,0.514 ,0.324 ,0.162 ,0.122 ,0.216 ,0.338 ,0.338 ,0.203 ,0.068 ,0.095 ,0.203 ,0.284 ,0.270 ,0.216 ,0.203 ,0.216 ,0.216 ,0.189 ,0.162 ,0.176 ,0.189 ,0.216 ,0.203 ,0.203 ,0.189 ,0.189 ,0.176 ,0.189 ,0.176 ,0.176 ,0.176 ,0.176 ,0.176 ,0.176 ,0.176 ,0.162 ,0.162 ,0.162 ,0.162 ,0.162 ,0.162 ,0.162 ,0.162 ,0.162 ,0.149 ,0.149 ,0.149 ,0.149 ,0.149 ,0.149 ,0.149 ,0.149 ,0.149 ,0.135 ,0.149 ,0.149 ,0.135 ,0.135 ,0.135 ,0.135 ,0.135 ,0.135 ,0.135 ,0.135 ,0.135 ,0.122 ,0.122 ,0.122 ,0.122 ,0.122 ,0.122 ,0.122 ,0.122 ,0.108 ,0.122 ,0.122 ,0.108 ,0.108 ,0.108 ,0.108 ,0.095 ,0.108 ,0.108 ,0.108 ,0.108 ,0.108 ,0.095 ,0.095 ,0.095 ,0.095 ,0.095 ,0.108 ,0.095 ,0.095 ,0.095 ,0.095 ,0.081 ,0.095 ,0.095 ,0.095 ,0.095 ,0.081 ,0.081 ,0.081 ,0.081 ,0.081 ,0.081 ,0.081 ,0.081 ,0.081 ,0.081 ,0.081 ,0.081 ,0.081 ,0.081 ,0.081 ,0.068 ,0.081 ,0.068 ,0.068 ,0.068 ,0.068 ,0.068 ,0.068 ,0.068 ,0.068 ,0.068 ,0.068 ,0.068 ,0.068 ,0.068 ,0.068 ,0.068 ,0.068 ,0.068 ,0.054 ,0.054 ,0.068 ,0.054 ,0.054 ,0.054 ,0.054 ,0.054 ,0.054 ,0.054 ,0.054 ,0.054 ,0.054 ,0.054 ,0.041 ,0.054 ,0.041 ,0.054 ,0.054 ,0.054 ,0.054 ,0.054 ,0.054 ,0.041 ,0.041 ,0.054 ,0.041 ,0.054 ,0.054 ,0.041 ,0.041 ,0.041 ,0.041 ,0.041 ,0.041 ,0.041 ,0.041 ,0.041 ,0.027 ,0.041 ,0.041 ,0.027 ,0.041 ,0.041 ,0.041 ,0.041 ,0.041 ,0.041 ,0.041 ,0.041 ,0.027 ,0.027 ,0.041 ,0.027 ,0.027 ,0.027 ,0.027 ,0.027 ,0.027 ,0.027 ,0.027 ,0.027 ,0.027 ,0.027 ,0.027 ,0.027 ,0.027 ,0.027 ,0.027 ,0.027 ,0.027 ,0.014 ,0.027 ,0.027 ,0.027 ,0.027 ,0.027 ,0.027 ,0.027 ,0.027 ,0.027 ,0.014 ,0.027 ,0.027 ,0.027 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.027 ,0.027 ,0.014 ,0.014 ,0.014 ,0.014 ,0.000 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.027 ,0.014 ,0.000 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.000 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.014 ,0.000 ,0.014 ,0.014};
+
+const float grasswave[]={
+        0.02,0.08,0.03,0.00,0.00,0.01,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.02,0.12,0.14,0.00,0.00,0.00,0.00,0.14,0.18,0.13,0.13,0.11,0.00,0.00,0.00,0.11,0.22,0.05,0.00,0.00,0.00,0.33,0.45,0.27,0.00,0.00,0.00,0.06,0.12,0.06,0.00,0.04,0.21,0.30,0.19,0.00,0.00,0.00,0.06,0.14,0.10,0.07,0.13,0.21,0.15,0.00,0.00,0.00,0.13,0.28,0.21,0.05,0.00,0.01,0.05,0.02,0.00,0.01,0.14,0.23,0.18,0.02,0.00,0.00,0.00,0.13,0.28,0.28,0.15,0.00,0.00,0.00,0.03,0.12,0.13,0.07,0.00,0.00,0.00,0.07,0.17,0.19,0.11,0.00,0.00,0.00,0.04,0.03,0.00,0.00,0.09,0.23,0.23,0.05,0.00,0.00,0.00,0.03,0.14,0.22,0.22,0.11,0.00,0.00,0.00,0.00,0.10,0.21,0.21,0.14,0.02,0.00,0.00,0.00,0.09,0.13,0.05,0.00,0.00,0.02,0.20,0.27,0.14,0.00,0.00,0.00,0.13,0.23,0.11,0.00,0.00,0.06,0.19,0.19,0.09,0.00,0.00,0.00,0.00,0.08,0.13,0.14,0.12,0.05,0.00,0.00,0.00,0.10,0.19,0.15,0.01,0.00,0.00,0.00,0.12,0.18,0.12,0.00,0.00,0.00,0.10,0.15,0.08,0.00,0.00,0.03,0.03,0.00,0.01,0.02,0.00,0.00,0.00,0.05,0.11,0.13,0.13,0.06,0.00,0.00,0.00,0.11,0.11,0.00,0.00,0.00,0.11,0.19,0.08,0.00,0.00,0.00,0.11,0.18,0.12,0.01,0.00,0.00,0.00,0.00,0.02,0.09,0.14,0.09,0.00,0.00,0.00,0.03,0.11,0.10,0.04,0.00,0.00,0.00,0.00,0.04,0.06,0.01,0.00,0.00,0.05,0.14,0.11,0.00,0.00,0.00,0.00,0.12,0.12,0.04,0.00,0.05,0.07,0.00,0.00,0.00,0.00,0.12,0.12,0.03,0.00,0.03,0.11,0.10,0.00,0.00,0.00,0.00,0.07,0.06,0.00,0.00,0.00,0.04,0.10,0.09,0.03,0.00,0.00,0.00,0.00,0.02,0.08,0.08,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.09,0.19,0.20,0.09,0.00,0.00,0.00,0.00,0.00,0.15,0.30,0.27,0.00,0.00,0.00,0.22,0.61,0.60,0.07,0.00,0.00,0.13,0.74,0.73,0.13,0.00,0.02,0.65,0.60,0.00,0.00,0.01,0.65,0.75,0.65,0.16,0.00,0.00,0.24,0.36,0.15,0.00,0.16,0.53,0.60,0.32,0.07,0.10,0.24,0.25,0.13,0.08,0.19,0.38,0.41,0.22,0.01,0.00,0.18,0.34,0.36,0.28,0.15,0.05,0.06,0.18,0.24,0.20,0.19,0.26,0.30,0.18,0.03,0.02,0.17,0.32,0.33,0.19,0.01,0.00,0.01,0.22,0.41,0.42,0.25,0.03,0.00,0.04,0.18,0.21,0.14,0.10,0.15,0.22,0.26,0.19,0.07,0.01,0.06,0.14,0.17,0.15,0.14,0.15,0.14,0.07,0.04,0.08,0.16,0.22,0.22,0.17,0.06,0.00,0.03,0.16,0.21,0.13,0.01,0.01,0.10,0.19,0.19,0.13,0.07,0.05,0.08,0.16,0.23,0.21,0.10,0.00,0.00,0.00,0.06,0.23,0.32,0.25,0.07,0.00,0.00,0.09,0.24,0.29,0.21,0.00,0.00,0.00,0.00,0.31,0.47,0.39,0.15,0.00,0.00,0.04,0.22,0.27,0.17,0.01,0.00,0.00,0.06,0.10,0.14,0.21,0.25,0.20,0.08,0.00,0.01,0.06,0.06,0.04,0.06,0.15,0.22,0.18,0.06,0.00,0.02,0.15,0.20,0.13,0.00,0.00,0.00,0.14,0.26,0.22,0.04,0.00,0.00,0.11,0.32,0.32,0.14,0.00,0.00,0.00,0.03,0.01,0.01,0.12,0.25,0.24,0.05,0.00,0.00,0.03,0.21,0.26,0.17,0.05,0.00,0.00,0.00,0.00,0.01,0.08,0.15,0.13,0.06,0.04,0.10,0.15,0.10,0.00,0.00,0.00,0.00,0.11,0.22,0.21,0.08,0.00,0.00,0.07,0.10,0.06,0.03,0.02,0.00,0.00,0.00,0.00,0.04,0.13,0.20,0.19,0.08,0.00,0.00,0.00,0.04,0.02,0.00,0.02,0.10,0.15,0.12,0.04,0.00,0.00,0.00,0.00,0.00,0.00,0.17,0.36,0.33,0.06,0.00,0.00,0.00,0.21,0.39,0.34,0.14,0.00,0.00,0.09,0.19,0.15,0.03,0.03,0.13,0.18,0.10,0.01,0.02,0.12,0.20,0.22,0.18,0.06,0.00,0.00,0.03,0.26,0.36,0.24,0.02,0.00,0.00,0.06,0.17,0.18,0.10,0.01,0.01,0.05,0.05,0.00,0.03,0.21,0.37,0.28,0.00,0.00,0.00,0.19,0.32,0.17,0.00,0.00,0.00,0.21,0.33,0.22,0.00,0.00,0.00,0.17,0.32,0.29,0.12,0.00,0.00,0.00,0.19,0.65,0.65,0.34,0.00,0.00,0.00,0.29,0.43,0.43,0.33,0.17,0.02,0.00,0.06,1.00,0.34,0.44,0.36,0.14,0.00,0.00,0.13,0.19,0.20,0.20,0.20,0.16,0.15,0.24,0.33,0.25,0.03,0.00,0.00,0.20,0.34,0.29,0.13,0.03,0.05,0.14,0.23,0.29,0.24,0.10,0.00,0.00,0.07,0.22,0.28,0.24,0.17,0.09,0.01,0.00,0.08,0.19,0.21,0.14,0.08,0.11,0.17,0.17,0.12,0.06,0.04,0.06,0.11,0.16,0.15,0.09,0.03,0.05,0.13,0.19,0.18,0.12,0.07,0.08,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.09,0.08,0.08,0.09,0.08,0.08,0.08,0.08,0.07,0.08,0.08,0.08,0.08,0.08,0.08,0.07,0.07,0.07,0.07,0.07,0.07,0.07,0.07,0.07,0.07,0.07,0.07,0.06,0.07,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.06,0.05,0.06,0.05,0.05,0.06,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.05,0.04,0.04,0.05,0.05,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.04,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.04,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.04,0.03,0.03,0.03,0.03,0.02,0.02,0.03,0.03,0.03,0.02,0.03,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.03,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.01,0.02,0.02,0.02,0.02,0.01,0.01,0.02,0.02,0.02,0.01,0.01,0.01,0.01,0.01,0.02,0.01,0.01,0.01,0.01,0.01,0.01,0.02,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.00,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.00,0.01,0.01,0.00,0.01,0.01,0.01,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.01,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.01};
+
+const float netawave[]={
+    0.487 ,0.447 ,0.118 ,0.184 ,0.474 ,0.329 ,0.000 ,0.000 ,0.145 ,0.921 ,0.921 ,0.553 ,0.000 ,0.000 ,0.132 ,0.987 ,0.974 ,0.000 ,0.000 ,0.237 ,1.000 ,0.763 ,0.000 ,0.000 ,0.658 ,0.737 ,0.224 ,0.026 ,0.342 ,0.513 ,0.342 ,0.250 ,0.329 ,0.355 ,0.250 ,0.237 ,0.329 ,0.382 ,0.316 ,0.263 ,0.276 ,0.316 ,0.303 ,0.263 ,0.263 ,0.303 ,0.329 ,0.276 ,0.237 ,0.237 ,0.276 ,0.303 ,0.276 ,0.237 ,0.237 ,0.276 ,0.263 ,0.224 ,0.224 ,0.250 ,0.263 ,0.237 ,0.224 ,0.237 ,0.237 ,0.211 ,0.211 ,0.250 ,0.250 ,0.197 ,0.184 ,0.237 ,0.263 ,0.211 ,0.158 ,0.184 ,0.263 ,0.276 ,0.197 ,0.118 ,0.105 ,0.211 ,0.316 ,0.303 ,0.171 ,0.066 ,0.079 ,0.197 ,0.263 ,0.276 ,0.237 ,0.171 ,0.092 ,0.053 ,0.132 ,0.276 ,0.316 ,0.211 ,0.092 ,0.066 ,0.184 ,0.171 ,0.197 ,0.211 ,0.184 ,0.145 ,0.118 ,0.145 ,0.184 ,0.171 ,0.132 ,0.105 ,0.145 ,0.145 ,0.145 ,0.145 ,0.145 ,0.145 ,0.132 ,0.145 ,0.132 ,0.132 ,0.132 ,0.132 ,0.132 ,0.132 ,0.132 ,0.132 ,0.132 ,0.132 ,0.132 ,0.132 ,0.118 ,0.118 ,0.118 ,0.118 ,0.118 ,0.118 ,0.105 ,0.118 ,0.118 ,0.118 ,0.105 ,0.105 ,0.105 ,0.105 ,0.105 ,0.105 ,0.105 ,0.105 ,0.105 ,0.105 ,0.105 ,0.105 ,0.092 ,0.092 ,0.092 ,0.092 ,0.092 ,0.092 ,0.092 ,0.092 ,0.092 ,0.092 ,0.092 ,0.092 ,0.092 ,0.092 ,0.079 ,0.079 ,0.079 ,0.079 ,0.092 ,0.079 ,0.079 ,0.079 ,0.079 ,0.079 ,0.079 ,0.079 ,0.079 ,0.079 ,0.079 ,0.079 ,0.066 ,0.066 ,0.066 ,0.066 ,0.066 ,0.066 ,0.066 ,0.066 ,0.066 ,0.066 ,0.066 ,0.066 ,0.053 ,0.066 ,0.053 ,0.053 ,0.066 ,0.066 ,0.053 ,0.066 ,0.066 ,0.053 ,0.053 ,0.053 ,0.039 ,0.066 ,0.053 ,0.053 ,0.053 ,0.079 ,0.053 ,0.053 ,0.053 ,0.053 ,0.039 ,0.053 ,0.039 ,0.053 ,0.053 ,0.053 ,0.039 ,0.039 ,0.053 ,0.039 ,0.039 ,0.039 ,0.039 ,0.039 ,0.039 ,0.039 ,0.039 ,0.039 ,0.039 ,0.039 ,0.026 ,0.039 ,0.039 ,0.039 ,0.026 ,0.039 ,0.039 ,0.039 ,0.039 ,0.026 ,0.039 ,0.039 ,0.039 ,0.026 ,0.026 ,0.026 ,0.026 ,0.026 ,0.026 ,0.026 ,0.026 ,0.026 ,0.026 ,0.039 ,0.026 ,0.026 ,0.026 ,0.026 ,0.026 ,0.026 ,0.026 ,0.026 ,0.026 ,0.026 ,0.026 ,0.026 ,0.026 ,0.026 ,0.026 ,0.026 ,0.013 ,0.026 ,0.026 ,0.026 ,0.013 ,0.026 ,0.013 ,0.013 ,0.013 ,0.013 ,0.013 ,0.026 ,0.026 ,0.013 ,0.013 ,0.026 ,0.013 ,0.013 ,0.013 ,0.013 ,0.013 ,0.013 ,0.013 ,0.013 ,0.013 ,0.013 ,0.013 ,0.013 ,0.013 ,0.013 ,0.013 ,0.013 ,0.013 ,0.013 ,0.013 ,0.013 ,0.013 ,0.013 ,0.013 ,0.013 ,0.000 ,0.013 ,0.013 ,0.013 ,0.013 ,0.013 ,0.013 ,0.013 ,0.013 ,0.013 ,0.000 ,0.000 ,0.013 ,0.000 ,0.000 ,0.013 ,0.013 ,0.000 ,0.000 ,0.013 ,0.000 ,0.000 ,0.013 ,0.000 ,0.013 ,0.013};