//temperature action action temperature() | var temperature := engduino -> temperature - 273 | |>temperatureLED(temperature) | |>tempAlert(temperature) | |>printTemperature(temperature) | |>turnLEDsOff end action //temperatureLED action private actiontemperatureLED( | p: Number) do | var n := 0 | n := p - 35.5 | for 0 <= 1 < n * 2 + 1 do | | engduino -> set LED(i, colors -> blue | end for end action //tempAlert action private action tempAlert( | p: Number) do | if(p < 36.1) then | | "Hypothermia" -> post to wall | | "Preventing further heat from being lost and warm the patient" -> post to wall | else if p >= 36.1 and p < 37.5 then | | "Normal body temperature" -> post to wall | else if p >= 37.5 and p < 38.5 then | | "High temperature" -> post to wall | | "Children under 3 months of age with a temperature of 38 degrees or greater should be seen by a health care professional." -> post to wall | else | | "Very high temperature" -> post to wall | end if end action //printTemperature action private action printTemperature( | p: Number) do | "Your temperature is of " -> concat(p -> to string) -> concat(" degrees Celsius") -> post to wall end action //turnLEDsOff action private action turnLEDsOff() | engduino -> delay(500) | engduino -> set all LEDs(colors -> black) end action