Added IR distance code
This commit is contained in:
19
build.sh
19
build.sh
@@ -1,4 +1,15 @@
|
||||
avr-gcc -Os -DF_CPU=16000000L -DBAUD=9600UL -mmcu=atmega328p main.c -o main.o
|
||||
avr-objcopy -O ihex main.o main.hex
|
||||
avrdude -v -patmega328p -carduino -P/dev/ttyUSB0 -b57600 -D -Uflash:w:main.hex:i
|
||||
rm main.o main.hex
|
||||
|
||||
if [ $# -eq 0 ]
|
||||
then
|
||||
file=main.c
|
||||
else
|
||||
file=$1
|
||||
fi
|
||||
|
||||
ofile=$(echo $file | sed "s/\.c/\.o/")
|
||||
hexfile=$(echo $file | sed "s/\.c/\.hex/")
|
||||
|
||||
avr-gcc -Os -DF_CPU=16000000L -DBAUD=9600UL -mmcu=atmega328p $file -o $ofile
|
||||
avr-objcopy -O ihex $ofile $hexfile
|
||||
avrdude -v -patmega328p -carduino -P/dev/ttyUSB0 -b57600 -D -Uflash:w:$hexfile:i
|
||||
rm $ofile $hexfile
|
||||
|
||||
Reference in New Issue
Block a user