Creating a Class with Firmata for Arduino

edited August 2015 in Arduino

I'm creating a radar simulation, and want to send data from Processing to an Arduino to control 4 small stepper motors to display range and bearing on 4 dials. Firmata seems like a good solution for this.

Would like to create a Class "MOTOR" and instantiate each of the motors in the main sketch. I've successfully created a number of simple classes before, but am unclear on how/where to place the special libraries that need to be imported for Firmata. Also not sure where this should be placed: arduino = new Arduino(this, Arduino.list()[5], 115200);

The general question is: When creating a Class which uses specific libraries - where should the libraries be imported - in the 'main' sketch or in the class?

Answers

  • edited August 2015 Answer ✓

    Where should the libraries be imported - in the 'main' sketch or in the class?

    Inside PDE, it doesn't matter where import is located, since all classes are nested to 'main' sketch!

Sign In or Register to comment.