Per il momento sto testando il seguente codice:
[code][font size=-1] #include <avr/io.h> #include < avr/interrupt.h > #include < avr/pgmspace.h >
volatile int Indice = 0;
prog_char onda[251] PROGMEM = {0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 99, 104, 109, 114, 119, 124, 128, 133, 138, 143, 147, 152, 157, 161, 166, 170, 175, 179, 184, 188, 193, 197, 201, 206, 210, 214, 219, 223, 227, 231, 235, 239, 243, 247, 251, 255, 259, 263, 266, 270, 274, 277, 281, 285, 288, 292, 295, 298, 302, 305, 308, 311, 315, 318, 321, 324, 327, 329, 332, 335, 338, 340, 343, 346, 348, 351, 353, 355, 358, 360, 362, 364, 366, 368, 370, 372, 374, 375, 377, 379, 380, 382, 383, 385, 386, 387, 389, 390, 391, 392, 393, 394, 395, 395, 396, 397, 397, 398, 398, 399, 399, 399, 400, 400, 400, 400, 400, 400, 400, 399, 399, 399, 398, 398, 397, 397, 396, 395, 395, 394, 393, 392, 391, 390, 389, 387, 386, 385, 383, 382, 380, 379, 377, 375, 374, 372, 370, 368, 366, 364, 362, 360, 358, 355, 353, 351, 348, 346, 343, 340, 338, 335, 332, 329, 327, 324, 321, 318, 315, 311, 308, 305, 302, 298, 295, 292, 288, 285, 281, 277, 274, 270, 266, 263, 259, 255, 251, 247, 243, 239, 235, 231, 227, 223, 219, 214, 210, 206, 201, 197, 193, 188, 184, 179, 175, 170, 166, 161, 157, 152, 147, 143, 138, 133, 128, 124, 119, 114, 109, 104, 99, 95, 90, 85, 80, 75, 70, 65, 60, 55, 50, 45, 40, 35, 30, 25, 20, 15, 10, 5, 0};
void setup() {
pinMode(9, OUTPUT); pinMode(10, OUTPUT); ICR1 = 640; // Setto il periodo a 40 µS (con Fck 16,0 Mhz, Prescaler 1)
TCCR1A
|