Difference between revisions of "Component: BBC Weather Observation (Comms: IoT/Cloud)"

From Flowcode Help
Jump to navigationJump to search
 
(17 intermediate revisions by 2 users not shown)
Line 13: Line 13:
  
 
==BBC Weather Observation component==
 
==BBC Weather Observation component==
Easily allows you to collect observed weather metrics for your area using the BBC Weather data service. Supports temperature and humidty for your selected area. Also available are Wind Direction, Wind Speed and Air Pressure but please note these are not always available depending on your selected area.  
+
Easily allows you to collect observed weather metrics for your area using the BBC Weather data service. Supports temperature and humidity, pressure, Wind direction etc for your selected area. Also available are Wind Direction, Wind Speed and Air Pressure but please note these are not always available depending on your selected area.  This component is used for data gathering from the internet.  
  
==Detailed description==
+
==Component Source Code==
  
 +
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_BBCWeatherObservation.fcfx FC_Comp_Source_BBCWeatherObservation.fcfx]
  
 +
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_BBCWeatherObservation.fcfx FC_Comp_Source_BBCWeatherObservation.fcfx]
 +
 +
==Detailed description==
  
''No detailed description exists yet for this component''
 
  
==Examples==
 
  
  
Line 27: Line 29:
  
  
Here is a basic example to read the observation data and report the information on a graphical display.
 
  
{{Fcfile|BBCWeatherDemo.fcfx|BBCWeatherDemo}}
 
  
  
The location can be set by adjusting the BBC Weather location property, see the component property tooltips for more information on how to do this.
 
  
On an embedded device you would need a TCP/IP component to allow the communications to the BBC server. This then links to the Network Comms component.
 
  
  
  
==Downloadable macro reference==
 
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetWindDirection'''
 
|-
 
| colspan="2" | Reads the reported wind direction as a string. Please note this data may not be available for your selected location. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''RequestData'''
 
|-
 
| colspan="2" | Requests data about your selected location from the BBC weather service. Returns true if the request was successful. Must be called before trying to call any of the GetXXX macros. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetHumidity'''
 
|-
 
| colspan="2" | Reads the reported humidity in Relative Humdity. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTemperature'''
 
|-
 
| colspan="2" | Reads the reported temperature in the selected scale. 
 
|-
 
|-
 
| width="10%" align="center" | [[File:]] -
 
| width="90%" | Scale
 
|-
 
| colspan="2" | 0 = Celcius, 1 = Farenheit 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetWindSpeed'''
 
|-
 
| colspan="2" | Reads the reported wind speed in MPH. Please note this data may not be available for your selected location. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
''No detailed description exists yet for this component''
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetLocationCode'''
 
|-
 
| colspan="2" | Allows the location code to be altered from the default location code set in the component properties. After changing the location the RequestData macro must be called to refresh the forecast variables. 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 
| width="90%" | NewLocation
 
|-
 
| colspan="2" | New location string, see Location property tooltip for more info. 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
 +
==Examples==
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetPressure'''
 
|-
 
| colspan="2" | Reads the reported air pressure in milli bar (mb). Please note this data may not be available for your selected location. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetLocationName'''
 
|-
 
| colspan="2" | Reads the reported location name as a string. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 
|-
 
| colspan="2" | Sets up the component ready to collect weather data. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetLocationCode'''
 
|-
 
| colspan="2" | Allows the location code to be altered from the default location code set in the component properties. After changing the location the RequestData macro must be called to refresh the forecast variables. 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 
| width="90%" | NewLocation
 
|-
 
| colspan="2" | New location string, see Location property tooltip for more info. 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetSunrise'''
 
|-
 
| colspan="2" | Reads the forecast sunrise time as a string for the selected day. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetPressure'''
 
|-
 
| colspan="2" | Reads the forecast air pressure in milli bar (mb) for the selected day. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetForecastDay'''
 
|-
 
| colspan="2" | Chooses which day of the three day forecast to look at.  
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Day
 
|-
 
| colspan="2" | 0 = Today, 1 = Tomorrow, 2 = Day After Tomorrow 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetUVRisk'''
 
|-
 
| colspan="2" | Reads the forecast UV Risk for the selected day. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetLocationName'''
 
|-
 
| colspan="2" | Reads the reported location name as a string. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 
|-
 
| colspan="2" | Sets up the component ready to collect weather data. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 
|-
 
| colspan="2" | Sets up the GSM module. Returns 0 for OK, 255 for no reply and 254 for command fail. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Left'''
 
|-
 
| colspan="2" | Rotates the robot left - waits for the angle to be traversed before returning 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Angle
 
|-
 
| colspan="2" | Angle to turn in degrees 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadIR'''
 
|-
 
| colspan="2" | Reads an IR sensor 0=Left, 1=FrontLeft, 2=Front, 3=FrontRight, 4=Right, 5=RearRight,  6=Rear, 7=RearLeft 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | index
 
|-
 
| colspan="2" | 0=Left, 1=FrontLeft, 2=Front, 3=FrontRight, 4=Right, 5=RearRight, 6=Rear, 7=RearLeft 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
Here is a basic example to read the observation data and report the Manchester weather information for today and tomorrow, on a graphical display.
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDDrawPixel'''
 
|-
 
| colspan="2" | Allows a single pixel on the LCD to be set or cleared 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | X
 
|-
 
| colspan="2" | X Pixel 0-127 
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Y
 
|-
 
| colspan="2" | Y Pixel 0-31 
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | State
 
|-
 
| colspan="2" | 0=White (Off), 1=Black (On) 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
 +
{{Fcfile|BBCWeatherForecastDemo.fcfx|BBCWeatherDemo}}
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ServoSetPosition'''
 
|-
 
| colspan="2" | Allows one of the servo positions to be assigned 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Range 0-3 
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Position
 
|-
 
| colspan="2" | Range 0-255 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
 +
The location can be set by adjusting the BBC Weather location property, see the component property tooltips for more information on how to do this.
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
+
On an embedded device you would need a TCP/IP component to allow the communications to the BBC server. This then links to the Network Comms component.
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CardBitmap'''
 
|-
 
| colspan="2" | Displays a monochrome bitmap read from the card on the LCD 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | X
 
|-
 
| colspan="2" | Range 0-127 
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Y
 
|-
 
| colspan="2" | Range 0-31 
 
|-
 
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 
| width="90%" | Filename
 
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
  
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CardRecordMic'''
 
|-
 
| colspan="2" | Records an audio stream on the card from the microphone 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | BitDepth
 
|-
 
| colspan="2" | 0=8-bit, 1=16-bit 
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | SampleRate
 
|-
 
| colspan="2" | Sample Rate 0=8KHz, 1=16KHz 
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | RecordTime
 
|-
 
| colspan="2" | Time to record for in seconds, Range 0-65535 
 
|-
 
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 
| width="90%" | Filename
 
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
  
 +
==Macro reference==
  
 +
===GetHumidity===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CardOpen'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetHumidity'''
 
|-
 
|-
| colspan="2" | Attempts to open an existing file on the SD card 255=Error, 1=File not found, 0=Open OK 
+
| colspan="2" | Reads the reported humidity in Relative Humdity. 
 
|-
 
|-
|-
 
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 
| width="90%" | Filename
 
|-
 
| colspan="2" |  
 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
Line 447: Line 104:
  
  
 +
===GetLocationName===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Forwards'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetLocationName'''
 
|-
 
|-
| colspan="2" | Drives the robot forwards - waits for the distance to be traversed before returning 
+
| colspan="2" | Reads the reported location name as a string. 
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | Distance
 
|-
 
| colspan="2" | Distance in mm 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===GetPressure===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadBearing'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetPressure'''
 
|-
 
|-
| colspan="2" | Reads the compass bearing based on the degrees clockwise from magnetic north. 
+
| colspan="2" | Reads the reported air pressure in milli bar (mb). Please note this data may not be available for your selected location. 
 
|-
 
|-
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetConsoleHandle'''
 
|-
 
| colspan="2" | Gets the handle to the console allowing data displaying on the panel etc. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:]] -
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDDrawLine'''
 
|-
 
| colspan="2" | Allows a single pixel width line to be drawn on the LCD 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | X1
 
|-
 
| colspan="2" | X Pixel 0-127 
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Y1
 
|-
 
| colspan="2" | Y Pixel 0-31 
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | X2
 
|-
 
| colspan="2" | X Pixel 0-127 
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Y2
 
|-
 
| colspan="2" | Y Pixel 0-31 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ServoAutoMoveToPosition'''
 
|-
 
| colspan="2" | Allows one of the servo positions to move gradually to a new position 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Range 0-3 
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Position
 
|-
 
| colspan="2" | Range 0-255 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadAllValue'''
 
|-
 
| colspan="2" | Reads a single value stored from the read all command Index dictates which sensor value to read 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Index
 
|-
 
| colspan="2" | 0=SW, 1-8=IR, 9-10=Line, 11=Light, 12=Mic, 13-15=Accel 
 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
Line 565: Line 132:
  
  
 +
===GetTemperature===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDBacklight'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetTemperature'''
 
