Hi I made my first acoustic levitation by 2 ultrasonic transmitters at 40khz waves
with Arduino uno and also l293d driver to drive the transmitters, powered with 12v power supply
So I have a question that how could I move the piece of styrofoam on the z-axis (up & down) with only manipulate the wave.
What should I change (phase, or amplitude)??
and how i do it on the code.
and Thanks
This is the code that I used :-
byte TP = 0b10101010; //jeder 2. Port bekommt das umgekehrte Signal
void setup() {
DDRC = 0b11111111; //Alle Analogports als Ausgang definieren
// Timer 1 initialisieren
noInterrupts(); // Interrupts deaktivieren
TCCR1A = 0;
TCCR1B = 0;
TCNT1 = 0;
OCR1A = 200; // Compare Match Register setzen (16MHz / 200 = 80kHz Rechteck -> 40kHz Vollwelle )
TCCR1B |= (1 << WGM12); // CTC mode
TCCR1B |= (1 << CS10); // Prescaler auf 1 ==> kein prescalling
TIMSK1 |= (1 << OCIE1A); // Compare Timer Interrupt einschalten
interrupts(); // Interrupts aktivieren
}
ISR(TIMER1_COMPA_vect)
{
PORTC = TP; // Den Wert TP an die Ausgange senden
TP = ~TP; // TP invertieren für den nächsten durchlauf
}
void loop() {
//nothing to do here!
}