{"id":629,"date":"2023-03-17T22:26:21","date_gmt":"2023-03-17T22:26:21","guid":{"rendered":"http:\/\/bussigel.com\/newinstruments\/?page_id=629"},"modified":"2025-09-20T00:07:16","modified_gmt":"2025-09-20T00:07:16","slug":"analog-inputs","status":"publish","type":"page","link":"https:\/\/bussigel.com\/newinstruments\/analog-inputs\/","title":{"rendered":"analog inputs"},"content":{"rendered":"\n<p>Unlike Digital Inputs which only transmit two values (On and Off, or High and Low), Analog Inputs are continuous sensors that&nbsp;send&nbsp;a range of values.&nbsp;Analog inputs are great for variable control of parameters like speed, volume, or saturation.&nbsp; The pictures below show how to connect a potentiometer and a photocell, typical Analog Inputs. There are a ton of different types of analog inputs. Some&nbsp;of the more complicated sensors are difficult to connect and use over MIDI, but the majority of analog sensors will work. For more detail, see the&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/www.pjrc.com\/teensy\/tutorial4.html\" target=\"_blank\">Analog Input tutorial<\/a>&nbsp;on the Teensy website (or search for any of the million arduino resources on the topic).<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"716\" src=\"http:\/\/bussigel.com\/newinstruments\/wp-content\/uploads\/2025\/09\/3.png\" alt=\"\" class=\"wp-image-746\" style=\"width:398px;height:auto\" srcset=\"https:\/\/bussigel.com\/newinstruments\/wp-content\/uploads\/2025\/09\/3.png 1024w, https:\/\/bussigel.com\/newinstruments\/wp-content\/uploads\/2025\/09\/3-664x464.png 664w, https:\/\/bussigel.com\/newinstruments\/wp-content\/uploads\/2025\/09\/3-768x537.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>A potentiometer is a variable resistor that usually has three legs. Connect one outer leg to power and the other to ground. The middle leg connects to an Analog Input Pin, in this case A0. Here is the code for using an Analog input\u2026<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ Instantiate an array of CCPotentiometer objects that send \n\/\/ MIDI CC messages when an analog sensor is changed (0-127) \nCCPotentiometer potentiometers&#91;]{ \n{ A0, 16}, \/\/ Analog pin (A0) connected to potentiometer, midi controller number (16) \n{ A1, 17}, \/\/ Analog pin (A1)connected to light dependant resistor (LDR), midi ontroller number (17)} \n};<\/code><\/pre>\n\n\n\n<p>Once again, we start by creating an object, this time it\u2019s called CCPotentiometer and then we create a bunch of them by creating an array of potentiometers. Again, this initial code will stay the same, regardless of how many analog inputs you add! On the next line we specify a pin number, A0, and then tell the arduino what channel to send information on, in this case 16. So the arduino will send Midi control messages\u2013 a range of messages between 0-127, on channel 16.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"778\" src=\"http:\/\/bussigel.com\/newinstruments\/wp-content\/uploads\/2025\/09\/4.png\" alt=\"\" class=\"wp-image-747\" style=\"width:424px;height:auto\" srcset=\"https:\/\/bussigel.com\/newinstruments\/wp-content\/uploads\/2025\/09\/4.png 1024w, https:\/\/bussigel.com\/newinstruments\/wp-content\/uploads\/2025\/09\/4-664x504.png 664w, https:\/\/bussigel.com\/newinstruments\/wp-content\/uploads\/2025\/09\/4-768x584.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>The photocell does require a 10K resistor, which connects one of the legs to ground. The other leg is connected to&nbsp; power&nbsp; and the leg with the resistor is also connected to an Analog Input Pin, in this case A1. <em>Now both of them together\u2026<\/em><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"723\" src=\"http:\/\/bussigel.com\/newinstruments\/wp-content\/uploads\/2025\/09\/5.png\" alt=\"\" class=\"wp-image-748\" style=\"width:406px;height:auto\" srcset=\"https:\/\/bussigel.com\/newinstruments\/wp-content\/uploads\/2025\/09\/5.png 1024w, https:\/\/bussigel.com\/newinstruments\/wp-content\/uploads\/2025\/09\/5-664x469.png 664w, https:\/\/bussigel.com\/newinstruments\/wp-content\/uploads\/2025\/09\/5-768x542.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Unlike Digital Inputs which only transmit two values (On and Off, or High and Low), Analog Inputs are continuous sensors that&nbsp;send&nbsp;a range of values.&nbsp;Analog inputs are great for variable control of parameters like speed, volume, or saturation.&nbsp; The pictures below show how to connect a potentiometer and a photocell, typical Analog Inputs. There are a &hellip; <a href=\"https:\/\/bussigel.com\/newinstruments\/analog-inputs\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">analog inputs<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-629","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/bussigel.com\/newinstruments\/wp-json\/wp\/v2\/pages\/629","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bussigel.com\/newinstruments\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/bussigel.com\/newinstruments\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/bussigel.com\/newinstruments\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bussigel.com\/newinstruments\/wp-json\/wp\/v2\/comments?post=629"}],"version-history":[{"count":3,"href":"https:\/\/bussigel.com\/newinstruments\/wp-json\/wp\/v2\/pages\/629\/revisions"}],"predecessor-version":[{"id":752,"href":"https:\/\/bussigel.com\/newinstruments\/wp-json\/wp\/v2\/pages\/629\/revisions\/752"}],"wp:attachment":[{"href":"https:\/\/bussigel.com\/newinstruments\/wp-json\/wp\/v2\/media?parent=629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}