I have basic wxPython knowledge.
I am trying to obtain the slider value and set this as the value for the Pulse width modulation of an LED.
This is the code I have so far:
Slider
slider = wx.Slider (panel, 100, 25, 1, 100, pos=(200,70), size=(250, -1), style= wx.SL_HORIZONTAL | wx.SL_AUTOTICKS | wx.SL_LABELS ) slider.SetTickFreq(5, 1) slider.SetBackgroundColour("light blue") self.Bind(wx.EVT_SCROLL_CHANGED, self.OnSlide1)
Function
def OnSlide1(self,event): PWM_VALUE = event.GetEventObject() p = GPIO.PWM(11, PWM_VALUE) p.start(0)
This returns "TypeError: requires a float" which I believe to mean it needs a floating point.
However I am not sure if the code is close to being correct anyway.