• I think when you start doing stuff, you'd actually be quite surprised by how much you can get done with the pins on a single microcontroller - for instance you could have one servo motor per pin, and there are around 40 pins available.

    But as @DrAzzy says, there are lots of ways of getting more pins from a single microcontroller.

    As he hinted at, if you have lots of Espruinos you can chain them together very easily. For instance, you can connect pin A10 (Serial receive) of all the 'slave' Espruinos together, and can connect that to A9 (Serial transmit) of the 'master' Espruino.

    As long as each of the slaves has a variable called NAME that is unique, you can send JavaScript commands straight to any of the slaves. For instance on the 'master':

    Serial1.println("if (NAME=='bob') digitalWrite(LED1,1);");
    Serial1.println("if (NAME=='fred') digitalPulse(A0,1,100);");
    

    Then all devices will execute the code, but only the devices with the correct names will actually run the command after the if statement.

    Hope that helps!

About

Avatar for Gordon @Gordon started