SlideShare a Scribd company logo
1 of 5
Download to read offline
Final Hack Writeup
Project Name: Popsicle-stick Vibrating
Hopper Robot (with band pass filters)
Authors: Yanbo Yao, Chunming Lin
Description
Two motors will move and cause the robot to bounce, when there is a sound
with the frequency above 600 Hz. When the motors move, the yellow LED
will also light up. The red and green LEDs are controlled by the right and left
photocells. The code inside the MSP430 combines the functions of the
photocells and LEDs. For example, when the photocells are on, the LEDs turn
on.
Materials
• Capacitors: one 1uF
• Resistors: two 200 ohm, two 51K ohm, one 100 ohm, two 330 ohm
• LEDs: one yellow, one red, one green
• Op Amp: LMC6484
• Two Bread Board
Instructions
1. Build a High Pass Filter Circuit.
2. Build two LEDs Circuits (Build separately with all the other circuits).
3. Build a LED circuit, which is parallel with the right motor.
4. Write a code, which tells the motors to move when there is a sound, also,
the code turns on the LED when the there is a light above the photocell, and
turns off the LED, when there is no light.
Documentation
Code
#include <msp430.h>
#define LMOTOR BIT3
#define RMOTOR BIT4
#define LPHOTO BIT2
#define RPHOTO BIT7
#define LLED BIT0
#define RLED BIT6
void pwm_pulse(unsigned int ms, unsigned int pins);
int main(void) {
WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
// Set conversion to single channel and continuous-sampling mode
//ADC10CTL1 |= CONSEQ1;
ADC10CTL1 = INCH_5 + ADC10DIV_3; // Channel 5, ADC10CLK/4
ADC10CTL0 = SREF_0 + ADC10SHT_3 + ADC10ON + ADC10IE;
//Choose P1.0 (channel 5) as an analog input pin:
ADC10AE0 |= BIT5;
BCSCTL1 = CALBC1_1MHZ; // Set range
DCOCTL = CALDCO_1MHZ;
BCSCTL2 &= ~(DIVS_3); // SMCLK = DCO = 1MHz
P1SEL |= BIT5;
P1DIR |= (BIT1 + LLED + RLED + LMOTOR + RMOTOR); // set P1.1 and
LEDs as output
P1DIR &= ~(LPHOTO + RPHOTO); // set these bits to inputs
P1REN |= (LPHOTO + RPHOTO); // enable pull up resistors
for ( ; ; )
{
ADC10CTL0 |= ENC + ADC10SC;
//pulse motor if the digitized level is high enough
if (ADC10MEM >= 530) // 2 5K omh
{
pwm_pulse(5000, LMOTOR);
pwm_pulse(5000, RMOTOR);
}
else
{
P1OUT &= ~LMOTOR;
P1OUT &= ~RMOTOR;
}
//turn off the LEFT LED if left photocell is covered by hand.
if (P1IN & LPHOTO)
P1OUT |= LLED;
else
P1OUT &= ~LLED;
//turn off the RIGHT LED if right photocell is covered by hand.
if (P1IN & RPHOTO)
P1OUT |= RLED;
else
P1OUT &= ~RLED;
}
return 0;
}
void pwm_pulse(unsigned int ms, unsigned int pins) //pulse on for ms
number of miliseconds
{
unsigned int i;
for (i=0;i<ms/10;i++)
{
//Complete this loop to make the motors pulse on 80% of the time and off
20% of the time!
P1OUT |= (pins); //set buzzer pin
}
}

More Related Content

What's hot

Ad vlsi pass-transistor logic_yalagoud_patil
Ad vlsi pass-transistor logic_yalagoud_patilAd vlsi pass-transistor logic_yalagoud_patil
Ad vlsi pass-transistor logic_yalagoud_patilYalagoud Patil
 
Low Power CMOS Analog Multiplier
Low Power CMOS Analog MultiplierLow Power CMOS Analog Multiplier
Low Power CMOS Analog MultiplierIJERA Editor
 
Power elecronics lab manual1
Power elecronics lab manual1Power elecronics lab manual1
Power elecronics lab manual1aroulk
 
