Part Number: TMS320F28379D
Tool/software:
Hello,
I tried implementing the javascript for using a button-click to set a value on the target, following the previous suggestion in this thread:
I have implemented in index.js:
const init = () => {
GcWidget.querySelector('#myButton').then(widget => { widget.addEventListener('click', async () => { const binding = bindingRegistry.getBinding('pm.sampledata'); const value = binding.getValue();// value = 1; const value2 = 1; binding.updateValue(value2); alert("Button Clicked!"); }); });
};
I have an infinite while loop on the target checking the value of sampledata, and if "sampledata" becomes some non-zero value, an LED will be toggled on the board, and another variable will also be incremented that I can monitor via link to another GUI Composer text box.
I get the "Button Clicked!" alert when I press the button, but I do not see sampledata is being set. (The LED is not toggling, the variable is not being incremented).
Do I need to put the "GcWidget.queerySelector" somewhere else? Or is there something else that I need to do to get this to work?
Thanks!
