hideakitai / drv2667 Goto Github PK
View Code? Open in Web Editor NEWArduino library for DRV2667 Piezo Haptic Driver with Boost, Digital Front End, and Internal Waveform Memory
License: MIT License
Arduino library for DRV2667 Piezo Haptic Driver with Boost, Digital Front End, and Internal Waveform Memory
License: MIT License
Hi,
Thank you for sharing your code, but i can't get it to work on arduino uno.
The examples do not compile without modification.
I can compile the example_uno by replacing the SynthChunk struct by Synthesizer, removing the begin and replacing setSynthsizer by addSynthesizer, but i am not sure it is correct and it does not appear to work.
Could you provide a functionnal example?
I am using this library with an I2C mux. In the simple code below, the motor buzzes every 3 seconds until I power cycle, at which point it stops working unless the code is reflashed. By the way, I am using a SAMD51J19a chip (like the one on the Adafruit Feather) and an Adafruit Feather M4 bootloader on custom board.
#include <Wire.h>
#include "DRV2667.h"
#include <SparkFun_I2C_Mux_Arduino_Library.h>
QWIICMUX myMux;
DRV2667 drv;
void setup()
{
struct EmbeddedDevices::DRV2667::Synthesizer synth {
{255, 0x17, 10, 0x12},
};
Wire.begin();
myMux.begin();
if (myMux.begin() == false)
{
while (1);
}
myMux.setPort(3); //Connect master to port labeled '1' on the mux
drv.attatch(Wire);
drv.addSynthesizer(synth);
drv.setWaveformOrderAndID(0,1);
drv.gain(DRV2667::Gain::D50V_A348dB);
}
void loop()
{
drv.play();
delay(3000); //Wait for the wavkVkke to play;
}
Hi,
I get the following error while importing the DRV2667 library from arduino.
In file included from C:\Users\abhis\OneDrive\Documents\Arduino\sketch_nov30a\sketch_nov30a.ino:1:0:
C:\Users\abhis\OneDrive\Documents\Arduino\libraries\DRV2667/DRV2667.h:123:39: error: 'SynthChunk' does not name a type
void addSynthesizer(const SynthChunk* synthparams, const uint8_t size_of_synth)
^~~~~~~~~~
C:\Users\abhis\OneDrive\Documents\Arduino\libraries\DRV2667/DRV2667.h: In member function 'void EmbeddedDevices::DRV2667::DRV2667::addSynthesizer(const int*, uint8_t)':
C:\Users\abhis\OneDrive\Documents\Arduino\libraries\DRV2667/DRV2667.h:162:58: error: request for member 'amp' in '(synthparams + ((sizetype)(((unsigned int)i) * 2)))', which is of non-class type 'const int'
write(start_addr + 0, synthparams[i].amp);
^~~
C:\Users\abhis\OneDrive\Documents\Arduino\libraries\DRV2667/DRV2667.h:163:58: error: request for member 'freq' in '(synthparams + ((sizetype)(((unsigned int)i) * 2)))', which is of non-class type 'const int'
write(start_addr + 1, synthparams[i].freq);
^~~~
C:\Users\abhis\OneDrive\Documents\Arduino\libraries\DRV2667/DRV2667.h:164:58: error: request for member 'cycle' in '(synthparams + ((sizetype)(((unsigned int)i) * 2)))', which is of non-class type 'const int'
write(start_addr + 2, synthparams[i].cycle);
^~~~~
C:\Users\abhis\OneDrive\Documents\Arduino\libraries\DRV2667/DRV2667.h:165:58: error: request for member 'envelop' in '(synthparams + ((sizetype)(((unsigned int)i) * 2)))', which is of non-class type 'const int'
write(start_addr + 3, synthparams[i].envelop);
^~~~~~~
C:\Users\abhis\OneDrive\Documents\Arduino\libraries\DRV2667/DRV2667.h: At global scope:
C:\Users\abhis\OneDrive\Documents\Arduino\libraries\DRV2667/DRV2667.h:299:50: error: 'SynthChunk' in namespace 'EmbeddedDevices::DRV2667' does not name a type
using DRV2667Effects = EmbeddedDevices::DRV2667::SynthChunk;
^~~~~~~~~~
exit status 1
Error compiling for board Arduino Mega or Mega 2560.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.