<spanclass="line"><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">HAPTIC_DRIVER = solenoid</span></span></code></pre></div><p>The following <code>config.h</code> settings are available for all types of haptic feedback:</p><table><thead><tr><th>Settings</th><th>Default</th><th>Description</th></tr></thead><tbody><tr><td><code>HAPTIC_ENABLE_PIN</code></td><td><em>Not defined</em></td><td>Configures a pin to enable a boost converter for some haptic solution, often used with solenoid drivers.</td></tr><tr><td><code>HAPTIC_ENABLE_PIN_ACTIVE_LOW</code></td><td><em>Not defined</em></td><td>If defined then the haptic enable pin is active-low.</td></tr><tr><td><code>HAPTIC_ENABLE_STATUS_LED</code></td><td><em>Not defined</em></td><td>Configures a pin to reflect the current enabled/disabled status of haptic feedback.</td></tr><tr><td><code>HAPTIC_ENABLE_STATUS_LED_ACTIVE_LOW</code></td><td><em>Not defined</em></td><td>If defined then the haptic status led will be active-low.</td></tr><tr><td><code>HAPTIC_OFF_IN_LOW_POWER</code></td><td><code>0</code></td><td>If set to <code>1</code>, haptic feedback is disabled before the device is configured, and while the device is suspended.</td></tr></tbody></table><h2id="known-supported-hardware"tabindex="-1">Known Supported Hardware <aclass="header-anchor"href="#known-supported-hardware"aria-label="Permalink to "Known Supported Hardware""></a></h2><table><thead><tr><th>Name</th><th>Description</th></tr></thead><tbody><tr><td><ahref="https://www.digikey.com/product-detail/en/jinlong-machinery-electronics-inc/LV061228B-L65-A/1670-1050-ND/7732325"target="_blank"rel="noreferrer">LV061228B-L65-A</a></td><td>z-axis 2v LRA</td></tr><tr><td><ahref="https://www.adafruit.com/product/1201"target="_blank"rel="noreferrer">Mini Motor Disc</a></td><td>small 2-5v ERM</td></tr></tbody></table><h2id="haptic-keycodes"tabindex="-1">Haptic Keycodes <aclass="header-anchor"href="#haptic-keycodes"aria-label="Permalink to "Haptic Keycodes""></a></h2><p>Not all keycodes below will work depending on which haptic mechanism you have chosen.</p><table><thead><tr><th>Key</th><th>Aliases</th><th>Description</th></tr></thead><tbody><tr><td><code>QK_HAPTIC_ON</code></td><td><code>HF_ON</code></td><td>Turn haptic feedback on</td></tr><tr><td><code>QK_HAPTIC_OFF</code></td><td><code>HF_OFF</code></td><td>Turn haptic feedback off</td></tr><tr><td><code>QK_HAPTIC_TOGGLE</code></td><td><code>HF_TOGG</code></td><td>Toggle haptic feedback on/off</td></tr><tr><td><code>QK_HAPTIC_RESET</code></td><td><code>HF_RST</code></td><td>Reset haptic feedback config to default</td></tr><tr><td><code>QK_HAPTIC_FEEDBACK_TOGGLE</code></td><td><code>HF_FDBK</code></td><td>Toggle feedback to occur on keypress, release or both</td></tr><tr><td><code>QK_HAPTIC_BUZZ_TOGGLE</code></td><td><code>HF_BUZZ</code></td><td>Toggle solenoid buzz on/off</td></tr><tr><td><code>QK_HAPTIC_MODE_NEXT</code></td><td><code>HF_NEXT</code></td><td>Go to next DRV2605L waveform</td></tr><tr><td><code>QK_HAPTIC_MODE_PREVIOUS</code></td><td><code>HF_PREV</code></td><td>Go to previous DRV2605L waveform</td></tr><tr><td><code>QK_HAPTIC_CONTINUOUS_TOGGLE</code></td><td><code>HF_CONT</code></td><td>Toggle continuous haptic mode on/off</td></tr><tr><td><code>QK_HAPTIC_CONTINUOUS_UP</code></td><td><code>HF_CONU</code></td><td>Increase DRV2605L continous haptic strength</td></tr><tr><td><code>QK_HAPTIC_CONTINUOUS_DOWN</code></td><td><code>HF_COND</code></td><td>Decrease DRV2605L continous haptic strength</td></tr><tr><td><code>QK_HAPTIC_DWELL_UP</code></td><td><code>HF_DWLU</code></td><td>Increase Solenoid dwell time</td></tr><tr><td><code>QK_HAPTIC_DWELL_DOWN</code></td><td><code>HF_DWLD</code></td><td>Decrease Solenoid dwell time</td></tr></tbody></table><h3id="solenoids"tabindex="-1">Solenoids <aclass="header-anchor"href="#solenoids"aria-label="Permalink to "Solenoids""></a></h3><p>The solenoid code supports relay switches, and similar hardware, as well as solenoids.</p><p>For a regular solenoid, you will n
<spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">#define</span><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> DRV2605L_FB_LOOPGAIN</span><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 1</span><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /* For Low:0, Medium:1, High:2, Very High:3 */</span></span>
<spanclass="line"></span>
<spanclass="line"><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;">/* Please refer to your datasheet for the optimal setting for your specific motor. */</span></span>
<spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">#define</span><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> DRV2605L_V_PEAK</span><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 5</span></span></code></pre></div><h5id="lra"tabindex="-1">LRA <aclass="header-anchor"href="#lra"aria-label="Permalink to "LRA""></a></h5><p>Linear resonant actuators (LRA, also know as a linear vibrator) works different from a ERM. A LRA has a weight and magnet suspended by springs and a voice coil. When the drive signal is applied, the weight would be vibrate on a single axis (side to side or up and down). Since the weight is attached to a spring, there is a resonance effect at a specific frequency. This frequency is where the LRA will operate the most efficiently. Refer to the motor's datasheet for the recommanded range for this frequency.</p><divclass="language-c vp-adaptive-theme"><buttontitle="Copy Code"class="copy"></button><spanclass="lang">c</span><preclass="shiki shiki-themes github-light github-dark vp-code"><code><spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">#define</span><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> DRV2605L_FB_ERM_LRA</span><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 1</span></span>
<spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">#define</span><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> DRV2605L_FB_LOOPGAIN</span><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 1</span><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /* For Low:0, Medium:1, High:2, Very High:3 */</span></span>
<spanclass="line"></span>
<spanclass="line"><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;">/* Please refer to your datasheet for the optimal setting for your specific motor. */</span></span>
<spanclass="line"><spanstyle="--shiki-light:#D73A49;--shiki-dark:#F97583;">#define</span><spanstyle="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> DRV2605L_F_LRA</span><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 205</span><spanstyle="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /* resonance freq */</span></span></code></pre></div><h4id="drv2605l-waveform-library"tabindex="-1">DRV2605L waveform library <aclass="header-anchor"href="#drv2605l-waveform-library"aria-label="Permalink to "DRV2605L waveform library""></a></h4><p>DRV2605L comes with preloaded library of various waveform sequences that can be called and played. If writing a macro, these waveforms can be played using <code>DRV_pulse(*sequence name or number*)</code></p><p>List of waveform sequences from the datasheet:</p><table><thead><tr><th>seq#</th><th>Sequence name</th><th>seq#</th><th>Sequence name</th><th>seq#</th><th>Sequence name</th></tr></thead><tbody><tr><td>1</td><td>strong_click</td><td>43</td><td>lg_dblclick_med_60</td><td>85</td><td>transition_rampup_med_smooth2</td></tr><tr><td>2</td><td>strong_click_60</td><td>44</td><td>lg_dblsharp_tick</td><td>86</td><td>transition_rampup_short_smooth1</td></tr><tr><td>3</td><td>strong_click_30</td><td>45</td><td>lg_dblsharp_tick_80</td><td>87</td><td>transition_rampup_short_smooth2</td></tr><tr><td>4</td><td>sharp_click</td><td>46</td><td>lg_dblsharp_tick_60</td><td>88</td><td>transition_rampup_long_sharp1</td></tr><tr><td>5</td><td>sharp_click_60</td><td>47</td><td>buzz</td><td>89</td><td>transition_rampup_long_sharp2</td></tr><tr><td>6</td><td>sharp_click_30</td><td>48</td><td>buzz_80</td><td>90</td><td>transition_rampup_med_sharp1</td></tr><tr><td>7</td><td>soft_bump</td><td>49</td><td>buzz_60</td><td>91</td><td>transition_rampup_med_sharp2</td></tr><tr><td>8</td><td>soft_bump_60</td><td>50</td><td>buzz_40</td><td>92</td><td>transition_rampup_short_sharp1</td></tr><tr><td>9</td><td>soft_bump_30</td><td>51</td><td>buzz_20</td><td>93</td><td>transition_rampup_short_sharp2</td></tr><tr><td>10</td><td>dbl_click</td><td>52</td><td>pulsing_strong</td><td>94</td><td>transition_rampdown_long_smooth1_50</td></tr><tr><td>11</td><td>dbl_click_60</td><td>53</td><td>pulsing_strong_80</td><td>95</td><td>transition_rampdown_long_smooth2_50</td></tr><tr><td>12</td><td>trp_click</td><td>54</td><td>pulsing_medium</td><td>96</td><td>transition_rampdown_med_smooth1_50</td></tr><tr><td>13</td><td>soft_fuzz</td><td>55</td><td>pulsing_medium_80</td><td>97</td><td>transition_rampdown_med_smooth2_50</td></tr><tr><td>14</td><td>strong_buzz</td><td>56</td><td>pulsing_sharp</td><td>98</td><td>transition_rampdown_short_smooth1_50</td></tr><tr><td>15</td><td>alert_750ms</td><td>57</td><td>pulsing_sharp_80</td><td>99</td><td>transition_rampdown_short_smooth2_50</td></tr><tr><td>16</td><td>alert_1000ms</td><td>58</td><td>transition_click</td><td>100</td><td>transition_rampdown_long_sharp1_50</td></tr><tr><td>17</td><td>strong_click1</td><td>59</td><td>transition_click_80</td><td>101</td><td>transition_rampdown_long_sharp2_50</td></tr><tr><td>18</td><td>strong_click2_80</td><td>60</td><td>transition_click_60</td><td>102</td><td>transition_rampdown_med_sharp1_50</td></tr><tr><td>19</td><td>strong_click3_60</td><td>61</td><td>transition_click_40</td><td>103</td><td>transition_rampdown_med_sharp2_50</td></tr><tr><td>20</td><td>strong_click4_30</td><td>62</td><td>transition_click_20</td><td>104</td><td>transition_rampdown_short_sharp1_50</td></tr><tr><td>21</td><td>medium_click1</td><td>63</td><td>transition_click_10</td><td>105</td><td>transition_rampdown_short_sharp2_50</td></tr><tr><td>22</td><td>medium_click2_80</td><td>64</td><td>transition_hum</td><td>106</td><td>transition_rampup_long_smooth1_50</td></tr><tr><td>23</td><td>medium_click3_60</td><td>65</td><td>transition_hum_80</td><td>107</td><td>transition_rampup_long_smooth2_50</td></tr><tr><td>24</td><td>sharp_tick1</td><td>66</td><td>transition_hum_60</td><td>108</td><td>transition_rampup_med_smooth1_50</td></tr><tr><td>25</td><td>sharp_tick2_80</