If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

## Electrical engineering

### Course: Electrical engineering>Unit 8

Lesson 5: Programming basics

# Data wires

data wires allow you to send values directly from input sensors to output devices. Created by Brit Cruise.

## Want to join the conversation?

• where do you get this engine?
• Why does that read IN OUT? I am puzzled?
• He meant it as a table...
(1 vote)
• Is the guitar light sensitive? What kind of guitar is it?
• were do you get the light guiter and parts to build it
• how many different variables are there?
• where did you build this?
• I think for drawing he is using "Adobe Photoshop CS3" because I have the same Mac as him (except I upgraded it). For the code, he used "LEGO MINDSTORMS NXT"
(1 vote)
• I don't get this. Can anyone help me? 😊
(1 vote)
• What are most wires made from ?
(1 vote)
• What are inputs and outputs?
(1 vote)
• Inputs are things you put in
outputs are thinds you take out
like in the bank you put money which is in puts and you take money out which is outputs
(1 vote)
• How do you connect inputs with outputs?
(1 vote)

## Video transcript

It's very powerful to understand how our inputs and outputs can communicate with each other, or more specifically, how they can be wired together. Now these two things speak the language of numbers. Our inputs are anything that is providing data to the brain, so any of our sensors. For example, let's pretend we plugged in a light sensor. Now the light sensor provides a value, and this will depend on the sensor you're using. In the case of a light sensor, it's providing a value between 0 and 100 which represents the intensity of the current light condition in front of the sensor. Now our outputs are the opposite-- our motor or our lamp or speaker. Outputs we actually provide a number to so they know how to behave. And in the case-- if this was a motor, we would provide it direction and power, but for the speaker, we could provide it multiple outputs, such as pitch, which is the frequency of a tone, and we can also send it volume, and these are the two most important features. Now the powerful thing to realize is that we could take this intensity value and plug it in to, say, pitch. So as the environment changes-- if we flip the lights on or grab a flashlight-- you will actually hear this change in real time using the speaker. So let's grab an input, for example, our light sensor and an output, for example, the sound block. And to wire blocks together, you first have to click on the bottom of the block, which will expand this little column here, which will give you access to them, and here are all my inputs and outputs-- inputs on the left, outputs on the right-hand side. So remember, we want to take our light intensity-- and if I scroll down, there is an intensity output here. And I can click on it and then drag this wire and I will plug it into the pitch or tone frequency input on this sound block. Now there's also volume and other things here. I plugged it into pitch. So now these two blocks are wired together. So to get a dynamic behavior, you need to drop this inside a loop, and then it will continue to update and you should be able to hear the difference.