The Revolution from Transistor to Digital Electronics
The Revolution from Transistor to Digital ElectronicsThe Revolution from Transistor to Digital Electronics
The Revolution from Transistor to Digital ElectronicsSubhajit Bhattacharjee
 
Day2 Logic Circuits
Day2 Logic CircuitsDay2 Logic Circuits
Day2 Logic CircuitsRon Liu
 
Unit no. 5 cmos logic design
Unit no. 5 cmos logic designUnit no. 5 cmos logic design
Unit no. 5 cmos logic designswagatkarve
 
Lec4 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMOS
Lec4 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMOSLec4 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMOS
Lec4 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMOSHsien-Hsin Sean Lee, Ph.D.
 
Linear Integrated Circuits and Its Applications Unit-V Special ICs
Linear Integrated Circuits and Its Applications Unit-V Special ICsLinear Integrated Circuits and Its Applications Unit-V Special ICs
Linear Integrated Circuits and Its Applications Unit-V Special ICsSatheeshCS2
 
Unit-V Special ICs
Unit-V Special ICsUnit-V Special ICs
Unit-V Special ICsDr.Raja R
 

What's hot (19)

Ad vlsi pass-transistor logic_yalagoud_patil
Ad vlsi pass-transistor logic_yalagoud_patilAd vlsi pass-transistor logic_yalagoud_patil
Ad vlsi pass-transistor logic_yalagoud_patil
 
Pass Transistor Logic
Pass Transistor LogicPass Transistor Logic
Pass Transistor Logic
 
GATE TURN OFF THYRISTOR
GATE TURN OFF THYRISTORGATE TURN OFF THYRISTOR
GATE TURN OFF THYRISTOR
 
Dynamic logic circuits
Dynamic logic circuitsDynamic logic circuits
Dynamic logic circuits
 
Low Power CMOS Analog Multiplier
Low Power CMOS Analog MultiplierLow Power CMOS Analog Multiplier
Low Power CMOS Analog Multiplier
 
Power elecronics lab manual1
Power elecronics lab manual1Power elecronics lab manual1
Power elecronics lab manual1
 
The Revolution from Transistor to Digital Electronics
The Revolution from Transistor to Digital ElectronicsThe Revolution from Transistor to Digital Electronics
The Revolution from Transistor to Digital Electronics
 
CMOS LOGIC STRUCTURES
CMOS LOGIC STRUCTURESCMOS LOGIC STRUCTURES
CMOS LOGIC STRUCTURES
 
Day2 Logic Circuits
Day2 Logic CircuitsDay2 Logic Circuits
Day2 Logic Circuits
 
Non ideal effects of pll
Non ideal effects of pllNon ideal effects of pll
Non ideal effects of pll
 
Unit no. 5 cmos logic design
Unit no. 5 cmos logic designUnit no. 5 cmos logic design
Unit no. 5 cmos logic design
 
CMOS TG
CMOS TGCMOS TG
CMOS TG
 
Dynamic&p t-logic
Dynamic&p t-logicDynamic&p t-logic
Dynamic&p t-logic
 
CMOS
CMOS CMOS
CMOS
 
Lec4 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMOS
Lec4 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMOSLec4 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMOS
Lec4 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- CMOS
 
Linear Integrated Circuits and Its Applications Unit-V Special ICs
Linear Integrated Circuits and Its Applications Unit-V Special ICsLinear Integrated Circuits and Its Applications Unit-V Special ICs
Linear Integrated Circuits and Its Applications Unit-V Special ICs
 
Unit-V Special ICs
Unit-V Special ICsUnit-V Special ICs
Unit-V Special ICs
 
Multivibrators
MultivibratorsMultivibrators
Multivibrators
 
igbt and its characteristics
igbt and its characteristicsigbt and its characteristics
igbt and its characteristics
 

Viewers also liked

HUDA Affordable Housing,Easy in Homes by Tulsiani, Sohna Road Gurgaon
HUDA Affordable Housing,Easy in Homes by Tulsiani, Sohna Road GurgaonHUDA Affordable Housing,Easy in Homes by Tulsiani, Sohna Road Gurgaon
HUDA Affordable Housing,Easy in Homes by Tulsiani, Sohna Road Gurgaonqnetrex
 