|-
 
|-
| colspan="2" | Allows the LCD backlight brighntess to be adjusted 
+
| colspan="2" | Reads the reported temperature in the selected scale. 
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL
| width="90%" | Intensity
+
| width="90%" | Scale
 
|-
 
|-
| colspan="2" | Range 0-100, 0=Off, 1=Min Brightness, 100=Max Brightness 
+
| colspan="2" | 0 = Celcius, 1 = Farenheit 
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-s16-icon.png]] - INT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===GetWindDirection===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDDrawRect'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetWindDirection'''
 
|-
 
|-
| colspan="2" | Allows a rectangle to be drawn on the LCD 
+
| colspan="2" | Reads the reported wind direction as a string. Please note this data may not be available for your selected location. 
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | X1
 
|-
 
| colspan="2" | X Pixel 0-127 
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Y1
 
|-
 
| colspan="2" | Y Pixel 0-31 
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | X2
 
|-
 
| colspan="2" | X Pixel 0-127 
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Y2
 
|-
 
| colspan="2" | Y Pixel 0-31 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===GetWindSpeed===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ReadLine'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetWindSpeed'''
 
|-
 
|-
| colspan="2" | Reads one of the IR line sensors 0-1 0=Left, 1=Right 
+
| colspan="2" | Reads the reported wind speed in MPH. Please note this data may not be available for your selected location. 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | index
 
|-
 
| colspan="2" | 0=Left, 1=Right 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ServoDisable'''
 
|-
 
| colspan="2" | Allows one of the servo outputs 0-3 to be disabled 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Range 0-3 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ServoEnable'''
 
|-
 
| colspan="2" | Allows one of the servo outputs 0-3 to be enabled 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Channel
 
|-
 
| colspan="2" | Range 0-3 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CardReadByte'''
 
|-
 
| colspan="2" | Reads a byte from the currently open file. Starts at the beginning of the file and auto increments to the end 
 
 
|-
 
|-
 
|-
 
|-
Line 683: Line 179:
  
  
 +
===Initialise===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CardErase'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 
|-
 
|-
| colspan="2" | Attempts to delete an existing file on the SD card 255=Error, 1=File not found, 0=Delete OK 
+
| colspan="2" | Sets up the component ready to collect weather data. 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 
| width="90%" | Filename
 
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
 
|-
 
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CardWriteByte'''
 
|-
 
| colspan="2" | Appends a byte to the end of the currently open file  
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | Data
 
|-
 
| colspan="2" |  
 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
Line 719: Line 193:
  
  
 +
===RequestData===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EncoderRead'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''RequestData'''
 
|-
 
|-
| colspan="2" | Reads one of the motor encoder counters. Approx 0.328296mm of travel per encoder unit. 
+
| colspan="2" | Requests data about your selected location from the BBC weather service. Returns true if the request was successful. Must be called before trying to call any of the GetXXX macros. 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | index
 
 
|-
 
|-
| colspan="2" | 0=Left, 1=Right 
 
 
|-
 
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
+
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
  
  
 +
===SetLocationCode===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetMotors'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetLocationCode'''
 
|-
 
|-
| colspan="2" | Sets the motor speeds without feedback Range -100 to 100 
+
| colspan="2" | Allows the location code to be altered from the default location code set in the component properties. After changing the location the RequestData macro must be called to refresh the forecast variables. 
|-
 
|-
 
| width="10%" align="center" | [[File:]] -
 
| width="90%" | Left
 
|-
 
| colspan="2" | Range -100 to 100 
 
|-
 
| width="10%" align="center" | [[File:]] -
 
| width="90%" | Right
 
|-
 
| colspan="2" | Range -100 to 100 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Backwards'''
 
|-
 
| colspan="2" | Drives the robot backwards - waits for the distance to be traversed before returning 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
 
| width="90%" | Distance
 
|-
 
| colspan="2" | Distance in mm 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''EncoderReset'''
 
|-
 
| colspan="2" | Resets the motor encoder counters 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDVerbose'''
 
|-
 
| colspan="2" | Allows the LCD to automatically report the API commands as they get processed. Default - verbose on 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" | State
 
|-
 
| colspan="2" | 0=Off 1=On 
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SetProp'''
 
|-
 
| colspan="2" | Allows the COM port property to be set from a parent component. 
 
 
|-
 
|-
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
| width="90%" | PropName
+
| width="90%" | NewLocation
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG
 
| width="90%" | PropVal
 
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CardInit'''
 
|-
 
| colspan="2" | Attempts to startup the SD card  255=No Card, 254=Init Fail, 0=Init OK 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''GetProp'''
 
