LAMPIRAN A FOTO Radio Control Helikopter dan Pengendalinya

Similar documents
LAMPIRAN A PROGRAM UTAMA ROBOT NOMOR 2

LAMPIRAN - A. Instruksi Mikrokontroler

// WRITE data to be written to EEPROM

LAMPIRAN A. Universitas Sumatera Utara

LAMPIRAN. 1. Program Alat

LAMPIRAN A FOTO ALAT

LAMPIRAN. Program Keseluruhan Sistem Pengontrolan Level Air

RANGKAIAN LENGKAP. Universitas Sumatera Utara

LAMPIRAN A. Foto Alat

LAMPIRAN A List Program CodeVision Generato Data...A-1 List Program CodeVision Multiplexer...A-11 List Program CodeVision Demultiplexer...

Lampiran. Universitas Sumatera Utara

LAMPIRAN A. Listing Program. Program pada Borland Delphi 7.0 A-1 Program pada CodeVisionAVR C Compiler A-6

LAMPIRAN A FOTO ROBOT BERKAKI ENAM

Gambar A-1 Foto alat prototype infrared thermometer

LAMPIRAN A GAMBAR SISTEM

Ali Karimpour Associate Professor Ferdowsi University of Mashhad

Software Design Considerations, Narrative and Documentation

Getting Started With the Micro64

LAMPIRAN A LIST PROGRAM SERVER DAN CLIENT

Set of pulse decoding algorithms for quadrature rotary and linear encoders*

ECE477: Team 10 Software Design Considerations, Narrative, and Documentation

Project : Version : Date : 11/04/2016 Author : Freeware, for evaluation and non-commercial use only Company : Comments:

// Voltage Reference: AREF pin #define ADC_VREF_TYPE ((0<<REFS1) (0<<REFS0) (0<<ADLAR))

J. Basic. Appl. Sci. Res., 3(2s) , , TextRoad Publication

Universitas Sumatera Utara

Lampiran 1 Tabel data normalisasi lemari tabung LPG dari alat Konsentrasi Gas LPG Konsentrasi Gas

How2Use DT-AVR ATMEGA128L BMS. Oleh: IE Team. Picture 1 The layout of DT-AVR ATMEGA128L BMS

LAMPIRAN A. Universitas Sumatera Utara

8-bit Microcontroller. Application Note. AVR033: Getting Started with the CodeVisionAVR C Compiler

8-bit Microcontroller. Application Note. AVR033: Getting Started with the CodeVisionAVR C Compiler

LAMPIRAN A. I. Gambar alat percobaan I.1. Power supply. 1. Rangkaian sekunder 2. Dioda. 3. Heatsink 4. Power supply (keseluruhan)

How2Use DT-AVR ATMEGA168 BMS. By: IE Team. Picture 1 The layout of DT-AVR ATMEGA168 BMS

Serial Compact Flash Serial CF Card Module User Manual

LAMPIRAN A /*******************************************************

Lampiran I. Rangkaian Lengkap Alat. Universitas Sumatera Utara

Appendix to Vehicle Automation and Security (Matthew Grojean & Nathan Hart) Nathan Hart Professor Zalewski 04/25/2014

AN703. Micro64/128. Accessing the 36k of SRAM 12/3/04

Automatic Gate Prototype Based on Microcontroller of Atmel ATMega16

Microcomputer/Controller Featuring the ATmega64 or the ATmega128

LAMPIRAN. Universitas Sumatera Utara

My Muzik 1.0. MP3 Player using (VNC1L/VS1033/AVR8) User Manual (Rev 1.0) OrientNDT Co.,LTD

Burglar Alarm Final Report

W.E.S.L.E.Y. Waste Eliminating System for Lazy Engineering Youths. Final Report December 9, 2003 John Mercado

Team project 2017 Dony Pratidana S. Hum Bima Agus Setyawan S. IIP

The MC9S12 Timer Output Compare Function Making an event happen at specific time on the HC12 The MC9S12 Output Compare Function

Capturing the Time of an External Event Input Capture Subsystem

ADC: Analog to Digital Conversion

UART: Universal Asynchronous Receiver & Transmitter

ATMega16 AVR AVR AVR DIP. (in-circiut programming) desktop MOSI MOSIT. AVRProg. header. (toggle)

Topic 11: Timer ISMAIL ARIFFIN FKE UTM SKUDAI JOHOR

The MC9S12 Timer Input Capture Function

LAMPIRAN. Universitas Sumatera Utara

8-bit Microcontroller. Application Note. AVR134: Real-Time Clock (RTC) using the Asynchronous Timer. Features. Theory of Operation.

STUDENT NAME(s):. STUDENT NUMBER(s): B00.

Interrupt Controlled UART

SwampBoard.com Bot. Foley Ma Spring 2006 IMDL

Interrupts and Serial Communication on the PIC18F8520

EE318 Electronic Design Lab, Project Report, EE Dept, IIT Bombay, April GPS Tracker. Group No: B11

L A M P I R A N UNIVERSITAS KRISTEN MARANTHA

TIMSK=0b ; /* enables the T/C0 overflow interrupt in the T/C interrupt mask register for */