Millist puidukuivatit vajab eesti puidutööstus
Millist puidukuivatit vajab eesti puidutööstusMillist puidukuivatit vajab eesti puidutööstus
Millist puidukuivatit vajab eesti puidutööstusTsenter
 
Segiempat1
Segiempat1Segiempat1
Segiempat1kiuntoro
 
Educación del siglo XXI
Educación del siglo XXIEducación del siglo XXI
Educación del siglo XXIravaprende
 
PhD_TimothyGalle_public
PhD_TimothyGalle_publicPhD_TimothyGalle_public
PhD_TimothyGalle_publicTimothy Galle
 
Aprender con Tecnologías.Estrategias de Abordaje
Aprender con Tecnologías.Estrategias de AbordajeAprender con Tecnologías.Estrategias de Abordaje
Aprender con Tecnologías.Estrategias de AbordajeStella Maris Massa
 
The effect of sentence splitting on cohesion in German business translations
The effect of sentence splitting on cohesion in German business translationsThe effect of sentence splitting on cohesion in German business translations
The effect of sentence splitting on cohesion in German business translationsMario Bisiada
 
Business Plan for Persuasive & Analytical Writing
Business Plan for Persuasive & Analytical WritingBusiness Plan for Persuasive & Analytical Writing
Business Plan for Persuasive & Analytical WritingMuhammad Riaz
 
Lampu(kreatifitas)
Lampu(kreatifitas)Lampu(kreatifitas)
Lampu(kreatifitas)kiuntoro
 
Grafikbatang
GrafikbatangGrafikbatang
Grafikbatangkiuntoro
 
Vesco construction buklet
Vesco construction bukletVesco construction buklet
Vesco construction bukletozagorode
 
Presentación yetsy extincion obligacion tributaria.
Presentación yetsy extincion obligacion tributaria.Presentación yetsy extincion obligacion tributaria.
Presentación yetsy extincion obligacion tributaria.yetsycardenas
 

Viewers also liked (20)

Human Heart and its function
Human Heart and its functionHuman Heart and its function
Human Heart and its function
 
HUDA Affordable Housing,Easy in Homes by Tulsiani, Sohna Road Gurgaon
HUDA Affordable Housing,Easy in Homes by Tulsiani, Sohna Road GurgaonHUDA Affordable Housing,Easy in Homes by Tulsiani, Sohna Road Gurgaon
HUDA Affordable Housing,Easy in Homes by Tulsiani, Sohna Road Gurgaon
 
Millist puidukuivatit vajab eesti puidutööstus
Millist puidukuivatit vajab eesti puidutööstusMillist puidukuivatit vajab eesti puidutööstus
Millist puidukuivatit vajab eesti puidutööstus
 
Presentation
PresentationPresentation
Presentation
 
Segiempat1
Segiempat1Segiempat1
Segiempat1
 
AAL
AALAAL
AAL
 
Internship Cover
Internship CoverInternship Cover
Internship Cover
 
Educación del siglo XXI
Educación del siglo XXIEducación del siglo XXI
Educación del siglo XXI
 
PhD_TimothyGalle_public
PhD_TimothyGalle_publicPhD_TimothyGalle_public
PhD_TimothyGalle_public
 
Aprender con Tecnologías.Estrategias de Abordaje
Aprender con Tecnologías.Estrategias de AbordajeAprender con Tecnologías.Estrategias de Abordaje
Aprender con Tecnologías.Estrategias de Abordaje
 
The effect of sentence splitting on cohesion in German business translations
The effect of sentence splitting on cohesion in German business translationsThe effect of sentence splitting on cohesion in German business translations
The effect of sentence splitting on cohesion in German business translations
 
Business Plan for Persuasive & Analytical Writing
Business Plan for Persuasive & Analytical WritingBusiness Plan for Persuasive & Analytical Writing
Business Plan for Persuasive & Analytical Writing
 
Lampu(kreatifitas)
Lampu(kreatifitas)Lampu(kreatifitas)
Lampu(kreatifitas)
 
Grafikbatang
GrafikbatangGrafikbatang
Grafikbatang
 
Vesco construction buklet
Vesco construction bukletVesco construction buklet
Vesco construction buklet
 
Myline1
Myline1Myline1
Myline1
 
Oval
OvalOval
Oval
 
prezi
preziprezi
prezi
 
