File tree Expand file tree Collapse file tree 3 files changed +251
-220
lines changed
examples/Utilities/AddressChanger Expand file tree Collapse file tree 3 files changed +251
-220
lines changed Original file line number Diff line number Diff line change @@ -237,6 +237,8 @@ String pinstrapToName(uint8_t pinstrap) {
237237 return " Encoder" ;
238238 case 0x6C :
239239 return " Smartleds" ;
240+ case 0x70 :
241+ return " Vibro" ;
240242 }
241243 return " UNKNOWN" ;
242244}
Original file line number Diff line number Diff line change @@ -245,6 +245,35 @@ class ModulinoBuzzer : public Module {
245245 uint8_t match[1 ] = { 0x3C }; // same as fw main.c
246246};
247247
248+ class ModulinoVibro : public Module {
249+ public:
250+ ModulinoVibro (uint8_t address = 0xFF )
251+ : Module(address, " VIBRO" ) {}
252+ void on (size_t len_ms) {
253+ uint8_t buf[8 ];
254+ uint32_t freq = 100 ;
255+ memcpy (&buf[0 ], &freq, 4 );
256+ memcpy (&buf[4 ], &len_ms, 4 );
257+ write (buf, 8 );
258+ }
259+ void off () {
260+ uint8_t buf[8 ];
261+ memset (&buf[0 ], 0 , 8 );
262+ write (buf, 8 );
263+ }
264+ virtual uint8_t discover () {
265+ for (unsigned int i = 0 ; i < sizeof (match)/sizeof (match[0 ]); i++) {
266+ if (scan (match[i])) {
267+ return match[i];
268+ }
269+ }
270+ return 0xFF ;
271+ }
272+ protected:
273+ uint8_t match[1 ] = { 0x70 }; // same as fw main.c
274+ };
275+
276+
248277class ModulinoColor {
249278public:
250279 ModulinoColor (uint8_t r, uint8_t g, uint8_t b)
You can’t perform that action at this time.
0 commit comments