mirror of
https://github.com/Kugelschieber/arduino-c.git
synced 2026-01-18 02:50:26 +00:00
Updated documentation.
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
.vscode/
|
||||
build/
|
||||
12
README.md
12
README.md
@@ -1,11 +1,19 @@
|
||||
# Arduino C
|
||||
|
||||
Programming the Arduino in pure C.
|
||||
Programming the Arduino in pure C on Linux.
|
||||
|
||||
## Requirements
|
||||
|
||||
* arvdude
|
||||
* arv-gcc
|
||||
* avr-libc
|
||||
|
||||
## Compile and upload
|
||||
|
||||
Run using the following command (example port):
|
||||
|
||||
```
|
||||
sudo ./compile /dev/ttyUSB0
|
||||
sudo ./compile.sh /dev/ttyUSB0
|
||||
```
|
||||
|
||||
The port can be found by looking inside `/dev`, the system file `ll /sys/class/tty/ttyUSB*`, or by running `lsusb`.
|
||||
|
||||
@@ -14,17 +14,19 @@ echo "BAUD set to $BAUD"
|
||||
rm -rf build || true
|
||||
mkdir build
|
||||
|
||||
# compile files
|
||||
avr-gcc -Os -DF_CPU=16000000UL -mmcu=$MMCU -c -o build/servo.o -Wall servo/servo.c
|
||||
|
||||
avr-gcc -Os -DF_CPU=16000000UL -mmcu=$MMCU -c -o build/rf24.o -Wall rf24/rf24.c
|
||||
|
||||
avr-gcc -Os -DF_CPU=16000000UL -mmcu=$MMCU -c -o build/util.o -Wall ard/util.c
|
||||
avr-gcc -Os -DF_CPU=16000000UL -mmcu=$MMCU -c -o build/serial.o -Wall ard/serial.c
|
||||
avr-gcc -Os -DF_CPU=16000000UL -mmcu=$MMCU -c -o build/pins.o -Wall ard/pins.c
|
||||
avr-gcc -Os -DF_CPU=16000000UL -mmcu=$MMCU -c -o build/main.o -Wall main.c
|
||||
|
||||
# compile binary
|
||||
avr-gcc -mmcu=$MMCU build/*.o -o build/main
|
||||
avr-objcopy -O ihex -R .eeprom build/main build/main.hex
|
||||
avrdude -F -V -c arduino -p $AVR_TYPE -P $1 -b $BAUD -U flash:w:build/main.hex
|
||||
|
||||
rm -r build
|
||||
# create file to upload to arduino
|
||||
avr-objcopy -O ihex -R .eeprom build/main build/main.hex
|
||||
|
||||
# upload to arduino
|
||||
avrdude -F -V -c arduino -p $AVR_TYPE -P $1 -b $BAUD -U flash:w:build/main.hex
|
||||
Reference in New Issue
Block a user