Presentación yetsy extincion obligacion tributaria.
Presentación yetsy extincion obligacion tributaria.Presentación yetsy extincion obligacion tributaria.
Presentación yetsy extincion obligacion tributaria.
 
NewOak_Residential_Brochure_January_2017
NewOak_Residential_Brochure_January_2017NewOak_Residential_Brochure_January_2017
NewOak_Residential_Brochure_January_2017
 

Similar to EE40_Final_Hack_Writeup

Assembly programming II
Assembly programming IIAssembly programming II
Assembly programming IIOmar Sanchez
 
Assembly programming II
Assembly programming IIAssembly programming II
Assembly programming IIOmar Sanchez
 
Assembly programming II
Assembly programming IIAssembly programming II
Assembly programming IIOmar Sanchez
 
BlueOptics Bo66hxx640d 2-4-8gbase-cwdm xfp transceiver 1471nm - 1611nm 40km s...
BlueOptics Bo66hxx640d 2-4-8gbase-cwdm xfp transceiver 1471nm - 1611nm 40km s...BlueOptics Bo66hxx640d 2-4-8gbase-cwdm xfp transceiver 1471nm - 1611nm 40km s...
BlueOptics Bo66hxx640d 2-4-8gbase-cwdm xfp transceiver 1471nm - 1611nm 40km s...CBO GmbH
 
BlueOptics Bo66hxx640d 2-4-8gbase-cwdm xfp transceiver 1471nm - 1611nm 40km s...
BlueOptics Bo66hxx640d 2-4-8gbase-cwdm xfp transceiver 1471nm - 1611nm 40km s...BlueOptics Bo66hxx640d 2-4-8gbase-cwdm xfp transceiver 1471nm - 1611nm 40km s...
BlueOptics Bo66hxx640d 2-4-8gbase-cwdm xfp transceiver 1471nm - 1611nm 40km s...CBO GmbH
 
Automatic doorbell with object detection
Automatic doorbell with object detectionAutomatic doorbell with object detection
Automatic doorbell with object detectionAnurag Alaria
 
BlueOptics Bo31j15640d 10gbase-er xfp transceiver 1550nm 40km singlemode lc d...
BlueOptics Bo31j15640d 10gbase-er xfp transceiver 1550nm 40km singlemode lc d...BlueOptics Bo31j15640d 10gbase-er xfp transceiver 1550nm 40km singlemode lc d...
BlueOptics Bo31j15640d 10gbase-er xfp transceiver 1550nm 40km singlemode lc d...CBO GmbH
 
BlueOptics Bo66hxx680d 2-4-8gbase-cwdm xfp transceiver 1471nm - 1611nm 80km s...
BlueOptics Bo66hxx680d 2-4-8gbase-cwdm xfp transceiver 1471nm - 1611nm 80km s...BlueOptics Bo66hxx680d 2-4-8gbase-cwdm xfp transceiver 1471nm - 1611nm 80km s...
BlueOptics Bo66hxx680d 2-4-8gbase-cwdm xfp transceiver 1471nm - 1611nm 80km s...CBO GmbH
 
Bluetooth based home appliances control
Bluetooth based home appliances controlBluetooth based home appliances control
Bluetooth based home appliances controlPROJECTRONICS
 
BlueOptics Bo33j13220d 10gbase-lr xenpak transceiver 1310nm 20 kilometer sing...
BlueOptics Bo33j13220d 10gbase-lr xenpak transceiver 1310nm 20 kilometer sing...BlueOptics Bo33j13220d 10gbase-lr xenpak transceiver 1310nm 20 kilometer sing...
BlueOptics Bo33j13220d 10gbase-lr xenpak transceiver 1310nm 20 kilometer sing...CBO GmbH
 
BlueOptics Bo31h13610d 2-4-8gbase-lw xfp transceiver 1310nm 10km singlemode l...
BlueOptics Bo31h13610d 2-4-8gbase-lw xfp transceiver 1310nm 10km singlemode l...BlueOptics Bo31h13610d 2-4-8gbase-lw xfp transceiver 1310nm 10km singlemode l...
BlueOptics Bo31h13610d 2-4-8gbase-lw xfp transceiver 1310nm 10km singlemode l...CBO GmbH
 
Audio led bargraph equalizer
Audio led bargraph equalizerAudio led bargraph equalizer
Audio led bargraph equalizerdouglaslyon
 
BlueOptics Bo65j27640d 10gbase-bx-u xfp transceiver tx1270nm-rx1330nm 40 km s...
BlueOptics Bo65j27640d 10gbase-bx-u xfp transceiver tx1270nm-rx1330nm 40 km s...BlueOptics Bo65j27640d 10gbase-bx-u xfp transceiver tx1270nm-rx1330nm 40 km s...
BlueOptics Bo65j27640d 10gbase-bx-u xfp transceiver tx1270nm-rx1330nm 40 km s...CBO GmbH
 
BlueOptics Bo65 j33640d 10gbase-bx-d xfp transceiver tx1330nm-rx1270nm 40 km ...
BlueOptics Bo65 j33640d 10gbase-bx-d xfp transceiver tx1330nm-rx1270nm 40 km ...BlueOptics Bo65 j33640d 10gbase-bx-d xfp transceiver tx1330nm-rx1270nm 40 km ...
BlueOptics Bo65 j33640d 10gbase-bx-d xfp transceiver tx1330nm-rx1270nm 40 km ...CBO GmbH
 
BlueOptics Bo65j27660d 10gbase-bx-u xfp transceiver tx1270nm-rx1330nm 60 km s...
BlueOptics Bo65j27660d 10gbase-bx-u xfp transceiver tx1270nm-rx1330nm 60 km s...BlueOptics Bo65j27660d 10gbase-bx-u xfp transceiver tx1270nm-rx1330nm 60 km s...
BlueOptics Bo65j27660d 10gbase-bx-u xfp transceiver tx1270nm-rx1330nm 60 km s...CBO GmbH
 
BlueOptics Bo31j15680d 10gbase-zr xfp transceiver 1550nm 80km singlemode lc d...
BlueOptics Bo31j15680d 10gbase-zr xfp transceiver 1550nm 80km singlemode lc d...BlueOptics Bo31j15680d 10gbase-zr xfp transceiver 1550nm 80km singlemode lc d...
BlueOptics Bo31j15680d 10gbase-zr xfp transceiver 1550nm 80km singlemode lc d...CBO GmbH
 
BlueOptics Bo65j33660d 10gbase-bx-d xfp transceiver tx1330nm-rx1270nm 60 km s...
BlueOptics Bo65j33660d 10gbase-bx-d xfp transceiver tx1330nm-rx1270nm 60 km s...BlueOptics Bo65j33660d 10gbase-bx-d xfp transceiver tx1330nm-rx1270nm 60 km s...
BlueOptics Bo65j33660d 10gbase-bx-d xfp transceiver tx1330nm-rx1270nm 60 km s...CBO GmbH
 

Similar to EE40_Final_Hack_Writeup (20)

Speed control of motor
Speed control of motorSpeed control of motor
Speed control of motor
 
Assembly programming II
Assembly programming IIAssembly programming II
Assembly programming II
 
Assembly programming II
Assembly programming IIAssembly programming II
Assembly programming II
 
Assembly programming II
Assembly programming IIAssembly programming II
Assembly programming II
 
BlueOptics Bo66hxx640d 2-4-8gbase-cwdm xfp transceiver 1471nm - 1611nm 40km s...
BlueOptics Bo66hxx640d 2-4-8gbase-cwdm xfp transceiver 1471nm - 1611nm 40km s...BlueOptics Bo66hxx640d 2-4-8gbase-cwdm xfp transceiver 1471nm - 1611nm 40km s...
BlueOptics Bo66hxx640d 2-4-8gbase-cwdm xfp transceiver 1471nm - 1611nm 40km s...
 
BlueOptics Bo66hxx640d 2-4-8gbase-cwdm xfp transceiver 1471nm - 1611nm 40km s...
BlueOptics Bo66hxx640d 2-4-8gbase-cwdm xfp transceiver 1471nm - 1611nm 40km s...BlueOptics Bo66hxx640d 2-4-8gbase-cwdm xfp transceiver 1471nm - 1611nm 40km s...
BlueOptics Bo66hxx640d 2-4-8gbase-cwdm xfp transceiver 1471nm - 1611nm 40km s...
 
