Browse Source

Erstellen des Hauptprojektes

fstange 7 years ago
parent
commit
4ae5ec1413

+ 63 - 0
.gitattributes

@@ -0,0 +1,63 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs     diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following 
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln       merge=binary
+#*.csproj    merge=binary
+#*.vbproj    merge=binary
+#*.vcxproj   merge=binary
+#*.vcproj    merge=binary
+#*.dbproj    merge=binary
+#*.fsproj    merge=binary
+#*.lsproj    merge=binary
+#*.wixproj   merge=binary
+#*.modelproj merge=binary
+#*.sqlproj   merge=binary
+#*.wwaproj   merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg   binary
+#*.png   binary
+#*.gif   binary
+
+###############################################################################
+# diff behavior for common document formats
+# 
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the 
+# entries below.
+###############################################################################
+#*.doc   diff=astextplain
+#*.DOC   diff=astextplain
+#*.docx  diff=astextplain
+#*.DOCX  diff=astextplain
+#*.dot   diff=astextplain
+#*.DOT   diff=astextplain
+#*.pdf   diff=astextplain
+#*.PDF   diff=astextplain
+#*.rtf   diff=astextplain
+#*.RTF   diff=astextplain

+ 261 - 0
.gitignore

@@ -0,0 +1,261 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+
+# User-specific files
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+
+# Visual Studio 2015 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUNIT
+*.VisualState.xml
+TestResult.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# DNX
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+*_i.c
+*_p.c
+*_i.h
+*.ilk
+*.meta
+*.obj
+*.pch
+*.pdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# JustCode is a .NET coding add-in
+.JustCode
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# TODO: Comment the next line if you want to checkin your web deploy settings
+# but database connection strings (with potential passwords) will be unencrypted
+#*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# The packages folder can be ignored because of Package Restore
+**/packages/*
+# except build/, which is used as an MSBuild target.
+!**/packages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/packages/repositories.config
+# NuGet v3's project.json files produces more ignoreable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+node_modules/
+orleans.codegen.cs
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+
+# SQL Server files
+*.mdf
+*.ldf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# JetBrains Rider
+.idea/
+*.sln.iml
+
+# CodeRush
+.cr/
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc

+ 127 - 0
Zumo32U4/Hauptprojekt/Hauptprojekt.ino

@@ -0,0 +1,127 @@
+//Verfassser: Felix Stange MET2016
+//Datum: 09.04.2017
+//Projekt: Der Zumo fährt automatisch. Dabei vermeidet er Kollisionen mit der Umgebung durch Nutzung der Abstandssensoren 
+//(links, vorne, rechts). Kommt es dennoch zu einer Kollision, wird diese durch die Beschleunigungssensoren erkannt. 
+
+#include <Wire.h>
+#include <Zumo32U4.h>
+
+Zumo32U4ProximitySensors proxSensors;
+Zumo32U4Motors motors;
+Zumo32U4LCD lcd;
+Zumo32U4ButtonA buttonA;
+LSM303 compass;
+
+uint8_t proxLeft;
+uint8_t proxFrontLeft;
+uint8_t proxFrontRight;
+uint8_t proxFront;
+uint8_t proxRight;
+uint8_t maxspeed = 200;
+char dir;
+
+int8_t acc;
+
+char report[120];
+
+void setup()
+{
+	lcd.clear();
+	lcd.print("Press A");
+	lcd.gotoXY(0, 1);
+	lcd.print("to start");
+	buttonA.waitForButton();
+	delay(500);
+	proxSensors.initThreeSensors();
+
+	Wire.begin();
+	compass.init();
+	compass.enableDefault();
+}
+
+void loop()
+{
+	ledGreen(0);
+	ledYellow(0);
+	ledRed(0);
+
+	proxSensors.read();
+	proxLeft = proxSensors.countsLeftWithLeftLeds();
+	proxFrontLeft = proxSensors.countsFrontWithLeftLeds();
+	proxFrontRight = proxSensors.countsFrontWithRightLeds();
+	proxRight = proxSensors.countsRightWithRightLeds();
+
+	compass.read();
+	acc = compass.a.x;
+
+	if ((proxFrontLeft > 4) && (proxFrontLeft > proxFrontRight))
+	{
+		motors.setLeftSpeed(maxspeed);
+		motors.setRightSpeed(0);
+		ledRed(1);
+		dir = 'R';
+		delay(100);
+	}
+	else if ((proxFrontRight > 4) && (proxFrontLeft < proxFrontRight))
+	{
+		motors.setLeftSpeed(0);
+		motors.setRightSpeed(maxspeed);
+		ledRed(1);
+		dir = 'L';
+		delay(100);
+	}
+	else if (((proxFrontRight > 5) && (proxFrontLeft > 5)) || (abs(acc) > 1000))
+	{
+		motors.setLeftSpeed(-maxspeed / 2);
+		motors.setRightSpeed(-maxspeed / 2);
+		ledRed(1);
+		dir = 'B';
+		delay(200);
+		motors.setLeftSpeed(0);
+		motors.setRightSpeed(-maxspeed / 2);
+		delay(200);
+	}
+	else if ((proxLeft > 4) && (proxLeft > proxRight))
+	{
+		motors.setLeftSpeed(maxspeed);
+		motors.setRightSpeed(maxspeed / 2);
+		ledYellow(1);
+		dir = 'r';
+		delay(100);
+	}
+	else if (proxRight > 4)
+	{
+		motors.setLeftSpeed(maxspeed / 2);
+		motors.setRightSpeed(maxspeed);
+		ledYellow(1);
+		dir = 'l';
+		delay(100);
+	}
+	else
+	{
+		motors.setLeftSpeed(maxspeed);
+		motors.setRightSpeed(maxspeed);
+		ledGreen(1);
+		dir = 'F';
+		delay(100);
+	}
+
+	proxFront = (proxFrontLeft + proxFrontRight) / 2;
+
+	lcd.clear();
+	lcd.print("L");
+	lcd.print(proxLeft);
+	lcd.print(" F");
+	lcd.print(proxFront);
+	lcd.print(" R");
+	lcd.print(proxRight);
+	lcd.gotoXY(0, 1);
+	lcd.print("Dir ");
+	lcd.print(dir);
+
+	snprintf_P(report, sizeof(report),
+		PSTR("Abstand: %6d %6d %6d %6d   Richtung: %6c   Beschleunigung: %6d"),
+		proxLeft, proxFrontLeft, proxFrontRight, proxRight,
+		dir, acc);
+	Serial.println(report);
+}

