Switch Machine Controller updated… part 2

I’ve added a first draft of a Software section to the Switch Machine Controller page.  Links are provided to my GitHub pages where the codes can be found.

3 thoughts on “Switch Machine Controller updated… part 2

  1. 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?


  2. 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?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s