File tree 3 files changed +1249
-1218
lines changed
examples/Utilities/AddressChanger
3 files changed +1249
-1218
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,8 @@ String pinstrapToName(uint8_t pinstrap) {
39
39
return " ENCODER" ;
40
40
case 0x6C :
41
41
return " SMARTLEDS" ;
42
+ case 0x70 :
43
+ return " VIBRO" ;
42
44
}
43
45
return " UNKNOWN" ;
44
46
}
Original file line number Diff line number Diff line change @@ -222,6 +222,35 @@ class ModulinoBuzzer : public Module {
222
222
uint8_t match[1 ] = { 0x3C }; // same as fw main.c
223
223
};
224
224
225
+ class ModulinoVibro : public Module {
226
+ public:
227
+ ModulinoVibro (uint8_t address = 0xFF )
228
+ : Module(address, " VIBRO" ) {}
229
+ void on (size_t len_ms) {
230
+ uint8_t buf[8 ];
231
+ uint32_t freq = 100 ;
232
+ memcpy (&buf[0 ], &freq, 4 );
233
+ memcpy (&buf[4 ], &len_ms, 4 );
234
+ write (buf, 8 );
235
+ }
236
+ void off () {
237
+ uint8_t buf[8 ];
238
+ memset (&buf[0 ], 0 , 8 );
239
+ write (buf, 8 );
240
+ }
241
+ virtual uint8_t discover () {
242
+ for (int i = 0 ; i < match.size (); i++) {
243
+ if (scan (match[i])) {
244
+ return match[i];
245
+ }
246
+ }
247
+ return 0xFF ;
248
+ }
249
+ protected:
250
+ std::vector<uint8_t > match = { 0x70 }; // same as fw main.c
251
+ };
252
+
253
+
225
254
class ModulinoColor {
226
255
public:
227
256
ModulinoColor (uint8_t r, uint8_t g, uint8_t b)
You can’t perform that action at this time.
0 commit comments