云服务器价格_云数据库_云主机【优惠】最新活动-搜集站云资讯

阿里云_深圳建设企业网站_限时特惠

小七 141 0

In this blog, we are going to add the LED display as an threshold indicator in SAP Analytics Cloud. If the certain threshold in the bar chart is reached, the LED will on otherwise it will turn off.

Chrome browser with Web Bluetooth enabled. Open the new tab and run this command to check if your Chrome browser supports the web Bluetooth: chrome://bluetooth-internals/#devices I am using version 78.0.3904.108 (Official Build) (64-bit) for this demo. BBC micro:bit.

Host HTML page It consists of the web Bluetooth functions to communicate with micro:bit to on and off the LED. For simplicity we are just using the built-in LED matrix in micro:bit. If you want you can also use external LEDs. SAP Analytics Application embedded via iFrame An Analytics App to check the threshold in the bar chart and send the signal to host HTML page to on and off the LED.

Build SAC, Analytics Application

Create a simple bar chart that consist of Product ID and Volume with threshold information as shown in the below picture. Add a Timer, Timer_1 to retrieve the result set from the bar chart in order to get the Volume from each Product every 10 seconds. If the volume reached the certain threshold, in this example is 100, execute the postMessage to send the signal "met" to the parent host to on the LED. Otherwise send the signal "nmet" to off the LED. var resultSet = Chart_1.getDataSource().getResultSet(); console.log(resultSet); var rawvalue = ""; var productID = ""; var threshold_met = false; for(var i=0; i= threshold) { console.log("met threshold"); threshold_met = true; } } if (threshold_met) { Application.postMessage(PostMessageReceiver.Parent, "met", "*"); } else { Application.postMessage(PostMessageReceiver.Parent, "nmet", "*"); } Timer_1.start(10);​ Add a Timer, Timer_2 to refresh the chart every 10 seconds. Application.refreshData(); Timer_2.start(10);​ On onInitialization(), insert the following scripts to start the timer_1 and timer_2.

Build Host HTML Page

Create the host HTML app and run it as a server (NodeJS for example). Replace iframeSource with SAC Analytics App URL.

Flash the firmware to micro:bit by dragging the microbit-samples-combined.hex file onto it. Switch on the micro:bit and you should see the scrolling message "DC". Open the host HTML page app URL and enable the Bluetooth on your computer. Click Connect button and select the available micro:bit and click Pair button. If the connection is established, you will see the screenshot as shown below. Check the LED on micro:bit.

Think other possibilities with this approach to control any external modules from SAP Analytics Cloud via web Bluetooth. Let me know if you have any comments/questions. Thanks.

,微信返利机器人,云翌通信,云服务器ecs,物联网是啥,物联网是啥