Programming Microcontroller Assembly and C

Introduction to the MC9S12 Hardware Subsystems

Interrupts & Interrupt Service Routines (ISRs)

Timer0..Timer3. Interrupt Description Input Conditions Enable Flag

Introduction to Embedded Systems

Laboratory 4 Usage of timers

CN310 Microprocessor Systems Design

Topic 11: Interrupts ISMAIL ARIFFIN FKE UTM SKUDAI JOHOR

ET-BASE AVR ATmega64/128

ATmega Interrupts. Reading. The AVR Microcontroller and Embedded Systems using Assembly and C) by Muhammad Ali Mazidi, Sarmad Naimi, and Sepehr Naimi

TekBots TM Oregon State University. mega User Guide

Final Design Report. Team Name: No Rest for the Weary

Embedded Systems and Software. Serial Communication

Embedded Systems and Software

Software Documentation

Microprocessors & Interfacing

INTERRUPTS in microprocessor systems

COMP2121: Microprocessors and Interfacing

PROJECT ELECTRONIC CONTROL GAS INJECTION SYSTEM

ATmega128 USART. Overview

Interrupts, timers and counters

School of Electrical, Computer and Telecommunications Engineering University of Wollongong Australia


Universal Asynchronous Receiver / Transmitter (UART)

How to use RFpro in Packet Mode

SYLLABUS UNIT - I 8086/8088 ARCHITECTURE AND INSTRUCTION SET

Example of Asyncronous Serial Comms on a PIC16F877

Lecture 14. Ali Karimpour Associate Professor Ferdowsi University of Mashhad

MICROPROCESSOR BASED SYSTEM DESIGN


8-bit Microcontroller. Application Note. AVR134: Real-Time Clock (RTC) using the Asynchronous Timer. Features. Theory of Operation.

Embedded Systems and Software

CodeVisionAVR VERSION User Manual

Interrupt vectors for the 68HC912B32. The interrupt vectors for the MC9S12DP256 are located in memory from 0xFF80 to 0xFFFF.

4. Application Programming

USART Register Description

LAMPIRAN A PROGRAM FLOWSTONE

CodeVisionAVR VERSION User Manual

Marten van Dijk, Syed Kamran Haider

CUSAT TEAM: TELEMETRY & COMMAND SUBSYSTEM MEMORY MANAGEMENT AND FLASH INTERFACE

Transcription:

LAMPIRAN A FOTO Radio Control Helikopter dan Pengendalinya

Tampak Atas A-1

Tampak Depan A-2

Tampak Samping A-3

Tampak Belakang A-4

Pengendali A-5

LAMPIRAN B PROGRAM PADA MICROSOFT VISUAL BASIC 6 DAN PENGONTROL MIKRO ATMEGA16

MICROSOFT VISUAL BASIC 6 //------------------------------------------------------------------------------------------------- // Tombol Start //------------------------------------------------------------------------------------------------- Private Sub Command1_Click() Label4.Caption = "0" Timer5.Enabled = True MSComm1.Output = "TC6 64 61 115 94 196" & vbcrlf If Option1.Value = True Then Timer1.Enabled = True If Option2.Value = True Then Timer2.Enabled = True If Option3.Value = True Then Timer3.Enabled = True If CStr(Label6.Caption) > 0 Then Timer4.Enabled = True End Sub //------------------------------------------------------------------------------------------------- // Tombol Stop //------------------------------------------------------------------------------------------------- Private Sub Command2_Click() Timer1.Enabled = False Timer2.Enabled = False Timer3.Enabled = False Timer4.Enabled = False Timer5.Enabled = False For i = 1 To 200 B-1

