pu2clr / RDA5807

Arduino Library for SINGLE-CHIP BROADCAST FM RADIO TUNER RDA5807
MIT License
114 stars 20 forks source link

[Option] Use serial input parser for getting commands #22

Open martin-eden opened 3 weeks ago

martin-eden commented 3 weeks ago

Hello Ricardo,

I see you're using switch(Serial.read()). I wrote standalone library to register handlers as commands. me_Menu.

When handler is executed it can read Serial on their own if it needs additional data. For example here me_RgbStripeConsole reads pixel's color from stream.

This approach allows you to have multi-character commands. Plus default implementation supplies ? command to print list of available commands.

-- Martin