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 @@ -219,6 +219,35 @@ class ModulinoBuzzer : public Module {
219
219
std::vector<uint8_t > match = { 0x3C }; // same as fw main.c
220
220
};
221
221
222
+ class ModulinoVibro : public Module {
223
+ public:
224
+ ModulinoVibro (uint8_t address = 0xFF )
225
+ : Module(address, " VIBRO" ) {}
226
+ void on (size_t len_ms) {
227
+ uint8_t buf[8 ];
228
+ uint32_t freq = 100 ;
229
+ memcpy (&buf[0 ], &freq, 4 );
230
+ memcpy (&buf[4 ], &len_ms, 4 );
231
+ write (buf, 8 );
232
+ }
233
+ void off () {
234
+ uint8_t buf[8 ];
235
+ memset (&buf[0 ], 0 , 8 );
236
+ write (buf, 8 );
237
+ }
238
+ virtual uint8_t discover () {
239
+ for (int i = 0 ; i < match.size (); i++) {
240
+ if (scan (match[i])) {
241
+ return match[i];
242
+ }
243
+ }
244
+ return 0xFF ;
245
+ }
246
+ protected:
247
+ std::vector<uint8_t > match = { 0x70 }; // same as fw main.c
248
+ };
249
+
250
+
222
251
class ModulinoColor {
223
252
public:
224
253
ModulinoColor (uint8_t r, uint8_t g, uint8_t b)
You can’t perform that action at this time.
0 commit comments