Tags:
create new tag
view all tags

Assignment: Buzzer and RGB-LED:

Exercise 1

Write a program for the passive buzzer to buzz using the skeleton below.

define pin number

int main(void){
initialize wiringPi

set pinMode

loop buzzer
{
write High or Low
delay
}

}

Exercise 2

Check the wiringPi software tone library http://wiringpi.com/reference/software-tone-library/ and implement 8 tones on the passive buzzer to light 8 different colors on the RGB-LED.

hint 1 : Assuming when all the RGB are Low, a black light is produced.

R G B
HIGH HIGH HIGH
HIGH HIGH LOW
HIGH LOW HIGH
HIGH LOW LOW
LOW HIGH HIGH
LOW HIGH LOW
LOW LOW HIGH
LOW LOW LOW
hint 2 : You can also implement using the RGB color codes.

-- Isaac Armah-Mensah - 2018-11-15

Comments

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatodt rgb_buzzer.odt r1 manage 15.0 K 2018-11-15 - 09:49 IsaacArmahMensah  
PDFpdf rgb_buzzer.pdf r1 manage 38.9 K 2018-11-15 - 09:49 IsaacArmahMensah  
Topic revision: r1 - 2018-11-15 - IsaacArmahMensah
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback