GithubHelp home page GithubHelp logo

sentrygun53 / project-sentry-gun Goto Github PK

View Code? Open in Web Editor NEW
205.0 54.0 106.0 9.02 MB

This is an open-scource code project from Rudolph Labs. See the website for more information. Initiated by Bob Rudolph (sentryGun53) [email protected], [email protected]

Home Page: http://psg.rudolphlabs.com/

Arduino 0.79% Processing 2.76% CSS 0.15% Java 25.07% JavaScript 0.03% C++ 0.01% HTML 71.19%

project-sentry-gun's Introduction

project-sentry-gun's People

Contributors

neilbalch avatar sentrygun53 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

project-sentry-gun's Issues

I have a issue with the code for arduino

When I verify it, in the end it pops up with this error:

exit status 1
Error compiling for board Arduino/Genuino Uno.

And if you scroll up I see this message:

c:\users\devizes\documents\my documents\arduino-1.8.5\hardware\tools\avr\bin../lib/gcc/avr/4.9.2/../../../../avr/bin/ar.exe: unable to rename 'core\core.a'; reason: File exists

Can you please help me with this error?
Thanks.

Copyright violation in media

/Processing/PSG_Processing_Code/data folder contains a bunch of sound files ripped from the game "Portal" by Valve. Possible fodder for a copyright violation claim or lawsuit.

A new hobbiest In Peril, Arduino compile warning.

I can appreciate this project is a few years old now but I'm desperate for help. when I originally compiled the code it was error free, now when I compile it I receive the following warning:

C:\Users\Allri\Desktop\Project-Sentry-Gun-master\Arduino\PSG_Arduino_Code\Backup.ino: In function 'backup()':

C:\Users\Allri\Desktop\Project-Sentry-Gun-master\Arduino\PSG_Arduino_Code\Backup.ino:59:47: warning: iteration 200 invokes undefined behavior [-Waggressive-loop-optimizations]

for (int z=0;z<=200;z++) BufferSerie[z]='\0';

                                           ^

C:\Users\Allri\Desktop\Project-Sentry-Gun-master\Arduino\PSG_Arduino_Code\Backup.ino:59:3: note: containing loop

for (int z=0;z<=200;z++) BufferSerie[z]='\0';

^

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino\main.cpp: In function 'main':

C:\Users\Allri\Desktop\Project-Sentry-Gun-master\Arduino\PSG_Arduino_Code\Backup.ino:59:47: warning: iteration 200 invokes undefined behavior [-Waggressive-loop-optimizations]

for (int z=0;z<=200;z++) BufferSerie[z]='\0';

                                           ^

C:\Users\Allri\Desktop\Project-Sentry-Gun-master\Arduino\PSG_Arduino_Code\Backup.ino:59:3: note: containing loop

for (int z=0;z<=200;z++) BufferSerie[z]='\0';

^

I am still very new to this, is anyone able to please help me understand the problem. Thank you :)

Timing issue in the Arduino code

I'm trying to make some modifications to the code to let me limit how often the PSG can fire, and then some modifications for very specifically how long the (electronic) trigger will hold, and I believe I've found a code/timing issue.

Arduino uses millis() for timing, to determine how long between events.

However, the PSG Arduino Fire function uses a raw counter (fireTimer++) to calculate how long the trigger has been held down. this same counter is used to determine how often to increment the ammo.

Took me a while to figure out, because triggerTravelMillis is named like it's associated with usage of the millis() function. But it's not. Instead it's compared to values of the fireTimer counter.

This will make the code VERY sensitive to the hardware it's running on, as the code is using number of loops through the code, not time, to determine what to do.

It also means if you're trying to get the timing exactly right for how long the trigger is held down (as I need to, because the electronic system I'm using needs ~ 150 ms of the trigger held down to fire correctly) it's a lot harder.

Here's the code I'm referencing. fireTimer should really be using millis() time. Instead, it's just reset to 0 and starts over:
if(selector == 1) { fireTimer++; if(fireTimer >=0 && fireTimer <= triggerTravelMillis) { digitalWrite(electricTriggerPin, HIGH); trigger.write(triggerServo_SqueezedPosition); digitalWrite(firingIndicatorLEDPin, HIGH); } if(fireTimer > triggerTravelMillis && fireTimer < 1.5*triggerTravelMillis) { digitalWrite(electricTriggerPin, LOW); trigger.write(triggerServo_HomePosition); digitalWrite(firingIndicatorLEDPin, LOW); } if(fireTimer >= 1.5*triggerTravelMillis) { fireTimer = 0; if(useAmmoCounter) { shotCounter++; // increment the shot counter } }

Please add a LICENSE file

Would be useful to follow the convention of adding a LICENSE file int he root of the repo, so we know if / how we can use your code...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.