By using voltage divider method for each button, different voltage drop due to different resistor value across each button will have different voltage output thus each button can be identified by just using 1 analog pin. As you know, analog value ranges 0 to 1023 which signify 0 to 5V input range. If you have more buttons, you will need the same amount of Digital Pins.Ĭome back to our Button Module in the shield, this button module here is utilizing the advantage of Analog Pin so that only 1 analog pin is sufficient to control all buttons. However, each digital pin only can sense 1 button. There are simple button modules out there which are using Digital Pins to detect the push button. Now feed all in the right order into a switch and export or reference the number received from the Arduino as you already did.Let us separate the shield into the 2 parts: the push button module and LCD Display module. For the combined states, use one of the Composite TOP’s functions. This might make things a bit easier as you are not dealing with having to parse the messages coming from the Arduino in the Serial DAT but get direct access to the value in the CHOP.Īs you are starting with TouchDesigner, I would recommend creating 3 Text TOPs with the text showing your state. Now you can also use the Serial CHOP directly instead of the Serial DAT. I guess this would give you 6? different options. Hence I think it might make sense not to pass strings from the Arduino but rather integers uniquely identifying each state: If “index” equals 0, the first input is passed through, if “index” equals 1, the second input is passed through and so on… For example the Switch TOP has a parameter called “index” which controls what input is passed through - not unlike a gate of sorts. Hey lot of things in TouchDesigner work with a number reference. Int stateNew = digitalRead(buttonPin) ? 0 : 1 Īnd this is what I have on touchdesigner currently that was followed blindly with whatever video tutorial I could find on arduino and touchdesigner. This is my code used in arduino: // declare and init pins and variables In total, 6 visuals will be made in touch designer and I’ll have to link each input to a visual respectively. condensedplum(on arduino) ->condensedplum visual shown.Button ‘Plum’ pressed (on arduino) → plum visual shown.Button ‘condensed’ pressed (on arduino) → condensed visuals shown.Secondly, the button works in a way where if two bottons is pressed one after another, we have a combination of two visuals.This means: Similarly, visuals for ‘malt’ for ‘malt’ button and visuals for ‘plum’ for ‘plum’ button. When a button is pressed, for example button ‘condensed’, we would like visuals that is created on touchdesigner for ‘condensed’ to appear. In this case, we name each button ‘condensed’, ‘malt’ and ‘plum’ respectively. On our Arduino, we have 3 buttons that will be used to collect input. I have some background knowledge on Arduino and was tasked to link Arduino to touchdesigner, while they were in charge of doing the visuals on touchdesigner. I am doing a personal project with two other friends and we’re trying to connect arduino with touch designer. I am very new to touchdesigner and have no idea what I am doing, and is basically following blindly on tutorials online at this stage, but I am stuck.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |