This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########## | |
# L.append(object) -> – append object to the end of list | |
# append() takes exactly one argument | |
L = [1,2,3,4,5] | |
L.append(2.1) | |
print(L) | |
# Output: | |
# [1, 2, 3, 4, 5, 2.1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* lab7.c | |
* | |
* Author : mahir | |
*/ | |
#include <avr/io.h> | |
int main(void) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.alert("Hello World!"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ------- Preamble ------- // | |
#include <avr/io.h> | |
#include <util/delay.h> /* Time delay function */ | |
int main(void) { | |
// ------- Inits ------- // | |
DDRB = 0b11111111; /* Port-B configured for output */ | |
uint8_t i; /* unsigned 8-bit integer */ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while(1){ | |
PORTB = 0b00000001; | |
_delay_ms(500); | |
PORTB = 0b00000010; | |
_delay_ms(500); | |
PORTB = 0b00000100; | |
_delay_ms(500); | |
PORTB = 0b00001000; | |
_delay_ms(500); | |
PORTB = 0b00010000; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[comment] | |
anything written on the right side of `//` notation, i.e on | |
lines 1, 5, 9, 12, 13, 15, 17, 18, 20, 21 and 23. | |
[includes] | |
lines 2-3, here include other important files for your present projects. | |
[function definitions] | |
lines 6-7, define global variables and other functions | |
or include library of a function. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Preamble | |
#include <avr/io.h> | |
#include <util/delay.h> /* Time delay function */ | |
// Function definitions | |
#define LED_DDR DDRB | |
#define LED_PORT PORTB | |
//main function | |
int main(void) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##########------------------------------------------------------########## | |
########## Project-specific Details ########## | |
########## Check these every time you start a new project ########## | |
########## or when you change your MCU or USB PORT ########## | |
##########------------------------------------------------------########## | |
MCU = atmega8 ## Name of your microcontroller device. | |
F_CPU = 8000000UL ## Frequency | |
BAUD = 19200 ## BAUD rate | |
PORT = /dev/ttyUSB0 ## USB PORT of your computer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mahir@ubuntu:~$ avrdude | |
Usage: avrdude [options] | |
Options: | |
-p <partno> Required. Specify AVR device. | |
-b <baudrate> Override RS-232 baud rate. | |
-B <bitclock> Specify JTAG/STK500v2 bit clock period (us). | |
-C <config-file> Specify location of configuration file. | |
-c <programmer> Specify programmer type. | |
-D Disable auto erase for flash memory | |
-i <delay> ISP Clock Delay [in microseconds] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* lab1.c | |
* | |
* Created: 12/23/2015 6:18:56 PM | |
* Author : mahir | |
*/ | |
#include <avr/io.h> | |