* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Work Sheet
Regenerative circuit wikipedia , lookup
Wien bridge oscillator wikipedia , lookup
Operational amplifier wikipedia , lookup
Power electronics wikipedia , lookup
Index of electronics articles wikipedia , lookup
Time-to-digital converter wikipedia , lookup
Josephson voltage standard wikipedia , lookup
Schmitt trigger wikipedia , lookup
Current source wikipedia , lookup
Switched-mode power supply wikipedia , lookup
RLC circuit wikipedia , lookup
Voltage regulator wikipedia , lookup
Power MOSFET wikipedia , lookup
Current mirror wikipedia , lookup
Trionic T5.5 wikipedia , lookup
Resistive opto-isolator wikipedia , lookup
Immunity-aware programming wikipedia , lookup
Surge protector wikipedia , lookup
Rectiverter wikipedia , lookup
NASA-Threads Electricity and Magnetism Lesson 18: Definitions & Review Definitions and Examples At this point you have already had your first quiz, and you are hopefully getting more comfortable with most of the terms and the language used on your BOE-bot. Here is a quick review of all the terms you have used so far. Some of this is borrowed from Wikipedia and Parallax Inc. Listing of Common PBasic Commands Command Description ' comment An apostrophe at the beginning of a line means that what follows is a comment, meant to aid readability and understanding for humans. ' {$STAMP BS2} ' {$PBASIC 2.5} An exception to the apostrophe-means-comment rule. These are "compiler directives" that tell the PBASIC editor what kind of Stamp microcontroller you're using, and what version of the PBASIC language the program is written in. These are required at the beginning of every program. DEBUG "text" {,CR} DEBUG DEC variablename DEBUG ? variablename Sends text to the PBASIC editor "Debug Terminal" (window), to aid you in finding problems and fixing a program (debugging). The optional CR (carriage return) causes the start of a new line in the Debug Terminal. END Marks the end of the program; stops execution. PAUSE delay Causes the program to wait delay milliseconds. DO...LOOP Causes all the program lines between the DO and LOOP to repeat forever. HIGH pin Makes pin pin to be set to high, or 5 volts. LOW pin Makes pin pin to be set to low, or 0 volts. PULSOUT pin, duration Sends a HIGH pulse on pin pin. The duration of the high pulse is duration times 2 microseconds. variablename VAR variablesize Creates a varable called variablename with size variablesize --- bit, nib (for nibble), byte, or NASA-Threads Electricity and Magnetism Lesson 18: Definitions & Review word. variablename = value The equals sign here is not a statement of equality, as it is usually used in math. Instead, it is an operator -- it stores the value value into the variable variablename. * Multiplication operator FOR counter = start TO end {STEP stepsize}...NEXT Repeats all the lines of code between the FOR and the NEXT. The first time through, the variablecounter has the value start. The next time through counter has the value start+stepsize. This repeats until the value of counter reaches end. If the STEP is left out, stepsize defaults to 1. FREQOUT pin, duration, frequency {, anotherfreq} Sends an alternating high-low pulse train on pin pin, for duration milliseconds, with frequency given in Hertz. This can be used to drive a speaker, making a musical tone. Optionally, a second tone can be generated simultaneously. DEBUGIN DEC variablename Allows a user to type a decimal value into a running program from the PBASIC editor over the serial cable, and that value is stored in the variable variablename. Useful for testing programs. GOSUB subroutinename Jumps the program to the start of a subroutine subroutinename: The start of a subroutine is marked by the subroutine's name (whatever you choose it to be) followed by a colon (:). RETURN This marks the end of a subroutine. When this statement is reached, the program continues with the line immediately after the GOSUB that launched the subroutine. DATA Stores data on the EEPROM chip on the BASIC Stamp. NASA-Threads Electricity and Magnetism Lesson 18: Definitions & Review READ Retrieves data from the EEPROM chip on the BASIC Stamp. SELECT...CASE...ENDSELECT DO WHILE condition ...LOOP Execute (run) a series of instructions (where the ... is) as long as the condition is true. Once the condition is violated (false), execution continues on the line after LOOP. DO...LOOP UNTIL condition Execute (run) a series of instructions (where the ... is) until the condition is true. Once the condition is true, execution continues with the next command. Source: Anything in a circuit that provides a positive voltage value, such as a battery Load: Anything in a circuit that provides a negative voltage value, that is, it takes voltage away from the circuit. These include LED’s, light bulbs, etc. Voltage: The electrical potential difference across an element of a circuit, represented V. V=J/C, where J is joules and C is coulombs. Note: A joule is merely the amount of work done. Current: Represented I, measured in amps, also measured in series in a circuit unlike voltage which is measured in parallel (across a circuit). A=C/sec, that is, amps = amount of coulombs moved per second. LED: Light emitting diode. Simply put, this is a small light bulb. Resistor: a two-terminal electronic component that produces a voltage across its terminals that is proportional to the electric current through it in accordance with Ohm's law NASA-Threads Electricity and Magnetism Lesson 18: Definitions & Review Coulomb: Represented C. One Coulomb = 6.24*1018 electrons Kirchhoff’s Voltage Law: The sum of the voltages in a loop must always equal zero. In the above figure, according to KVL the sum of the voltages v1+v2+v3+v4=0. Ohm’s Law: the current through a conductor between two points is directly proportional to the potential difference or voltage across the two points, and inversely proportional to the resistance between them. That is I=V/R or V=IR or R=V/I.