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 @@ -222,6 +222,35 @@ class ModulinoBuzzer : public Module {
222222 uint8_t match[1 ] = { 0x3C }; // same as fw main.c
223223};
224224
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+
225254class ModulinoColor {
226255public:
227256 ModulinoColor (uint8_t r, uint8_t g, uint8_t b)
You can’t perform that action at this time.
0 commit comments