MSComm1.Output = " " & vbcrlf Next i RichTextBox1.Text = " " End Sub //------------------------------------------------------------------------------------------------- // Program Awal //------------------------------------------------------------------------------------------------- Private Sub Form_Load() MSComm1.PortOpen = True MSComm1.PortOpen = True Timer1.Enabled = False Timer2.Enabled = False Timer3.Enabled = False Timer4.Enabled = False Timer5.Enabled = False Option1.Value = True End Sub //------------------------------------------------------------------------------------------------- // Program pada Timer1 //------------------------------------------------------------------------------------------------- Private Sub Timer1_Timer() Do While x < X1 x = Value(Label6.Caption) y = Value(Label7.Caption) If x < X1 Then g1 = 1 Else: g1 = 0 If y < Y1 Then g2 = 2 Else: g2 = 0 B-2

If y > Y1 Then g3 = 4 Else: g3 = 0 g = g1 + g2 + g3 MSComm2.Output = g Loop Do While x < X2 x = Value(Label6.Caption) y = Value(Label7.Caption) If x < X2 Then g1 = 1 Else: g1 = 0 If y < Y2 Then g2 = 2 Else: g2 = 0 If y > Y2 Then g3 = 4 Else: g3 = 0 g = g1 + g2 + g3 MSComm2.Output = g Loop Do While x < X3 x = Value(Label6.Caption) y = Value(Label7.Caption) If x < X3 Then g1 = 1 B-3

Else: g1 = 0 If y < Y3 Then g2 = 2 Else: g2 = 0 If y > Y3 Then g3 = 4 Else: g3 = 0 g = g1 + g2 + g3 MSComm2.Output = g Loop Do While x < X4 x = Value(Label6.Caption) y = Value(Label7.Caption) If x < X4 Then g1 = 1 Else: g1 = 0 If y < Y4 Then g2 = 2 Else: g2 = 0 If y > Y4 Then g3 = 4 Else: g3 = 0 g = g1 + g2 + g3 MSComm2.Output = g Loop B-4

Do While x < x5 x = Value(Label6.Caption) y = Value(Label7.Caption) If x < x5 Then g1 = 1 Else: g1 = 0 If y < Y5 Then g2 = 2 Else: g2 = 0 If y > Y5 Then g3 = 4 Else: g3 = 0 g = g1 + g2 + g3 MSComm2.Output = g Loop If x > x5 Then Timer1.Enabled = False Timer4.Enabled = False End Sub //------------------------------------------------------------------------------------------------- // Program pada Timer2 //------------------------------------------------------------------------------------------------- Private Sub Timer2_Timer() Do While x < X1 x = Value(Label6.Caption) y = Value(Label7.Caption) If x < X1 Then g1 = 1 B-5

Else: g1 = 0 If y < Y1 Then g2 = 2 Else: g2 = 0 If y > Y1 Then g3 = 4 Else: g3 = 0 g = g1 + g2 + g3 MSComm2.Output = g Loop Do While x < X2 x = Value(Label6.Caption) y = Value(Label7.Caption) If x < X2 Then g1 = 1 Else: g1 = 0 If y < Y2 Then g2 = 2 Else: g2 = 0 If y > Y2 Then g3 = 4 Else: g3 = 0 g = g1 + g2 + g3 MSComm2.Output = g Loop B-6

Do While x < X3 x = Value(Label6.Caption) y = Value(Label7.Caption) If x < X3 Then g1 = 1 Else: g1 = 0 If y < Y3 Then g2 = 2 Else: g2 = 0 If y > Y3 Then g3 = 4 Else: g3 = 0 g = g1 + g2 + g3 MSComm2.Output = g Loop Do While x < X4 x = Value(Label6.Caption) y = Value(Label7.Caption) If x < X4 Then g1 = 1 Else: g1 = 0 If y < Y4 Then g2 = 2 Else: g2 = 0 If y > Y4 Then g3 = 4 B-7

Else: g3 = 0 g = g1 + g2 + g3 MSComm2.Output = g Loop Do While x < x5 x = Value(Label6.Caption) y = Value(Label7.Caption) If x < x5 Then g1 = 1 Else: g1 = 0 If y < Y5 Then g2 = 2 Else: g2 = 0 If y > Y5 Then g3 = 4 Else: g3 = 0 g = g1 + g2 + g3 MSComm2.Output = g Loop If x > x5 Then Timer2.Enabled = False Timer4.Enabled = False End Sub //------------------------------------------------------------------------------------------------- // Program pada Timer3 //------------------------------------------------------------------------------------------------- Private Sub Timer3_Timer() B-8

Do While x < X1 x = Value(Label6.Caption) y = Value(Label7.Caption) If x < X1 Then g1 = 1 Else: g1 = 0 If y < Y1 Then g2 = 2 Else: g2 = 0 If y > Y1 Then g3 = 4 Else: g3 = 0 g = g1 + g2 + g3 MSComm2.Output = g Loop Do While x < X2 x = Value(Label6.Caption) y = Value(Label7.Caption) If x < X2 Then g1 = 1 Else: g1 = 0 If y < Y2 Then g2 = 2 Else: g2 = 0 If y > Y2 Then g3 = 4 B-9

Else: g3 = 0 g = g1 + g2 + g3 MSComm2.Output = g Loop Do While x < X3 x = Value(Label6.Caption) y = Value(Label7.Caption) If x < X3 Then g1 = 1 Else: g1 = 0 If y < Y3 Then g2 = 2 Else: g2 = 0 If y > Y3 Then g3 = 4 Else: g3 = 0 g = g1 + g2 + g3 MSComm2.Output = g Loop Do While x < X4 x = Value(Label6.Caption) y = Value(Label7.Caption) If x < X4 Then g1 = 1 Else: g1 = 0 If y < Y4 Then B-10

g2 = 2 Else: g2 = 0 If y > Y4 Then g3 = 4 Else: g3 = 0 g = g1 + g2 + g3 MSComm2.Output = g Loop Do While x < x5 x = Value(Label6.Caption) y = Value(Label7.Caption) If x < x5 Then g1 = 1 Else: g1 = 0 If y < Y5 Then g2 = 2 Else: g2 = 0 If y > Y5 Then g3 = 4 Else: g3 = 0 g = g1 + g2 + g3 MSComm2.Output = g Loop If x > x5 Then Timer3.Enabled = False Timer4.Enabled = False B-11

End Sub //------------------------------------------------------------------------------------------------- // Program pada Timer4 (Penghitung Lamanya Proses) //------------------------------------------------------------------------------------------------- Private Sub Timer4_Timer() Label4.Caption = Val(Label4.Caption) + 1 End Sub //------------------------------------------------------------------------------------------------- // Program pada Timer5 (Pengambil Data CMUCam2+) //------------------------------------------------------------------------------------------------- Private Sub Timer5_Timer() Dim Data As Variant Data = MSComm1.Input RichTextBox1.Text = Data Data = Split(Data, " ") Label6.Caption = Data(1) Label7.Caption = Data(2) End Sub B-12

PENGONTROL MIKRO ATMEGA16 /***************************************************** This program was produced by the CodeWizardAVR V1.25.3 Professional Automatic Program Generator Copyright 1998-2007 Pavel Haiduc, HP InfoTech s.r.l. http://www.hpinfotech.com Project : Pengontrol Remote RC Heli Version : 1 Date : 9/27/2010 Author : IVan/PiNgu/APui/ToPui Company : UKM Comments: Chip type : ATmega16 Program type : Application Clock frequency : 11.059200 MHz Memory model : Small External SRAM size : 0 Data Stack size : 256 *****************************************************/ #include <mega16.h> #include <delay.h> #define RXB8 1 #define TXB8 0 #define UPE 2 #define OVR 3 #define FE 4 B-13

#define UDRE 5 #define RXC 7 #define FRAMING_ERROR (1<<FE) #define PARITY_ERROR (1<<UPE) #define DATA_OVERRUN (1<<OVR) #define DATA_REGISTER_EMPTY (1<<UDRE) #define RX_COMPLETE (1<<RXC) // USART Receiver buffer #define RX_BUFFER_SIZE 8 char rx_buffer[rx_buffer_size]; #if RX_BUFFER_SIZE<256 unsigned char rx_wr_index,rx_rd_index,rx_counter; #else unsigned int rx_wr_index,rx_rd_index,rx_counter; #endif // This flag is set on USART Receiver buffer overflow bit rx_buffer_overflow; // USART Receiver interrupt service routine interrupt [USART_RXC] void usart_rx_isr(void) { char status,data; status=ucsra; data=udr; if ((status & (FRAMING_ERROR PARITY_ERROR DATA_OVERRUN))==0) { B-14

rx_buffer[rx_wr_index]=data; if (++rx_wr_index == RX_BUFFER_SIZE) rx_wr_index=0; if (++rx_counter == RX_BUFFER_SIZE) { rx_counter=0; rx_buffer_overflow=1; }; }; } #ifndef _DEBUG_TERMINAL_IO_ // Get a character from the USART Receiver buffer #define _ALTERNATE_GETCHAR_ #pragma used+ char getchar(void) { char data; while (rx_counter==0); data=rx_buffer[rx_rd_index]; if (++rx_rd_index == RX_BUFFER_SIZE) rx_rd_index=0; #asm("cli") --rx_counter; #asm("sei") return data; } #pragma used- #endif // Standard Input/Output functions #include <stdio.h> B-15

