Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente | |||
lovetape [2018/11/28 07:13] serge [Téléversement via Avrdude et Arduino as ISP] |
lovetape [2018/11/28 07:16] (Version actuelle) serge |
||
---|---|---|---|
Ligne 155: | Ligne 155: | ||
Un petit test (il suffit de branché un haut parleur de 8 Ohms sur la pin 0) | Un petit test (il suffit de branché un haut parleur de 8 Ohms sur la pin 0) | ||
- | + | <code> | |
- | ''%%// 8Step MixTape Example Code%%''\\ | + | // 8Step MixTape Example Code |
- | ''%%// Basic Onliner%%''\\ | + | // Basic Onliner |
- | ''%%// Crazy shit 8-bit symphony generator %%''\\ | + | // Crazy shit 8-bit symphony generator |
- | ''%%/*%%''\\ | + | /* |
- | ''%% * inspired by:%%''\\ | + | * inspired by: |
- | ''%% * %%''[[http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html|''%%http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html%%'']]\\ | + | * [[http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html|http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html]] |
- | ''%% * %%''[[http://countercomplex.blogspot.com.es/2011/10/some-deep-analysis-of-one-line-music.html|''%%http://countercomplex.blogspot.com.es/2011/10/some-deep-analysis-of-one-line-music.html%%'']]\\ | + | * [[http://countercomplex.blogspot.com.es/2011/10/some-deep-analysis-of-one-line-music.html|http://countercomplex.blogspot.com.es/2011/10/some-deep-analysis-of-one-line-music.html]]\\ |
- | ''%% *%%''\\ | + | * |
- | ''%% * try it online:%%''\\ | + | * try it online: |
- | ''%% * %%''[[http://wurstcaptures.untergrund.net/music/|''%%http://wurstcaptures.untergrund.net/music/%%'']]\\ | + | * [[http://wurstcaptures.untergrund.net/music/|http://wurstcaptures.untergrund.net/music/]]\\ |
- | ''%% *%%''\\ | + | * |
- | ''%% */%%''\\ | + | */ |
- | ''%% %%''\\ | + | |
- | ''%%// ATMEL ATTINY85 / ARDUINO%%''\\ | + | // ATMEL ATTINY85 / ARDUINO |
- | ''%%//%%''\\ | + | // |
- | ''%%// +-\/-+%%''\\ | + | // +-\/-+ |
- | ''%%// Reset A0 (D 5) PB5 1| |8 Vcc%%''\\ | + | // Reset A0 (D 5) PB5 1| |8 Vcc |
- | ''%%// A3 (D 3) PB3 2| |7 PB2 (D 2) A1%%''\\ | + | // A3 (D 3) PB3 2| |7 PB2 (D 2) A1 |
- | ''%%// A2 pwm4 (D 4) PB4 3| |6 PB1 (D 1) pwm1%%''\\ | + | // A2 pwm4 (D 4) PB4 3| |6 PB1 (D 1) pwm1 |
- | ''%%// GND 4| |5 PB0 (D 0) pwm0%%''\\ | + | // GND 4| |5 PB0 (D 0) pwm0 |
- | ''%%// +----+ %%''\\ | + | // +----+ |
\\ | \\ | ||
- | ''%%int speakerPin = PB0;%%''\\ | + | int speakerPin = PB0; |
- | ''%%int snd = 0; %%''\\ | + | int snd = 0; |
- | ''%%long t = 0; %%''\\ | + | long t = 0; |
\\ | \\ | ||
- | ''%%void setup () {%%''\\ | + | void setup () { |
- | ''%% pinMode (speakerPin, OUTPUT);%%''\\ | + | pinMode (speakerPin, OUTPUT); |
- | ''%%}%%''\\ | + | } |
- | ''%% %%''\\ | + | |
- | ''%%void loop () { %%''\\ | + | void loop () { |
\\ | \\ | ||
- | ''%% snd = t * ((t>>7|t>>6)*100+4)*(t&7>>13|t>>6);%%''\\ | + | snd = t * ((t>>7|t>>6)*100+4)*(t&7>>13|t>>6); |
- | ''%% digitalWrite (speakerPin, snd);%%''\\ | + | digitalWrite (speakerPin, snd); |
- | ''%% %%''\\ | + | |
- | ''%% t++;%%''\\ | + | t++; |
- | ''%% %%''\\ | + | |
- | ''%%}%%'' | + | } |
+ | </code> | ||
==== Plein d'exemples de jolies chansons ==== | ==== Plein d'exemples de jolies chansons ==== |