Skip to content

Post-0.3.0: migrate arduino-repo sketches to scoped (enum class) enums #9

Description

@jonfroehlich

Type: post-0.3.0 follow-up · Where the work happens: the makeabilitylab/arduino repo (not this one)

0.3.0 (PR #8) makes the four public enums enum class (ShapeType, PointSymbol,
JoystickYDirection, GraphPrimitive). Because the arduino repo consumes this
library via a directory junction, once 0.3.0 lands those sketches must qualify any
bare enum values, e.g.:

  • JOYSTICK_Y_DIR = RIGHTJoystickYDirection::RIGHT
  • PointSymbol symbols[] = { CIRCLE, SQUARE }{ PointSymbol::CIRCLE, PointSymbol::SQUARE }
  • const enum JoystickYDirection ... → drop the enum keyword

Until then, those sketches will fail to compile against the updated library.

Candidate sketches (include a migrated header)

  • OLED/AnalogDigitalJoystickTest, OLED/AnalogGraphMultipleInputs,
    OLED/AnimatedSpriteExample, OLED/BallBounceObjectOriented, OLED/CollisionTest,
    OLED/FlappyBird, OLED/MoveBallJoystickTest, OLED/Pong
  • Sensors/Accelerometers/LIS3DH/{AccelBall, AccelGraphMultiValue, AccelGraphSingleValWithClass}
  • Serial/FlappyBirdSerialIn

(Not all reference bare enum values — joystick + graph-symbol sketches are the ones that do.)

Find the exact spots

cd d:/git/arduino
grep -rInE '\b(RIGHT|LEFT|UP|DOWN)\b|PointSymbol|\benum (JoystickYDirection|ShapeType|PointSymbol|GraphPrimitive)\b' --include='*.ino' .

Also remove any lingering #include <LineGraph.hpp> / MultiValueScrollingLineGraph
usage (that header was deleted in 0.3.0).

Do after: PR #8 is merged and the library updated. Verify each with
arduino-cli compile --fqbn arduino:avr:uno <sketch>.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions