You are currently viewing לימוד ארדואינו  : שיעור 16 –  מוסיקה ארדואינו ,שימוש ב ()while – קורס c506
לימוד ארדואינו : הפקת תליל מוסיקה ארדואינו

לימוד ארדואינו : שיעור 16 – מוסיקה ארדואינו ,שימוש ב ()while – קורס c506

לימוד ארדואינו : שיעור 16 – מוסיקה ארדואינו ,שימוש ב ()while – קורס c506

השיעור חולק לשני חלקים 16.1 ו 16.2 , בשיעור עושים שימוש באתר wokwi.com לכתיבת תוכנה

 

while()

https://wokwi.com/projects/331297760568410707

 

While עם ערך לוגי TRUE or false

https://wokwi.com/projects/331298355443401299

לימוד ארדואינו - טבלת מעקב WHILE
לימוד ארדואינו – טבלת מעקב WHILE

 

שימוש בפונקציה tone מאפשר לנו ליצור צליל בתדר משתנה ,ובכך ליצור מנגנה במיקרובקר ארדואינו  .

על מנת להפסיק את הצליי נשמתש בפקודה noTone

tone()

Description

Generates a square wave of the specified frequency (and 50% duty cycle) on a pin. A duration can be specified, otherwise the wave continues until a call to noTone(). The pin can be connected to a piezo buzzer or other speaker to play tones.

Only one tone can be generated at a time. If a tone is already playing on a different pin, the call to tone() will have no effect. If the tone is playing on the same pin, the call will set its frequency.

Use of the tone() function will interfere with PWM output on pins 3 and 11 (on boards other than the Mega).

It is not possible to generate tones lower than 31Hz. For technical details, see Brett Hagman’s notes.

Syntax

tone(pin, frequency)
tone(pin, frequency, duration)

דוגמא 1 : הפקת צליל

 

 

דוגמא 2 : ניגון יונתן הקטן ולימוד While

לימוד ארדואינו : הפקת תליל מוסיקה ארדואינו
לימוד ארדואינו : הפקת תליל מוסיקה ארדואינו

 

 

דוגמא 3 : שימוש ב PUSH – מה זה STACK לניגון שיר

 

 

 

סקובץ הסכמה האלקטורני diagram.json


לימוד ארדואינו : סגמה מלאה
לימוד ארדואינו : סגמה מלאה

כתיבת תגובה