Automatic doorbell with object detection
Automatic doorbell with object detectionAutomatic doorbell with object detection
Automatic doorbell with object detection
 
BlueOptics Bo31j15640d 10gbase-er xfp transceiver 1550nm 40km singlemode lc d...
BlueOptics Bo31j15640d 10gbase-er xfp transceiver 1550nm 40km singlemode lc d...BlueOptics Bo31j15640d 10gbase-er xfp transceiver 1550nm 40km singlemode lc d...
BlueOptics Bo31j15640d 10gbase-er xfp transceiver 1550nm 40km singlemode lc d...
 
BlueOptics Bo66hxx680d 2-4-8gbase-cwdm xfp transceiver 1471nm - 1611nm 80km s...
BlueOptics Bo66hxx680d 2-4-8gbase-cwdm xfp transceiver 1471nm - 1611nm 80km s...BlueOptics Bo66hxx680d 2-4-8gbase-cwdm xfp transceiver 1471nm - 1611nm 80km s...
BlueOptics Bo66hxx680d 2-4-8gbase-cwdm xfp transceiver 1471nm - 1611nm 80km s...
 
Bluetooth based home appliances control
Bluetooth based home appliances controlBluetooth based home appliances control
Bluetooth based home appliances control
 
JamesEndl
JamesEndlJamesEndl
JamesEndl
 
BlueOptics Bo33j13220d 10gbase-lr xenpak transceiver 1310nm 20 kilometer sing...
BlueOptics Bo33j13220d 10gbase-lr xenpak transceiver 1310nm 20 kilometer sing...BlueOptics Bo33j13220d 10gbase-lr xenpak transceiver 1310nm 20 kilometer sing...
BlueOptics Bo33j13220d 10gbase-lr xenpak transceiver 1310nm 20 kilometer sing...
 
BlueOptics Bo31h13610d 2-4-8gbase-lw xfp transceiver 1310nm 10km singlemode l...
BlueOptics Bo31h13610d 2-4-8gbase-lw xfp transceiver 1310nm 10km singlemode l...BlueOptics Bo31h13610d 2-4-8gbase-lw xfp transceiver 1310nm 10km singlemode l...
BlueOptics Bo31h13610d 2-4-8gbase-lw xfp transceiver 1310nm 10km singlemode l...
 
Audio led bargraph equalizer
Audio led bargraph equalizerAudio led bargraph equalizer
Audio led bargraph equalizer
 
BlueOptics Bo65j27640d 10gbase-bx-u xfp transceiver tx1270nm-rx1330nm 40 km s...
BlueOptics Bo65j27640d 10gbase-bx-u xfp transceiver tx1270nm-rx1330nm 40 km s...BlueOptics Bo65j27640d 10gbase-bx-u xfp transceiver tx1270nm-rx1330nm 40 km s...
BlueOptics Bo65j27640d 10gbase-bx-u xfp transceiver tx1270nm-rx1330nm 40 km s...
 
BlueOptics Bo65 j33640d 10gbase-bx-d xfp transceiver tx1330nm-rx1270nm 40 km ...
BlueOptics Bo65 j33640d 10gbase-bx-d xfp transceiver tx1330nm-rx1270nm 40 km ...BlueOptics Bo65 j33640d 10gbase-bx-d xfp transceiver tx1330nm-rx1270nm 40 km ...
BlueOptics Bo65 j33640d 10gbase-bx-d xfp transceiver tx1330nm-rx1270nm 40 km ...
 
Introduction to PIC.pptx
Introduction to PIC.pptxIntroduction to PIC.pptx
Introduction to PIC.pptx
 
BlueOptics Bo65j27660d 10gbase-bx-u xfp transceiver tx1270nm-rx1330nm 60 km s...
BlueOptics Bo65j27660d 10gbase-bx-u xfp transceiver tx1270nm-rx1330nm 60 km s...BlueOptics Bo65j27660d 10gbase-bx-u xfp transceiver tx1270nm-rx1330nm 60 km s...
BlueOptics Bo65j27660d 10gbase-bx-u xfp transceiver tx1270nm-rx1330nm 60 km s...
 
