Загрузка страницы

Ultrasonic levitation device from an Arduino sensor

Circuit idea and Arduino code are taken from here: https://www.heise.de/make/artikel/Einfacher-Ultraschall-Levitationsapparat-4022505.html

The following is the code taken from aforementioned website. Youtube doesnt allow for Less than and Greater than signs in the description, so I've changed them to words "Less" and "Greater", respectfully. You need to change them back manually (including the ") when you use the code in Arduino IDE. The comments are translated from German automatically.

byte TP = 0b10101010; // every 2nd port gets the reversed signal
void setup()
{
DDRC = 0b11111111; // define all analog ports as output
// initialize timer 1
noInterrupts(); // Disable interrupts
TCCR1A = 0;
TCCR1B = 0;
TCNT1 = 0;
OCR1A = 200; // Set Compare Match Register(16MHz / 200 = 80kHz square - "Greater" 40kHz full wave )
TCCR1B |= (1 "Less""Less" WGM12); // CTC mode
TCCR1B |= (1 "Less""Less" CS10); // prescaler to 1 =="Greater" no prescaling
TIMSK1 |= (1 "Less""Less" OCIE1A); // Turn on compare timer interrupt
interrupts(); // enable interrupts
}
ISR(TIMER1_COMPA_vect)
{
PORTC = TP; // send the value TP to the outputs
TP = ~TP; // invert TP for the next pass
}
void loop(){
// nothing left to do here :-(
}

Видео Ultrasonic levitation device from an Arduino sensor канала Vidduley
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
13 июля 2018 г. 23:00:02
00:09:14
Яндекс.Метрика