Assignment: Buzzer and RGB-LED:

Exercise 1

Write a program for the active 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 and light 8 different colors on the RGB-LED.

hint 1 : When all the RGBs are low, the LED is switched off.
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.

Comments

 
Topic revision: r1 - 15 Nov 2018, UliRaich