UofTAgritech / PeaPod

A cloud-connected automated plant growth environment, designed as both a hassle-free food production system and a distributed citizen-science research tool.
MIT License
1 stars 0 forks source link

[SOFTWARE] - Instruction Parsing and Actuator Control #9

Open narvcharv opened 2 years ago

narvcharv commented 2 years ago

@UofTAgritech/electronics

Completion is tracked in the linked PR.

Design Scope

Design an instruction parsing function that takes in an instruction set and performs actions, including updating actuator targets.

Function

Inputs:

{
    "{instructionlabel}": {value},
    //...
}

Outputs:

It interfaces with/depends on the following systems:

Requirements and Validation

What does this design need to accomplish? How do we know it has accomplished this?

  1. Translation of RPi instructions to physical action in the various actuators.
  2. Know it's done when actuators are being controlled automatically

Verification

Each test should be performed and documented, and the testing documentation attached to the PR. The testing suite should address the full scope of the function (i.e. ensure inputs are met and outputs work), method (all steps execute correctly), and features (each feature performs as expected) with respect to the purpose and requirements.

How does this design achieve its method effectively, safely, and reliably? How do we test this?

Specific testing procedure:

  1. Generate output in the appropriate form
  2. Feed into Arduino connected to whichever actuators are available (i.e. lighting board)
  3. Confirm desired actuator output
JLefebvre55 commented 2 years ago

Todo

Background

Not sure if we should manually parse JSON (strip { and }, split by ,, then divide by :) or use a library of some sort

Essentially use a switch statement for each instruction label