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 @@ -39,6 +39,8 @@ String pinstrapToName(uint8_t pinstrap) {
3939 return " ENCODER" ;
4040 case 0x6C :
4141 return " SMARTLEDS" ;
42+ case 0x70 :
43+ return " VIBRO" ;
4244 }
4345 return " UNKNOWN" ;
4446}
Original file line number Diff line number Diff line change @@ -219,6 +219,35 @@ class ModulinoBuzzer : public Module {
219219 std::vector<uint8_t > match = { 0x3C }; // same as fw main.c
220220};
221221
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+
222251class ModulinoColor {
223252public:
224253 ModulinoColor (uint8_t r, uint8_t g, uint8_t b)
You can’t perform that action at this time.
0 commit comments