Skip to content
Snippets Groups Projects
Commit 8631a049 authored by Mitalee Parikh's avatar Mitalee Parikh
Browse files

empro +

parent 82baa82e
No related branches found
No related tags found
No related merge requests found
Pipeline #253298 passed
......@@ -110,12 +110,38 @@ So after uploading the blink code + serial, connect the ftdi board to hello boar
4. Programming with avr-gcc
---
http://archive.fabacademy.org/archives/2016/doc/makefile.html
I used Arduino IDE and the same physical setup (FabISP+ribbon cable+ hello board) and wrote the code in avr-gcc.
Arduino IDE operates avr-gcc in the background. And has an interface over it. So it works easily.
This is the [code file](docs/images/empro/t45-blink-avr-gcc.zip).
```
#include <avr/io.h>
#include <util/delay.h>
const int led=PB4;
const int sw=PB3;
int main(){
DDRB |= (1<<led);
DDRB &= ~(1<<sw);
while (1){
if (!(PINB & (1<<sw)))
PORTB |= (1<<led);
else
PORTB &= ~(1<<led);
}
}
```
Basically you inlcude avr/io and delay libraries so that you can use the arduino commands.
Also, the pin numbers are recognised by their ports PB# instead of pin #.
![](./images/empro/gif.gif)
5. Programming with Atmel Studio
---
can't in mac. will do this later on a windows system...
5. References
......
docs/images/empro/gif.gif

220 KiB

File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment