andyf2022
Members-
Content Count
7 -
Joined
-
Last visited
Everything posted by andyf2022
-
Greetings chaps, edit this code attached, to work on D7: https://github.com/okini3939/Enttec_test Reading parameters from one of these USB DMX Boxes :https://www.enttec.com/product/lighting-communication-protocols/dmx512/dmx-usb-pro/ Usual responses go into memo1 devices 1 0 open 4841960 Sending GET_WIDGET_PARAMS packet... PRO Connected Succesfully 0 0 3 version 1.44 BREAK TIME 196030 MAB TIME 10670 To not mess that up I created a button to test reading the serial number and having the results go to memo2. All fine, D7 is communicating with the Box and receiving parameters and sending out DMX but I cannot understand this code enough to know why I do not get the serial number. How should I format the request and values, returned I get "0" and sometimes -1 into memo2. in the API is stated: " 12. Get Widget Serial Number Request (Label = 10, no data), This message requests the Widget serial number, which should be the same as that printed on the Widget ( Device) case. 13. Get Widget Serial Number Reply (Label = 10), The Widget sends this message to the PC in response to the Get Widget Serial Number request. BCD serial number, with LSB stored at lowest address. On old Widgets, the serial number was not programmed, and the value would be hex 0FFFFFFFF, my device is a new one and other commercial software reads the serial number fine. So all is working except the code. " procedure TForm1.Button5Click(Sender: TObject); var buf_size: array[0..3] of byte; res: integer; buf: array[0..256] of byte; begin buf_size[0] := 0; buf_size[1] := 0; memo2.Lines.clear; memo2.Lines.add('TX GET_WIDGET_SN packet'); res := FTDI_SendData(GET_WIDGET_SN, buf_size, 2); sleep(100); memo2.Lines.add('RX GET_WIDGET_SN packet'); res := FTDI_ReceiveData(GET_WIDGET_SN, buf_size, 4); memo2.Lines.add(inttostr(res)); end;
-
No change, The device does reply though so I am sure it is responding with the info, at least somewhere.
-
I have a scrollbar with Min 0 and Max 255 on a Label I want to add what percent the position is moved too. pos:=scrollbar1.position; PercentLabel.caption:=inttostr(round(pos div 100)); Confused with the results 0 1 and 2 as I move the scrollbar. Of course I am doing something wrong but what?
-
Percent Calculations
andyf2022 replied to andyf2022's topic in Algorithms, Data Structures and Class Design
Needed the range including zero to 255 -
Percent Calculations
andyf2022 replied to andyf2022's topic in Algorithms, Data Structures and Class Design
Brilliant, thank you. -
Greetings coders, Using Delphi 7, old I know but it is all I have. I am wondering how to go about plotting a circle or an oval onto a canvas using code sin and cos, basically programmatically plotting points on the canvas around in a circle or oval of scroll bar selected sizes. ideally with two scroll bars setting the the dimensions, then click a plot button, maybe using a timer to show that it is creating the shape a point at a time. like to plot a 128x128 255x128 I am thinking in a 255x255 pixel area. As I do this I want to save the plot points into an array with horizontal and Vertical values Most of this I can figure but the sin cos functions and other math are beyond my experience.
-
creating circles and ovals programmatically Sin Cosin
andyf2022 replied to andyf2022's topic in General Help
Thank you for the replies