Added IR distance code

This commit is contained in:
2019-04-14 01:22:22 -07:00
parent 18c96a7ee5
commit 610bc546c9
3 changed files with 148 additions and 19 deletions

View File

@@ -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