// Declare your global variables here int G = 0; void main(void) { // Declare your local variables here // Input/Output Ports initialization // Port A initialization // Func7=Out Func6=Out Func5=Out Func4=Out Func3=Out Func2=Out Func1=Out Func0=Out // State7=0 State6=0 State5=0 State4=0 State3=0 State2=0 State1=0 State0=0 PORTA=0x00; DDRA=0xFF; // Port B initialization // Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In // State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T PORTB=0x00; DDRB=0x00; // Port C initialization // Func7=Out Func6=Out Func5=Out Func4=Out Func3=Out Func2=Out Func1=Out Func0=Out // State7=0 State6=0 State5=0 State4=0 State3=0 State2=0 State1=0 State0=0 PORTC=0x00; DDRC=0xFF; // Port D initialization // Func7=Out Func6=Out Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In B-16

// State7=0 State6=0 State5=T State4=T State3=T State2=T State1=T State0=T PORTD=0x00; DDRD=0xC0; // Timer/Counter 0 initialization // Clock source: System Clock // Clock value: Timer 0 Stopped // Mode: Normal top=ffh // OC0 output: Disconnected TCCR0=0x00; TCNT0=0x00; OCR0=0x00; // Timer/Counter 1 initialization // Clock source: System Clock // Clock value: Timer 1 Stopped // Mode: Normal top=ffffh // OC1A output: Discon. // OC1B output: Discon. // Noise Canceler: Off // Input Capture on Falling Edge // Timer 1 Overflow Interrupt: Off // Input Capture Interrupt: Off // Compare A Match Interrupt: Off // Compare B Match Interrupt: Off TCCR1A=0x00; TCCR1B=0x00; TCNT1H=0x00; TCNT1L=0x00; ICR1H=0x00; ICR1L=0x00; B-17

OCR1AH=0x00; OCR1AL=0x00; OCR1BH=0x00; OCR1BL=0x00; // Timer/Counter 2 initialization // Clock source: System Clock // Clock value: Timer 2 Stopped // Mode: Normal top=ffh // OC2 output: Disconnected ASSR=0x00; TCCR2=0x00; TCNT2=0x00; OCR2=0x00; // External Interrupt(s) initialization // INT0: Off // INT1: Off // INT2: Off MCUCR=0x00; MCUCSR=0x00; // Timer(s)/Counter(s) Interrupt(s) initialization TIMSK=0x00; // USART initialization // Communication Parameters: 8 Data, 1 Stop, No Parity // USART Receiver: On // USART Transmitter: Off // USART Mode: Asynchronous // USART Baud rate: 9600 B-18

UCSRA=0x00; UCSRB=0x90; UCSRC=0x86; UBRRH=0x00; UBRRL=0x47; // Analog Comparator initialization // Analog Comparator: Off // Analog Comparator Input Capture by Timer/Counter 1: Off ACSR=0x80; SFIOR=0x00; // Global enable interrupts #asm("sei") //------------------------------------------------------------------------------------------------- //Program Untuk Memberikan Delay 7 Detik dan Kecepatan Motor DC dan Posisi //Motor Servo yang Dimulai Setelah Batere Dipasangkan //------------------------------------------------------------------------------------------------- delay_ms(7000); PORTA=0x7F; PORTC=0X2B; while (1) { // Place your code here //------------------------------------------------------------------------------------------------- //Program Untuk Mengendalikan Kecepatan Motor DC dan Posisi Motor Servo //Berdasarkan G //------------------------------------------------------------------------------------------------- G=getchar(); while (G==1) { B-19

} PORTA=PORTA--; } while (G == 2) { PORTC--; delay_ms(300); PORTC++; } while (G == 3) { PORTA=PORTA--; PORTC=PORTC--; delay_ms(300); PORTC=PORTC++; } while (G == 4) { PORTA=PORTA++; } while (G == 5) { PORTA=PORTA++; PORTC=PORTC--; delay_ms(300); PORTC=PORTC++; } }; B-20

LAMPIRAN C DATASHEET

C-1

C-2

C-3

C-4

C-5

C-6

C-7

C-8

C-9

C-10

C-11

C-12

C-13

C-14

C-15

C-16

C-17

C-18