File diff suppressed because it is too large
+ 90 - 0
Zumo32U4/Hauptprojekt/Hauptprojekt.vcxproj


+ 25 - 0
Zumo32U4/Hauptprojekt/Hauptprojekt.vcxproj.filters

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="Hauptprojekt.ino" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="__vm\.Hauptprojekt.vsarduino.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+</Project>

+ 22 - 0
Zumo32U4/Hauptprojekt/Zumo32U4.sln

@@ -0,0 +1,22 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.26430.12
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Hauptprojekt", "Hauptprojekt\Hauptprojekt.vcxproj", "{C5F80730-F44F-4478-BDAE-6634EFC2CA88}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|x86 = Debug|x86
+		Release|x86 = Release|x86
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{C5F80730-F44F-4478-BDAE-6634EFC2CA88}.Debug|x86.ActiveCfg = Debug|Win32
+		{C5F80730-F44F-4478-BDAE-6634EFC2CA88}.Debug|x86.Build.0 = Debug|Win32
+		{C5F80730-F44F-4478-BDAE-6634EFC2CA88}.Release|x86.ActiveCfg = Release|Win32
+		{C5F80730-F44F-4478-BDAE-6634EFC2CA88}.Release|x86.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

+ 83 - 0
Zumo32U4/Hauptprojekt/__vm/.Hauptprojekt.vsarduino.h

@@ -0,0 +1,83 @@
+/* 
+	Editor: http://www.visualmicro.com
+			visual micro and the arduino ide ignore this code during compilation. this code is automatically maintained by visualmicro, manual changes to this file will be overwritten
+			the contents of the Visual Micro sketch sub folder can be deleted prior to publishing a project
+			all non-arduino files created by visual micro and all visual studio project or solution files can be freely deleted and are not required to compile a sketch (do not delete your own code!).
+			note: debugger breakpoints are stored in '.sln' or '.asln' files, knowledge of last uploaded breakpoints is stored in the upload.vmps.xml file. Both files are required to continue a previous debug session without needing to compile and upload again
+	
+	Hardware: Pololu A-Star 32U4, Platform=avr, Package=pololu
+*/
+
+#if defined(_VMICRO_INTELLISENSE)
+
+#ifndef _VSARDUINO_H_
+#define _VSARDUINO_H_
+#define __AVR_ATmega32u4__
+#define __AVR_ATmega32U4__
+#define F_CPU 16000000L
+#define ARDUINO 10802
+#define ARDUINO_AVR_A_STAR_32U4
+#define ARDUINO_ARCH_AVR
+#define USB_VID 0x1ffb
+#define USB_PID 0x2300
+#define __cplusplus 201103L
+#define __AVR__
+#define __inline__
+#define __asm__(...)
+#define __extension__
+#define __inline__
+#define __volatile__
+#define GCC_VERSION 40902
+
+#define __cplusplus 201103L
+#undef __cplusplus
+#define __cplusplus 201103L
+
+#define volatile(va_arg) 
+#define _CONST
+#define __builtin_va_start
+#define __builtin_va_end
+#define __attribute__(...)
+#define NOINLINE __attribute__((noinline))
+#define prog_void
+#define PGM_VOID_P int
+
+
+#ifndef __builtin_constant_p
+	#define __builtin_constant_p __attribute__((__const__))
+#endif
+#ifndef __builtin_strlen
+	#define __builtin_strlen  __attribute__((__const__))
+#endif
+
+
+#define NEW_H
+typedef void *__builtin_va_list;
+//extern "C" void __cxa_pure_virtual() {;}
+
+typedef int div_t;
+typedef int ldiv_t;
+
+
+typedef void *__builtin_va_list;
+//extern "C" void __cxa_pure_virtual() {;}
+
+
+
+#include <arduino.h>
+#include <pins_arduino.h> 
+#undef F
+#define F(string_literal) ((const PROGMEM char *)(string_literal))
+#undef PSTR
+#define PSTR(string_literal) ((const PROGMEM char *)(string_literal))
+
+
+#define pgm_read_byte(address_short) uint8_t() 
+#define pgm_read_word(address_short) uint16_t() 
+#define pgm_read_dword(address_short) uint32_t()
+#define pgm_read_float(address_short) float()
+#define pgm_read_ptr(address_short)   short()
+
+#include "Hauptprojekt.ino"
+#endif
+#endif