Devices defines

Posted on
  • Hello,
    I'm building Espruino on custom board (based on STM32F4) which have five buttons and I would like to add the definition of the fifth button to binary. I added definitions of buttons to file and also I added BTN5 to simpleDevices array in but when I flash the board and try to call BTN5 I get Uncaught ReferenceError: "BTN5" is not defined. Do I need to define this button somewhere else or it's not possible to define more buttons or other devices? I found note about this mentioning that I can you LED1-LED8, BTN1-BTN4, etc., but I need one more button for convenience. Thanks for any advice

  • As far as I remember there are only 4 buttons built-in - but it'd be easy enough to add more.

    Just do a text search over all the files for BTN4, and where it says that, copy the relevant lines and rename to BTN5 :)

  • Heureka, I did not know that it can be somewhere in jspin.c. Thank you very much :)

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

Devices defines

Posted by Avatar for DarKMooN @DarKMooN