|-
 
| colspan="2" | Allows the property filter for the COM port list to be copied to a parent component. 
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING
 
| width="90%" | PropName
 
|-
 
| colspan="2" |  
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-string-icon.png]] - STRING
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
 
 
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''LCDClear'''
 
|-
 
| colspan="2" | Clears the LCD 
 
 
|-
 
|-
 +
| colspan="2" | New location string, see Location property tooltip for more info. 
 
|-
 
|-
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 
 
  
  
Line 886: Line 234:
 
|-
 
|-
 
|-
 
|-
| width="10%" align="center" | [[File:Fc9-type-17-icon.png]]
+
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Network Comms Component
+
| width="90%" | LinkTo
 
|-
 
|-
| colspan="2" | Network Communications component to use as the bridge to the TCP/IP network. 
+
| colspan="2" |  
 
|-
 
|-
 
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
 
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]]
Line 905: Line 253:
 
|-
 
|-
 
| colspan="2" | Maximum time to wait for valid incoming data. 
 
| colspan="2" | Maximum time to wait for valid incoming data. 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connections'''
 
|-
 
|-
 
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-conn-icon.png]]
 
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Simulations'''
 
|-
 
 
|}
 
|}

Latest revision as of 11:57, 3 November 2023

Author MatrixTSL
Version 1.0
Category Comms: IoT/Cloud


BBC Weather Observation component

Easily allows you to collect observed weather metrics for your area using the BBC Weather data service. Supports temperature and humidity, pressure, Wind direction etc for your selected area. Also available are Wind Direction, Wind Speed and Air Pressure but please note these are not always available depending on your selected area. This component is used for data gathering from the internet.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_BBCWeatherObservation.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_BBCWeatherObservation.fcfx

Detailed description

No detailed description exists yet for this component

Examples

Here is a basic example to read the observation data and report the Manchester weather information for today and tomorrow, on a graphical display.

FC6 Icon.png BBCWeatherDemo


The location can be set by adjusting the BBC Weather location property, see the component property tooltips for more information on how to do this.

On an embedded device you would need a TCP/IP component to allow the communications to the BBC server. This then links to the Network Comms component.


Macro reference

GetHumidity

Fc9-comp-macro.png GetHumidity
Reads the reported humidity in Relative Humdity. 
Fc9-u8-icon.png - BYTE Return


GetLocationName

Fc9-comp-macro.png GetLocationName
Reads the reported location name as a string. 
Fc9-string-icon.png - STRING Return


GetPressure

Fc9-comp-macro.png GetPressure
Reads the reported air pressure in milli bar (mb). Please note this data may not be available for your selected location. 
Fc9-u16-icon.png - UINT Return


GetTemperature

Fc9-comp-macro.png GetTemperature
Reads the reported temperature in the selected scale. 
Fc9-bool-icon.png - BOOL Scale
0 = Celcius, 1 = Farenheit 
Fc9-s16-icon.png - INT Return


GetWindDirection

Fc9-comp-macro.png GetWindDirection
Reads the reported wind direction as a string. Please note this data may not be available for your selected location. 
Fc9-string-icon.png - STRING Return


GetWindSpeed

Fc9-comp-macro.png GetWindSpeed
Reads the reported wind speed in MPH. Please note this data may not be available for your selected location. 
Fc9-u8-icon.png - BYTE Return


Initialise

Fc9-comp-macro.png Initialise
Sets up the component ready to collect weather data. 
Fc9-void-icon.png - VOID Return


RequestData

Fc9-comp-macro.png RequestData
Requests data about your selected location from the BBC weather service. Returns true if the request was successful. Must be called before trying to call any of the GetXXX macros. 
Fc9-bool-icon.png - BOOL Return


SetLocationCode

Fc9-comp-macro.png SetLocationCode
Allows the location code to be altered from the default location code set in the component properties. After changing the location the RequestData macro must be called to refresh the forecast variables. 
Fc9-string-icon.png - STRING NewLocation
New location string, see Location property tooltip for more info. 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png LinkTo
 
Fc9-type-10-icon.png BBC IP Address
IP Address linked to the following URL: weather-broker-cdn.api.bbci.co.uk 
Fc9-type-10-icon.png Location Code
BBC code for your area. In a web browser go to www.bbc.co.uk/weather/ Then type in your city in the search bar and your code will be shown at the end of the URL. For example Manchester in the UK = 2643123 In the UK you can also use the first half of your post code, e.g. HX1 
Fc9-type-21-icon.png Receive Timeout
Maximum time to wait for valid incoming data.