Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
B basis
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • m242
  • basis
  • Wiki
  • speaker

speaker · Changes

Page history
stephan.metzler created page: speaker authored Feb 15, 2018 by Stephan Metzler's avatar Stephan Metzler
Hide whitespace changes
Inline Side-by-side
Showing with 54 additions and 0 deletions
+54 -0
  • speaker.md speaker.md +54 -0
  • No files found.
speaker.md 0 → 100644
View page @ 6b1c3d0f
# Ausgangslage
* Ereignisse haben Audio-Effekte
* Bumber, Flips, etc.
# Bedingungen
* sinvolle Datentypen verwenden
# Aufbau
* [Seeeduino V4.2](http://wiki.seeed.cc/Seeeduino_v4.2)
* als [**Arduino UNO**](https://www.arduino.cc/en/Main/Software) programmieren
* **nicht** den "Driver for Seeeduino V4.2" installieren
* Input
* [Wii Nunchuck](http://wiki.seeed.cc/Grove-NunChuck)
* Output
* [Speaker](http://wiki.seeed.cc/Grove-Speaker) für die Audio-Effekte
* als digiteler Output <code>#define SPEAKER 3</code> ansteuerbar
# Handlungsziele
|Vorgehen|Hannok [Handlungsnotwendige Kenntnisse](https://cf.ict-berufsbildung.ch/modules.php?name=Mbk&a=20101&cmodnr=242&noheader=1)|
|:-------|:------|
|unterschiedliche Töne / Frequenzen erzeugen | Array |
|Testbarkeit | Loggen, UART |
# CodeSample
```c
#define SPEAKER 3
int BassTab[] = {1911, 1702, 1516, 1431, 1275, 1136, 1012}; // bass 1~7
void setup() {
pinMode(SPEAKER, OUTPUT);
digitalWrite(SPEAKER, LOW);
}
void loop() {
for (int note_index = 0; note_index < 7; note_index++) {
sound(note_index);
delay(50);
}
}
void sound(uint8_t note_index) {
for (int i = 0; i < 100; i++) {
digitalWrite(SPEAKER, HIGH);
delayMicroseconds(BassTab[note_index]);
digitalWrite(SPEAKER, LOW);
delayMicroseconds(BassTab[note_index]);
}
}
```
Clone repository
  • flipper project
  • Home
  • interrupt
  • lcd
  • led bar
  • led ring
  • led stick
  • nunchuck
  • rfid rc522
  • speaker
  • testen
  • wifi
  • workshops