You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/api_en/blendMode.xml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,7 @@ SCREEN - opposite multiply, uses inverse values of the colors.<br />
57
57
<br />
58
58
REPLACE - the pixels entirely replace the others and don't utilize alpha (transparency) values<br />
59
59
<br />
60
-
For Processing 2.0, we recommend using <b>blendMode()</b> and not the previous <b>blend()</b> function. However, unlike <b>blend()</b>, the <b>blendMode()</b> function does not support the following: HARD_LIGHT, SOFT_LIGHT, OVERLAY, DODGE, BURN. On older hardware, the LIGHTEST, DARKEST, and DIFFERENCE modes might not be available as well.
60
+
We recommend using <b>blendMode()</b> and not the previous <b>blend()</b> function. However, unlike <b>blend()</b>, the <b>blendMode()</b> function does not support the following: HARD_LIGHT, SOFT_LIGHT, OVERLAY, DODGE, BURN. On older hardware, the LIGHTEST, DARKEST, and DIFFERENCE modes might not be available as well.
Copy file name to clipboardExpand all lines: content/api_en/include/private.xml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@
9
9
<usage>Web & Application</usage>
10
10
11
11
<description><![CDATA[
12
-
Keyword used to disallow other classes access the fields and methods within a class. The <b>private</b> keyword is used before a field or method that you want to be available only within the class. In Processing, all fields and methods are public unless otherwise specified by the <b>private</b> keyword.<br />
12
+
This keyword is used to disallow other classes access to the fields and methods within a class. The <b>private</b> keyword is used before a field or method that you want to be available only within the class. In Processing, all fields and methods are public unless otherwise specified by the <b>private</b> keyword.<br />
13
13
<br />
14
14
This keyword is an essential part of Java programming and is not usually used with Processing. Consult a Java language reference or tutorial for more information.
Copy file name to clipboardExpand all lines: content/static/tutorials/electronics/index.html
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ <h3>Electricity</h3>
34
34
Electricity is something we use daily, but it is difficult to understand. Its effect is experienced in many ways, from observing a light turn on to noticing the battery charge deplete on a laptop computer.
35
35
<br/>
36
36
<br/>
37
-
Electrical current is a stream of moving electrons. They flow from one point to another through a <em>conductor</em>. Some materials are better conductors than others. Sticking a fork in a light socket is dangerous because metal is a good conductor and so is your body. The best conductors are copper, silver, and gold. A resistor is the opposite of a conductor. Resistance is the capability of a material to resist the flow of electrons. A substance with a very high resistance is an <em>insulator</em>. Plastic and rubber are excellent insulators, and for this reason they are used as the protective covering around wires. Electrical energy, the difference of electrical potential between two points, is called <em>voltage</em>. The amount of electrical energy that flows through a point is the <em>current</em>. Resistance is measured in units called ohms, voltage is measured in volts, and current is measured in amperes (amps). The relation between the three is easiest to understand through an analogy of water flowing through a hose. As explained by the educators Dan O’Sullivan and Tom Igoe:
37
+
Electrical current is a stream of moving electrons. They flow from one point to another through a <em>conductor</em>. Some materials are better conductors than others. Sticking a fork in a light socket is dangerous because metal is a good conductor and so is your body. The best conductors are copper, silver, and gold. A resistor is the opposite of a conductor. Resistance is the capability of a material to resist the flow of electrons. A substance with a very high resistance is an <em>insulator</em>. Plastic and rubber are excellent insulators, and for this reason they are used as the protective covering around wires. Electrical energy, the difference of electrical potential between two points, is called <em>voltage</em>. The amount of electrical charge per second that flows through a point is the <em>current</em>. Resistance is measured in units called ohms, voltage is measured in volts, and current is measured in amperes (amps). The relation between the three is easiest to understand through an analogy of water flowing through a hose. As explained by the educators Dan O’Sullivan and Tom Igoe:
38
38
<br/>
39
39
<br/>
40
40
The flow of water through a hose is like the flow of electricity through a circuit. Turning the faucet increases the amount of water coming through the hose, or increases the current (amps). The diameter of the hose offers resistance to the current, determining how much water can flow. The speed of the water is equivalent to voltage. When you put your thumb over the end of the hose, you reduce the diameter of the pathway of the water. In other words, the resistance goes up. The current (that is, how much water is flowing) doesn’t change, however, so the speed of the water, or voltage, has to go up so that all the water can escape . . . 1
Depending on your country, the AC power coming into your home is between 100 and 240 volts. Most home appliances use AC current to operate, but some use a transformer to convert the higher-potential AC energy into DC current at smaller voltages. The black plastic boxes (a k a power bricks, power adapters, wall warts) that are used to power laptops or mobile phones are transformers. Most desktop computers have an internal power supply with a transformer to convert the AC signal to the 12-volt and 5-volt DC signals necessary to run the internal electronics. Low voltages are generally safer than high voltages, but it’s the amount of current (amps) that makes electricity dangerous.
48
+
Depending on your country, the AC power source coming into your home is between 100 and 240 volts. Most home appliances can directly use AC current to operate, but some use a power supply to convert the higher-potential AC current into DC current at smaller voltages. A common example of this type of power supply are the black plastic boxes (a k a power bricks, power adapters, wall warts) that are used to power laptops or mobile phones from the home AC power source. Most desktop computers have an internal power supply to convert the AC source to the 12-volt and 5-volt DC supply necessary to run the internal electronics. Low voltages are generally safer than high voltages, but it’s the amount of current (amps) that makes electricity dangerous.
49
49
</p>
50
50
<br/>
51
51
<br/>
@@ -64,7 +64,7 @@ <h3>Components</h3>
64
64
<br/>
65
65
<em>Capacitor</em>
66
66
<br/>
67
-
A capacitor stores electrons; it stores electrical charge when current is applied, and it releases charge (discharges) when the current is removed. This can smooth out the dips and spikes in a current signal. Capacitors are combined with resistors to create filters, integrators, differentiators, and oscillators. A simple capacitor is two parallel sheets of conductive materials, separated by an insulator. Capacitors are measured in units called farads. A farad is a large measurement, so most capacitors you will use will be measured in microfarads (µF), picofarads (pF), or nanofarads (nF).
67
+
A capacitor stores electrons i.e. electrical charge; it gains charge when current flows in, and it releases charge (discharges) when the current flows out. This can smooth out the dips and spikes in a current signal. Capacitors are combined with resistors to create filters, integrators, differentiators, and oscillators. A simple capacitor is two parallel sheets of conductive materials, separated by an insulator. Capacitors are measured in units called farads. A farad is a large measurement, so most capacitors you will use will be measured in microfarads (µF), picofarads (pF), or nanofarads (nF).
68
68
<br/>
69
69
<br/>
70
70
<imgsrc="imgs/fg39-4.jpg">
@@ -151,7 +151,7 @@ <h3>Microcontrollers and I/O boards</h3>
151
151
<br/>
152
152
<em>Programmable I/O boards</em>
153
153
<br/>
154
-
A programmable I/O board is a microcontroller situated on a PCB with other components to make it easier to program, attach/detach components, and turn on and off. These boards typically have components to regulate power to protect the microcontroller and a USB or RS-232 serial port to make it easy to attach cables. The small pins on the microcontroller are wired to larger pins called headers, which make it easy to insert and remove sensors and motors. Small wires embedded within the PCB connect pins to a corresponding header. Small reset switches make it easy to restart the power without having to physically detach the power supply or battery.
154
+
A programmable I/O board is a microcontroller situated on a PCB with other components to make it easier to program, attach/detach components, and turn on and off. These boards typically have components to regulate power to protect the microcontroller and a USB or RS-232 serial port connector to make it easy to attach cables for communication. The small pins on the microcontroller are wired to larger pins called headers, which make it easy to insert and remove sensors and motors. Small wires embedded within the PCB connect pins to a corresponding header. Small reset switches make it easy to restart the power without having to physically detach the power supply or battery.
155
155
<br/>
156
156
<br/>
157
157
Within the context of this book, the most relevant I/O boards are Wiring and Arduino. Both were created as tools for designers and artists to build prototypes and to learn about electronics. Both boards use the Wiring language to program their microcontrollers and use a development environment built from the Processing environment. In comparison to the Processing language, the Wiring language provides a similar level of control and ease of use within its domain. They share common language elements when possible, but Wiring has some functions specific to programming microcontrollers and omits the graphics programming functions within Processing. Like Processing programs, Wiring programs are translated into another language before they are run. When a program written with the Wiring language is compiled, it’s first translated into the C/C++ language and then compiled using a C/C++ compiler.
@@ -169,7 +169,7 @@ <h3>Microcontrollers and I/O boards</h3>
169
169
<br/>
170
170
<p>
171
171
<h3>Sensors and communication</h3>
172
-
Physical phenomena are measured by electronic devices called sensors. Different sensors have been invented to acquire data related to touch, force, proximity, light, orientation, sound, temperature, and much more. Sensors can be classified into groups according to the type of signals they produce (analog or digital) and the type of phenomena they measure. Analog signals are continuous, but digital signals are discrete and are constrained to a range of values (e.g., 0 to 255):
172
+
Physical phenomena are measured by electronic devices called sensors. Different sensors have been invented to acquire data related to touch, force, proximity, light, orientation, sound, temperature, and much more. Sensors can be classified into groups according to the type of signals they produce (analog or digital) and the type of phenomena they measure. Analog signals are continuous, but digital signals are constrained to a range of values (e.g., 0 to 255):
@@ -233,12 +233,12 @@ <h3>Sensors and communication</h3>
233
233
<br/>
234
234
<p>
235
235
<h3>Controlling physical media</h3>
236
-
Actuators are devices that act on the physical world. Different types of actuators can create light, motion, heat, and magnetic fields. The digital output pin on a microcontroller can set a voltage of 0 or 5 volts. This value can be used to turn a light or motor on or off, but finer control over brightness and speed requires using a technique called pulse-width modulation (PWM). This is turning a digital output ON and OFF very quickly to simulate values between 0 and 5 volts. If the output is 0 volts for 90% of the time and 5 volts for 10%, this is called a 10% duty cycle. It emulates an analog voltage of 0.5 volts. An 80% duty cycle emulates a 4-volt signal:
236
+
Actuators are devices that act on the physical world. Different types of actuators can create light, motion, heat, and magnetic fields. The digital output pin on a microcontroller can be set to a voltage of 0 or 5 volts. This value can be used to turn a light or motor on or off, but finer control over brightness and speed requires an analog output. By using a digital to analog converter (DAC), a discretized signal can be directly generated as illustrated in the previous figure. If desired, some smoothing can be added to obtain the desired analog signal. When a DAC is not available or not justified in terms of cost or conversion speed, another approach is to use a technique called pulse-width modulation (PWM). This is turning a digital output ON and OFF very quickly to simulate values between 0 and 5 volts. If the output is 0 volts for 90% of the time and 5 volts for 10%, this is called a 10% duty cycle. Following smoothing, it emulates an analog voltage of 0.5 volts. An 80% duty cycle with smoothing emulates a 4-volt signal:
The PWM technique can be used to dim a light, run a motor at a slow speed, and control the frequency of a tone through a speaker.
241
+
The PWM technique can be used to dim a light, run a motor at a slow speed, and control the frequency of a tone through a speaker. In some applications, any necessary smoothing is obtained for free e.g. the inertia in a motor can average out the PWM duty cycle and result in smooth motion.
0 commit comments