Go Down

Topic: need urgent help in programming arduino to drive Chladni Plate (deadline 22th 03 (Read 4 times) previous topic - next topic

antsnark

]:D ]:) ]:) ]:) ]:) ]:)

just break my new arduino uno!!!   =( =( =( =( =( =( =( =( =( =(

now try to reanimate it (stupid serial port bug.........)

antsnark



found on a russian site

Code: [Select]
#define R3_PIN       A0
#define SPEAKER_PIN  11

#define T2_WGM   0b010
#define T2_COMA  0b01
#define T2_CS    0b111

void setup() {
 TCCR2A = (T2_COMA << 6) | (T2_WGM & 0b011);
 TCCR2B = ((T2_WGM & 0b100) << 1) | T2_CS;
 OCR2A = 255;
  pinMode(R3_PIN, INPUT);
 pinMode(SPEAKER_PIN, OUTPUT);
}
void loop() {
 OCR2A = map(analogRead(R3_PIN), 0, 1023, 0, 255);
}


sounds good and loud. But without change frequency after interval. It is analogue.

PS  still can't launch IDE on my fedora netbook  ]:)

Go Up