File tree Expand file tree Collapse file tree 3 files changed +1249
-1218
lines changed
examples/Utilities/AddressChanger Expand file tree Collapse file tree 3 files changed +1249
-1218
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 @@ -246,6 +246,35 @@ class ModulinoBuzzer : public Module {
246246 uint8_t match[1 ] = { 0x3C }; // same as fw main.c
247247};
248248
249+ class ModulinoVibro : public Module {
250+ public:
251+ ModulinoVibro (uint8_t address = 0xFF )
252+ : Module(address, " VIBRO" ) {}
253+ void on (size_t len_ms) {
254+ uint8_t buf[8 ];
255+ uint32_t freq = 100 ;
256+ memcpy (&buf[0 ], &freq, 4 );
257+ memcpy (&buf[4 ], &len_ms, 4 );
258+ write (buf, 8 );
259+ }
260+ void off () {
261+ uint8_t buf[8 ];
262+ memset (&buf[0 ], 0 , 8 );
263+ write (buf, 8 );
264+ }
265+ virtual uint8_t discover () {
266+ for (int i = 0 ; i < match.size (); i++) {
267+ if (scan (match[i])) {
268+ return match[i];
269+ }
270+ }
271+ return 0xFF ;
272+ }
273+ protected:
274+ std::vector<uint8_t > match = { 0x70 }; // same as fw main.c
275+ };
276+
277+
249278class ModulinoColor {
250279public:
251280 ModulinoColor (uint8_t r, uint8_t g, uint8_t b)
You can’t perform that action at this time.
0 commit comments