3 thoughts on “Switch Machine Controller updated… part 2

  1. twrackers's avatar

    Do you mean a compile, download, or runtime error?

    RingBuffer doesn’t depend on any headers other than Arduino.h, so it should compile fine. You have to limit how big a ring buffer you create, an Arduino has only so much RAM and the ring buffer can’t use it all. And if you’re using small Arduinos like Adafruit Trinkets or Gemmas, they only have about 1/4 the RAM of, say, an UNO.

    If these aren’t helpful, can you tell me what kind of error you’re getting?

    Like

  2. twrackers's avatar

    I should add, the ring buffer memory is not allocated during the compile, so you will probably have no warnings during the download… err… upload about running out of RAM. The buffer is allocated at runtime, so it would be easy to accidentally request too much memory when the RingBuffer constructor executes. Maybe I need to add some error checking there. Anyway, creating a buffer that’s too large is the most likely source of errors.

    Have you tried compiling and running the RBTest example program?

    Like

Leave a comment