BlueOptics Bo31j15680d 10gbase-zr xfp transceiver 1550nm 80km singlemode lc d...
BlueOptics Bo31j15680d 10gbase-zr xfp transceiver 1550nm 80km singlemode lc d...BlueOptics Bo31j15680d 10gbase-zr xfp transceiver 1550nm 80km singlemode lc d...
BlueOptics Bo31j15680d 10gbase-zr xfp transceiver 1550nm 80km singlemode lc d...
 
BlueOptics Bo65j33660d 10gbase-bx-d xfp transceiver tx1330nm-rx1270nm 60 km s...
BlueOptics Bo65j33660d 10gbase-bx-d xfp transceiver tx1330nm-rx1270nm 60 km s...BlueOptics Bo65j33660d 10gbase-bx-d xfp transceiver tx1330nm-rx1270nm 60 km s...
BlueOptics Bo65j33660d 10gbase-bx-d xfp transceiver tx1330nm-rx1270nm 60 km s...
 

EE40_Final_Hack_Writeup

  • 1. Final Hack Writeup Project Name: Popsicle-stick Vibrating Hopper Robot (with band pass filters) Authors: Yanbo Yao, Chunming Lin Description Two motors will move and cause the robot to bounce, when there is a sound with the frequency above 600 Hz. When the motors move, the yellow LED will also light up. The red and green LEDs are controlled by the right and left photocells. The code inside the MSP430 combines the functions of the photocells and LEDs. For example, when the photocells are on, the LEDs turn on. Materials • Capacitors: one 1uF • Resistors: two 200 ohm, two 51K ohm, one 100 ohm, two 330 ohm • LEDs: one yellow, one red, one green • Op Amp: LMC6484 • Two Bread Board Instructions 1. Build a High Pass Filter Circuit.
  • 2. 2. Build two LEDs Circuits (Build separately with all the other circuits). 3. Build a LED circuit, which is parallel with the right motor. 4. Write a code, which tells the motors to move when there is a sound, also, the code turns on the LED when the there is a light above the photocell, and turns off the LED, when there is no light. Documentation
  • 3. Code #include <msp430.h> #define LMOTOR BIT3 #define RMOTOR BIT4 #define LPHOTO BIT2 #define RPHOTO BIT7 #define LLED BIT0 #define RLED BIT6 void pwm_pulse(unsigned int ms, unsigned int pins); int main(void) { WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer // Set conversion to single channel and continuous-sampling mode //ADC10CTL1 |= CONSEQ1; ADC10CTL1 = INCH_5 + ADC10DIV_3; // Channel 5, ADC10CLK/4 ADC10CTL0 = SREF_0 + ADC10SHT_3 + ADC10ON + ADC10IE;
  • 4. //Choose P1.0 (channel 5) as an analog input pin: ADC10AE0 |= BIT5; BCSCTL1 = CALBC1_1MHZ; // Set range DCOCTL = CALDCO_1MHZ; BCSCTL2 &= ~(DIVS_3); // SMCLK = DCO = 1MHz P1SEL |= BIT5; P1DIR |= (BIT1 + LLED + RLED + LMOTOR + RMOTOR); // set P1.1 and LEDs as output P1DIR &= ~(LPHOTO + RPHOTO); // set these bits to inputs P1REN |= (LPHOTO + RPHOTO); // enable pull up resistors for ( ; ; ) { ADC10CTL0 |= ENC + ADC10SC; //pulse motor if the digitized level is high enough if (ADC10MEM >= 530) // 2 5K omh { pwm_pulse(5000, LMOTOR); pwm_pulse(5000, RMOTOR); } else { P1OUT &= ~LMOTOR; P1OUT &= ~RMOTOR; } //turn off the LEFT LED if left photocell is covered by hand. if (P1IN & LPHOTO) P1OUT |= LLED; else P1OUT &= ~LLED; //turn off the RIGHT LED if right photocell is covered by hand. if (P1IN & RPHOTO) P1OUT |= RLED; else
  • 5. P1OUT &= ~RLED; } return 0; } void pwm_pulse(unsigned int ms, unsigned int pins) //pulse on for ms number of miliseconds { unsigned int i; for (i=0;i<ms/10;i++) { //Complete this loop to make the motors pulse on 80% of the time and off 20% of the time! P1OUT |= (pins); //set buzzer pin } }