diff --git a/Microcontrollers/Microcontrollers.atsln b/Microcontrollers/Microcontrollers.atsln
index 54fcc36..c520ce5 100644
--- a/Microcontrollers/Microcontrollers.atsln
+++ b/Microcontrollers/Microcontrollers.atsln
@@ -29,7 +29,9 @@ Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "opdracht 2.4", "opdracht 2.
EndProject
Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "opdracht 3.3", "opdracht 3.3\opdracht 3.3.cproj", "{985D5C75-F61E-49F1-A532-66A1E6141552}"
EndProject
-Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "opdracht 4.1", "opdracht 4.1\opdracht 4.1.cproj", "{2432E6BF-DA1E-4668-99BB-59FEA1F5B8A2}"
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "opdracht 4.b1", "opdracht 4.b1\opdracht 4.b1.cproj", "{314FE495-A311-499D-B63E-4B5E7B7F2054}"
+EndProject
+Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "ultrasonicSensor", "ultrasonicSensor\ultrasonicSensor.cproj", "{26DA64DE-DD48-4718-94B5-81F9EC5D4B33}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -89,10 +91,14 @@ Global
{985D5C75-F61E-49F1-A532-66A1E6141552}.Debug|AVR.Build.0 = Debug|AVR
{985D5C75-F61E-49F1-A532-66A1E6141552}.Release|AVR.ActiveCfg = Release|AVR
{985D5C75-F61E-49F1-A532-66A1E6141552}.Release|AVR.Build.0 = Release|AVR
- {2432E6BF-DA1E-4668-99BB-59FEA1F5B8A2}.Debug|AVR.ActiveCfg = Debug|AVR
- {2432E6BF-DA1E-4668-99BB-59FEA1F5B8A2}.Debug|AVR.Build.0 = Debug|AVR
- {2432E6BF-DA1E-4668-99BB-59FEA1F5B8A2}.Release|AVR.ActiveCfg = Release|AVR
- {2432E6BF-DA1E-4668-99BB-59FEA1F5B8A2}.Release|AVR.Build.0 = Release|AVR
+ {314FE495-A311-499D-B63E-4B5E7B7F2054}.Debug|AVR.ActiveCfg = Debug|AVR
+ {314FE495-A311-499D-B63E-4B5E7B7F2054}.Debug|AVR.Build.0 = Debug|AVR
+ {314FE495-A311-499D-B63E-4B5E7B7F2054}.Release|AVR.ActiveCfg = Release|AVR
+ {314FE495-A311-499D-B63E-4B5E7B7F2054}.Release|AVR.Build.0 = Release|AVR
+ {26DA64DE-DD48-4718-94B5-81F9EC5D4B33}.Debug|AVR.ActiveCfg = Debug|AVR
+ {26DA64DE-DD48-4718-94B5-81F9EC5D4B33}.Debug|AVR.Build.0 = Debug|AVR
+ {26DA64DE-DD48-4718-94B5-81F9EC5D4B33}.Release|AVR.ActiveCfg = Release|AVR
+ {26DA64DE-DD48-4718-94B5-81F9EC5D4B33}.Release|AVR.Build.0 = Release|AVR
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/Microcontrollers/opdracht 4.b1/opdracht 4.b1.cproj b/Microcontrollers/opdracht 4.b1/opdracht 4.b1.cproj
index ad47ba0..70a3a7b 100644
--- a/Microcontrollers/opdracht 4.b1/opdracht 4.b1.cproj
+++ b/Microcontrollers/opdracht 4.b1/opdracht 4.b1.cproj
@@ -4,7 +4,7 @@
2.0
7.0
com.Atmel.AVRGCC8.C
- dce6c7e3-ee26-4d79-826b-08594b9ad897
+ {314fe495-a311-499d-b63e-4b5e7b7f2054}
ATmega128
none
Executable
@@ -15,6 +15,19 @@
opdracht 4.b1
opdracht 4.b1
opdracht 4.b1
+ Native
+ true
+ false
+ true
+ true
+
+
+ true
+
+ 2
+ 0
+ 0
+
@@ -24,5 +37,10 @@
+
+
+ compile
+
+
\ No newline at end of file
diff --git a/Microcontrollers/ultrasonicSensor/Debug/Makefile b/Microcontrollers/ultrasonicSensor/Debug/Makefile
new file mode 100644
index 0000000..ff7d88c
--- /dev/null
+++ b/Microcontrollers/ultrasonicSensor/Debug/Makefile
@@ -0,0 +1,139 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+SHELL := cmd.exe
+RM := rm -rf
+
+USER_OBJS :=
+
+LIBS :=
+PROJ :=
+
+O_SRCS :=
+C_SRCS :=
+S_SRCS :=
+S_UPPER_SRCS :=
+OBJ_SRCS :=
+ASM_SRCS :=
+PREPROCESSING_SRCS :=
+OBJS :=
+OBJS_AS_ARGS :=
+C_DEPS :=
+C_DEPS_AS_ARGS :=
+EXECUTABLES :=
+OUTPUT_FILE_PATH :=
+OUTPUT_FILE_PATH_AS_ARGS :=
+AVR_APP_PATH :=$$$AVR_APP_PATH$$$
+QUOTE := "
+ADDITIONAL_DEPENDENCIES:=
+OUTPUT_FILE_DEP:=
+LIB_DEP:=
+LINKER_SCRIPT_DEP:=
+
+# Every subdirectory with source files must be described here
+SUBDIRS :=
+
+
+# Add inputs and outputs from these tool invocations to the build variables
+C_SRCS += \
+../lcd_control.c \
+../main.c
+
+
+PREPROCESSING_SRCS +=
+
+
+ASM_SRCS +=
+
+
+OBJS += \
+lcd_control.o \
+main.o
+
+OBJS_AS_ARGS += \
+lcd_control.o \
+main.o
+
+C_DEPS += \
+lcd_control.d \
+main.d
+
+C_DEPS_AS_ARGS += \
+lcd_control.d \
+main.d
+
+OUTPUT_FILE_PATH +=ultrasonicSensor.elf
+
+OUTPUT_FILE_PATH_AS_ARGS +=ultrasonicSensor.elf
+
+ADDITIONAL_DEPENDENCIES:=
+
+OUTPUT_FILE_DEP:= ./makedep.mk
+
+LIB_DEP+=
+
+LINKER_SCRIPT_DEP+=
+
+
+# AVR32/GNU C Compiler
+./lcd_control.o: .././lcd_control.c
+ @echo Building file: $<
+ @echo Invoking: AVR/GNU C Compiler : 5.4.0
+ $(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE) -x c -funsigned-char -funsigned-bitfields -DDEBUG -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\include" -Og -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega128 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\gcc\dev\atmega128" -c -std=gnu99 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<"
+ @echo Finished building: $<
+
+
+./main.o: .././main.c
+ @echo Building file: $<
+ @echo Invoking: AVR/GNU C Compiler : 5.4.0
+ $(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE) -x c -funsigned-char -funsigned-bitfields -DDEBUG -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\include" -Og -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega128 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\gcc\dev\atmega128" -c -std=gnu99 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<"
+ @echo Finished building: $<
+
+
+
+
+
+# AVR32/GNU Preprocessing Assembler
+
+
+
+# AVR32/GNU Assembler
+
+
+
+
+ifneq ($(MAKECMDGOALS),clean)
+ifneq ($(strip $(C_DEPS)),)
+-include $(C_DEPS)
+endif
+endif
+
+# Add inputs and outputs from these tool invocations to the build variables
+
+# All Target
+all: $(OUTPUT_FILE_PATH) $(ADDITIONAL_DEPENDENCIES)
+
+$(OUTPUT_FILE_PATH): $(OBJS) $(USER_OBJS) $(OUTPUT_FILE_DEP) $(LIB_DEP) $(LINKER_SCRIPT_DEP)
+ @echo Building target: $@
+ @echo Invoking: AVR/GNU Linker : 5.4.0
+ $(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE) -o$(OUTPUT_FILE_PATH_AS_ARGS) $(OBJS_AS_ARGS) $(USER_OBJS) $(LIBS) -Wl,-Map="ultrasonicSensor.map" -Wl,--start-group -Wl,-lm -Wl,--end-group -Wl,--gc-sections -mrelax -mmcu=atmega128 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\gcc\dev\atmega128"
+ @echo Finished building target: $@
+ "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O ihex -R .eeprom -R .fuse -R .lock -R .signature -R .user_signatures "ultrasonicSensor.elf" "ultrasonicSensor.hex"
+ "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objcopy.exe" -j .eeprom --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O ihex "ultrasonicSensor.elf" "ultrasonicSensor.eep" || exit 0
+ "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objdump.exe" -h -S "ultrasonicSensor.elf" > "ultrasonicSensor.lss"
+ "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O srec -R .eeprom -R .fuse -R .lock -R .signature -R .user_signatures "ultrasonicSensor.elf" "ultrasonicSensor.srec"
+ "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-size.exe" "ultrasonicSensor.elf"
+
+
+
+
+
+
+
+# Other Targets
+clean:
+ -$(RM) $(OBJS_AS_ARGS) $(EXECUTABLES)
+ -$(RM) $(C_DEPS_AS_ARGS)
+ rm -rf "ultrasonicSensor.elf" "ultrasonicSensor.a" "ultrasonicSensor.hex" "ultrasonicSensor.lss" "ultrasonicSensor.eep" "ultrasonicSensor.map" "ultrasonicSensor.srec" "ultrasonicSensor.usersignatures"
+
\ No newline at end of file
diff --git a/Microcontrollers/ultrasonicSensor/Debug/makedep.mk b/Microcontrollers/ultrasonicSensor/Debug/makedep.mk
new file mode 100644
index 0000000..c9e4784
--- /dev/null
+++ b/Microcontrollers/ultrasonicSensor/Debug/makedep.mk
@@ -0,0 +1,8 @@
+################################################################################
+# Automatically-generated file. Do not edit or delete the file
+################################################################################
+
+lcd_control.c
+
+main.c
+
diff --git a/Microcontrollers/ultrasonicSensor/Debug/ultrasonicSensor.eep b/Microcontrollers/ultrasonicSensor/Debug/ultrasonicSensor.eep
new file mode 100644
index 0000000..7c166a1
--- /dev/null
+++ b/Microcontrollers/ultrasonicSensor/Debug/ultrasonicSensor.eep
@@ -0,0 +1 @@
+:00000001FF
diff --git a/Microcontrollers/ultrasonicSensor/Debug/ultrasonicSensor.lss b/Microcontrollers/ultrasonicSensor/Debug/ultrasonicSensor.lss
new file mode 100644
index 0000000..bed2744
--- /dev/null
+++ b/Microcontrollers/ultrasonicSensor/Debug/ultrasonicSensor.lss
@@ -0,0 +1,231 @@
+
+ultrasonicSensor.elf: file format elf32-avr
+
+Sections:
+Idx Name Size VMA LMA File off Algn
+ 0 .data 00000000 00800100 00800100 00000166 2**0
+ CONTENTS, ALLOC, LOAD, DATA
+ 1 .text 00000112 00000000 00000000 00000054 2**1
+ CONTENTS, ALLOC, LOAD, READONLY, CODE
+ 2 .comment 00000030 00000000 00000000 00000166 2**0
+ CONTENTS, READONLY
+ 3 .note.gnu.avr.deviceinfo 0000003c 00000000 00000000 00000198 2**2
+ CONTENTS, READONLY
+ 4 .debug_aranges 00000030 00000000 00000000 000001d4 2**0
+ CONTENTS, READONLY, DEBUGGING
+ 5 .debug_info 000009ad 00000000 00000000 00000204 2**0
+ CONTENTS, READONLY, DEBUGGING
+ 6 .debug_abbrev 0000084e 00000000 00000000 00000bb1 2**0
+ CONTENTS, READONLY, DEBUGGING
+ 7 .debug_line 0000030d 00000000 00000000 000013ff 2**0
+ CONTENTS, READONLY, DEBUGGING
+ 8 .debug_frame 00000044 00000000 00000000 0000170c 2**2
+ CONTENTS, READONLY, DEBUGGING
+ 9 .debug_str 0000043a 00000000 00000000 00001750 2**0
+ CONTENTS, READONLY, DEBUGGING
+ 10 .debug_loc 000000d2 00000000 00000000 00001b8a 2**0
+ CONTENTS, READONLY, DEBUGGING
+ 11 .debug_ranges 00000020 00000000 00000000 00001c5c 2**0
+ CONTENTS, READONLY, DEBUGGING
+
+Disassembly of section .text:
+
+00000000 <__vectors>:
+ 0: 45 c0 rjmp .+138 ; 0x8c <__ctors_end>
+ 2: 00 00 nop
+ 4: 58 c0 rjmp .+176 ; 0xb6 <__bad_interrupt>
+ 6: 00 00 nop
+ 8: 56 c0 rjmp .+172 ; 0xb6 <__bad_interrupt>
+ a: 00 00 nop
+ c: 54 c0 rjmp .+168 ; 0xb6 <__bad_interrupt>
+ e: 00 00 nop
+ 10: 52 c0 rjmp .+164 ; 0xb6 <__bad_interrupt>
+ 12: 00 00 nop
+ 14: 50 c0 rjmp .+160 ; 0xb6 <__bad_interrupt>
+ 16: 00 00 nop
+ 18: 4e c0 rjmp .+156 ; 0xb6 <__bad_interrupt>
+ 1a: 00 00 nop
+ 1c: 4c c0 rjmp .+152 ; 0xb6 <__bad_interrupt>
+ 1e: 00 00 nop
+ 20: 4a c0 rjmp .+148 ; 0xb6 <__bad_interrupt>
+ 22: 00 00 nop
+ 24: 48 c0 rjmp .+144 ; 0xb6 <__bad_interrupt>
+ 26: 00 00 nop
+ 28: 46 c0 rjmp .+140 ; 0xb6 <__bad_interrupt>
+ 2a: 00 00 nop
+ 2c: 44 c0 rjmp .+136 ; 0xb6 <__bad_interrupt>
+ 2e: 00 00 nop
+ 30: 42 c0 rjmp .+132 ; 0xb6 <__bad_interrupt>
+ 32: 00 00 nop
+ 34: 40 c0 rjmp .+128 ; 0xb6 <__bad_interrupt>
+ 36: 00 00 nop
+ 38: 3e c0 rjmp .+124 ; 0xb6 <__bad_interrupt>
+ 3a: 00 00 nop
+ 3c: 3c c0 rjmp .+120 ; 0xb6 <__bad_interrupt>
+ 3e: 00 00 nop
+ 40: 3a c0 rjmp .+116 ; 0xb6 <__bad_interrupt>
+ 42: 00 00 nop
+ 44: 38 c0 rjmp .+112 ; 0xb6 <__bad_interrupt>
+ 46: 00 00 nop
+ 48: 36 c0 rjmp .+108 ; 0xb6 <__bad_interrupt>
+ 4a: 00 00 nop
+ 4c: 34 c0 rjmp .+104 ; 0xb6 <__bad_interrupt>
+ 4e: 00 00 nop
+ 50: 32 c0 rjmp .+100 ; 0xb6 <__bad_interrupt>
+ 52: 00 00 nop
+ 54: 30 c0 rjmp .+96 ; 0xb6 <__bad_interrupt>
+ 56: 00 00 nop
+ 58: 2e c0 rjmp .+92 ; 0xb6 <__bad_interrupt>
+ 5a: 00 00 nop
+ 5c: 2c c0 rjmp .+88 ; 0xb6 <__bad_interrupt>
+ 5e: 00 00 nop
+ 60: 2a c0 rjmp .+84 ; 0xb6 <__bad_interrupt>
+ 62: 00 00 nop
+ 64: 28 c0 rjmp .+80 ; 0xb6 <__bad_interrupt>
+ 66: 00 00 nop
+ 68: 26 c0 rjmp .+76 ; 0xb6 <__bad_interrupt>
+ 6a: 00 00 nop
+ 6c: 24 c0 rjmp .+72 ; 0xb6 <__bad_interrupt>
+ 6e: 00 00 nop
+ 70: 22 c0 rjmp .+68 ; 0xb6 <__bad_interrupt>
+ 72: 00 00 nop
+ 74: 20 c0 rjmp .+64 ; 0xb6 <__bad_interrupt>
+ 76: 00 00 nop
+ 78: 1e c0 rjmp .+60 ; 0xb6 <__bad_interrupt>
+ 7a: 00 00 nop
+ 7c: 1c c0 rjmp .+56 ; 0xb6 <__bad_interrupt>
+ 7e: 00 00 nop
+ 80: 1a c0 rjmp .+52 ; 0xb6 <__bad_interrupt>
+ 82: 00 00 nop
+ 84: 18 c0 rjmp .+48 ; 0xb6 <__bad_interrupt>
+ 86: 00 00 nop
+ 88: 16 c0 rjmp .+44 ; 0xb6 <__bad_interrupt>
+ ...
+
+0000008c <__ctors_end>:
+ 8c: 11 24 eor r1, r1
+ 8e: 1f be out 0x3f, r1 ; 63
+ 90: cf ef ldi r28, 0xFF ; 255
+ 92: d0 e1 ldi r29, 0x10 ; 16
+ 94: de bf out 0x3e, r29 ; 62
+ 96: cd bf out 0x3d, r28 ; 61
+
+00000098 <__do_copy_data>:
+ 98: 11 e0 ldi r17, 0x01 ; 1
+ 9a: a0 e0 ldi r26, 0x00 ; 0
+ 9c: b1 e0 ldi r27, 0x01 ; 1
+ 9e: e2 e1 ldi r30, 0x12 ; 18
+ a0: f1 e0 ldi r31, 0x01 ; 1
+ a2: 00 e0 ldi r16, 0x00 ; 0
+ a4: 0b bf out 0x3b, r16 ; 59
+ a6: 02 c0 rjmp .+4 ; 0xac <__do_copy_data+0x14>
+ a8: 07 90 elpm r0, Z+
+ aa: 0d 92 st X+, r0
+ ac: a0 30 cpi r26, 0x00 ; 0
+ ae: b1 07 cpc r27, r17
+ b0: d9 f7 brne .-10 ; 0xa8 <__do_copy_data+0x10>
+ b2: 1e d0 rcall .+60 ; 0xf0
+ b4: 2c c0 rjmp .+88 ; 0x10e <_exit>
+
+000000b6 <__bad_interrupt>:
+ b6: a4 cf rjmp .-184 ; 0x0 <__vectors>
+
+000000b8 :
+
+#include "lcd_control.h"
+
+void wait_us(unsigned int us)
+{
+ for(int i = 0; i < us; i++)
+ b8: 20 e0 ldi r18, 0x00 ; 0
+ ba: 30 e0 ldi r19, 0x00 ; 0
+ bc: 06 c0 rjmp .+12 ; 0xca
+ #else
+ //round up by default
+ __ticks_dc = (uint32_t)(ceil(fabs(__tmp)));
+ #endif
+
+ __builtin_avr_delay_cycles(__ticks_dc);
+ be: 46 e0 ldi r20, 0x06 ; 6
+ c0: 4a 95 dec r20
+ c2: f1 f7 brne .-4 ; 0xc0
+ c4: 00 c0 rjmp .+0 ; 0xc6
+ c6: 2f 5f subi r18, 0xFF ; 255
+ c8: 3f 4f sbci r19, 0xFF ; 255
+ ca: 28 17 cp r18, r24
+ cc: 39 07 cpc r19, r25
+ ce: b8 f3 brcs .-18 ; 0xbe
+ {
+ _delay_us(1);
+ }
+}
+ d0: 08 95 ret
+
+000000d2 :
+
+void wait_ms(unsigned int ms)
+{
+
+ for(int i = 0; i < ms; i++)
+ d2: 20 e0 ldi r18, 0x00 ; 0
+ d4: 30 e0 ldi r19, 0x00 ; 0
+ d6: 08 c0 rjmp .+16 ; 0xe8
+ #else
+ //round up by default
+ __ticks_dc = (uint32_t)(ceil(fabs(__tmp)));
+ #endif
+
+ __builtin_avr_delay_cycles(__ticks_dc);
+ d8: e7 e8 ldi r30, 0x87 ; 135
+ da: f3 e1 ldi r31, 0x13 ; 19
+ dc: 31 97 sbiw r30, 0x01 ; 1
+ de: f1 f7 brne .-4 ; 0xdc
+ e0: 00 c0 rjmp .+0 ; 0xe2
+ e2: 00 00 nop
+ e4: 2f 5f subi r18, 0xFF ; 255
+ e6: 3f 4f sbci r19, 0xFF ; 255
+ e8: 28 17 cp r18, r24
+ ea: 39 07 cpc r19, r25
+ ec: a8 f3 brcs .-22 ; 0xd8
+ {
+ _delay_ms(1);
+ }
+}
+ ee: 08 95 ret
+
+000000f0 :
+
+
+int main(void)
+{
+ DDRG = 0x01; // port g pin 0 on output, 1 on input. 0 is trig, 1 is echo
+ f0: 81 e0 ldi r24, 0x01 ; 1
+ f2: 80 93 64 00 sts 0x0064, r24 ; 0x800064 <__TEXT_REGION_LENGTH__+0x7e0064>
+
+
+ /* Replace with your application code */
+ while (1)
+ {
+ PORTG = 0x00; // 10 us low pulse
+ f6: c5 e6 ldi r28, 0x65 ; 101
+ f8: d0 e0 ldi r29, 0x00 ; 0
+ fa: 18 82 st Y, r1
+ wait_us(10);
+ fc: 8a e0 ldi r24, 0x0A ; 10
+ fe: 90 e0 ldi r25, 0x00 ; 0
+ 100: db df rcall .-74 ; 0xb8
+ PORTG = 0x01;
+ 102: 81 e0 ldi r24, 0x01 ; 1
+ 104: 88 83 st Y, r24
+
+ wait_ms(100);
+ 106: 84 e6 ldi r24, 0x64 ; 100
+ 108: 90 e0 ldi r25, 0x00 ; 0
+ 10a: e3 df rcall .-58 ; 0xd2
+ 10c: f4 cf rjmp .-24 ; 0xf6
+
+0000010e <_exit>:
+ 10e: f8 94 cli
+
+00000110 <__stop_program>:
+ 110: ff cf rjmp .-2 ; 0x110 <__stop_program>
diff --git a/Microcontrollers/ultrasonicSensor/Debug/ultrasonicSensor.srec b/Microcontrollers/ultrasonicSensor/Debug/ultrasonicSensor.srec
new file mode 100644
index 0000000..6a916ec
--- /dev/null
+++ b/Microcontrollers/ultrasonicSensor/Debug/ultrasonicSensor.srec
@@ -0,0 +1,20 @@
+S0180000756C747261736F6E696353656E736F722E737265634E
+S113000045C0000058C0000056C0000054C00000A5
+S113001052C0000050C000004EC000004CC00000A0
+S11300204AC0000048C0000046C0000044C00000B0
+S113003042C0000040C000003EC000003CC00000C0
+S11300403AC0000038C0000036C0000034C00000D0
+S113005032C0000030C000002EC000002CC00000E0
+S11300602AC0000028C0000026C0000024C00000F0
+S113007022C0000020C000001EC000001CC0000000
+S11300801AC0000018C0000016C0000011241FBED2
+S1130090CFEFD0E1DEBFCDBF11E0A0E0B1E0E2E1FF
+S11300A0F1E000E00BBF02C007900D92A030B10751
+S11300B0D9F71ED02CC0A4CF20E030E006C046E023
+S11300C04A95F1F700C02F5F3F4F28173907B8F35F
+S11300D0089520E030E008C0E7E8F3E13197F1F754
+S11300E000C000002F5F3F4F28173907A8F3089579
+S11300F081E080936400C5E6D0E018828AE090E055
+S1130100DBDF81E0888384E690E0E3DFF4CFF894DA
+S1050110FFCF1B
+S9030000FC
diff --git a/Microcontrollers/ultrasonicSensor/lcd_control.c b/Microcontrollers/ultrasonicSensor/lcd_control.c
new file mode 100644
index 0000000..17487c7
--- /dev/null
+++ b/Microcontrollers/ultrasonicSensor/lcd_control.c
@@ -0,0 +1,133 @@
+/*
+ * lcd_controlc.c
+ *
+ * Created: 24-2-2021 11:55:12
+ * Author: Sem
+ */
+#define F_CPU 10e6
+#include
+#include
+#include
+#include
+#include
+#include "lcd_control.h"
+
+void _delay_ms(double __ms);
+
+void lcd_clear() {
+ lcd_write_command (0x01); //Leeg display
+ _delay_ms(2);
+ lcd_write_command (0x80); //Cursor terug naar start
+}
+
+void lcd_strobe_lcd_e(void) {
+
+ sbi_porta(LCD_E); // E high
+ _delay_ms(1);
+ cbi_porta(LCD_E); // E low
+ _delay_ms(1);
+
+}
+
+void sbi_portc(int index){
+ PORTC |= (1<
+#include
+
+#include "lcd_control.h"
+
+void wait_us(unsigned int us)
+{
+ for(int i = 0; i < us; i++)
+ {
+ _delay_us(1);
+ }
+}
+
+void wait_ms(unsigned int ms)
+{
+
+ for(int i = 0; i < ms; i++)
+ {
+ _delay_ms(1);
+ }
+}
+
+
+int main(void)
+{
+ DDRG = 0x01; // port g pin 0 on output, 1 on input. 0 is trig, 1 is echo
+
+
+ /* Replace with your application code */
+ while (1)
+ {
+ PORTG = 0x00; // 10 us low pulse
+ wait_us(10);
+ PORTG = 0x01;
+
+ wait_ms(100);
+ }
+}
+
+
+
diff --git a/Microcontrollers/ultrasonicSensor/ultrasonicSensor.componentinfo.xml b/Microcontrollers/ultrasonicSensor/ultrasonicSensor.componentinfo.xml
new file mode 100644
index 0000000..69d6c7e
--- /dev/null
+++ b/Microcontrollers/ultrasonicSensor/ultrasonicSensor.componentinfo.xml
@@ -0,0 +1,86 @@
+
+
+
+
+
+
+ Device
+ Startup
+
+
+ Atmel
+ 1.6.0
+ C:/Program Files (x86)\Atmel\Studio\7.0\Packs
+
+
+
+
+ C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\include\
+
+ include
+ C
+
+
+ include/
+
+
+
+
+ C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\include\avr\iom128.h
+
+ header
+ C
+ JdJ7J9I/SJh965SEyyyVYw==
+
+ include/avr/iom128.h
+
+
+
+
+ C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\templates\main.c
+ template
+ source
+ C Exe
+ zBFq/2TxUzr5xF+6ABRBCw==
+
+ templates/main.c
+ Main file (.c)
+
+
+
+ C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\templates\main.cpp
+ template
+ source
+ C Exe
+ mkKaE95TOoATsuBGv6jmxg==
+
+ templates/main.cpp
+ Main file (.cpp)
+
+
+
+ C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\gcc\dev\atmega128
+
+ libraryPrefix
+ GCC
+
+
+ gcc/dev/atmega128
+
+
+
+
+ ATmega_DFP
+ C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.6.364/Atmel.ATmega_DFP.pdsc
+ 1.6.364
+ true
+ ATmega128
+
+
+
+ Resolved
+ Fixed
+ true
+
+
+
\ No newline at end of file
diff --git a/Microcontrollers/ultrasonicSensor/ultrasonicSensor.cproj b/Microcontrollers/ultrasonicSensor/ultrasonicSensor.cproj
new file mode 100644
index 0000000..2a8122a
--- /dev/null
+++ b/Microcontrollers/ultrasonicSensor/ultrasonicSensor.cproj
@@ -0,0 +1,124 @@
+
+
+
+ 2.0
+ 7.0
+ com.Atmel.AVRGCC8.C
+ {26da64de-dd48-4718-94b5-81f9ec5d4b33}
+ ATmega128
+ none
+ Executable
+ C
+ $(MSBuildProjectName)
+ .elf
+ $(MSBuildProjectDirectory)\$(Configuration)
+ ultrasonicSensor
+ ultrasonicSensor
+ ultrasonicSensor
+ Native
+ true
+ false
+ true
+ true
+
+
+ true
+
+ 2
+ 0
+ 0
+
+
+
+
+
+ -mmcu=atmega128 -B "%24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\gcc\dev\atmega128"
+ True
+ True
+ True
+ True
+ True
+ False
+ True
+ True
+
+
+ NDEBUG
+
+
+
+
+ %24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\include\
+
+
+ Optimize for size (-Os)
+ True
+ True
+ True
+
+
+ libm
+
+
+
+
+ %24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\include\
+
+
+
+
+
+
+
+
+ -mmcu=atmega128 -B "%24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\gcc\dev\atmega128"
+ True
+ True
+ True
+ True
+ True
+ False
+ True
+ True
+
+
+ DEBUG
+
+
+
+
+ %24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\include\
+
+
+ Optimize debugging experience (-Og)
+ True
+ True
+ Default (-g2)
+ True
+
+
+ libm
+
+
+
+
+ %24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\include\
+
+
+ Default (-Wa,-g)
+
+
+
+
+
+ compile
+
+
+ compile
+
+
+ compile
+
+
+
+
\ No newline at end of file