Merge branch 'master' of https://github.com/pyr0ball/pyr0piezo
This commit is contained in:
commit
1004840020
6 changed files with 575 additions and 564 deletions
|
|
@ -3,16 +3,24 @@
|
|||
Created by Alan "pyr0ball" Weinstock 6/26/2019
|
||||
*/
|
||||
|
||||
void digitalWriteFast(uint8_t pin, uint8_t x) {
|
||||
if (pin / 8) { // pin >= 8
|
||||
PORTB ^= (-x ^ PORTB) & (1 << (pin % 8));
|
||||
}
|
||||
else {
|
||||
PORTD ^= (-x ^ PORTD) & (1 << (pin % 8));
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------*/
|
||||
|
||||
void pulse() {
|
||||
digitalWrite(TRG_OUT, LOW);
|
||||
digitalWriteFast(TRG_OUT, LOW);
|
||||
sensorHReading = 1;
|
||||
delay(TRG_DUR);
|
||||
digitalWrite(TRG_OUT, HIGH);
|
||||
digitalWriteFast(TRG_OUT, HIGH);
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------*/
|
||||
|
||||
long readVcc() {
|
||||
|
|
|
|||
|
|
@ -38,3 +38,6 @@ bool readInProgress = false;
|
|||
bool serialIncoming = false;
|
||||
char serialMessageIn[buffSize] = {0};
|
||||
int serialInt = 0;
|
||||
|
||||
#define LOW 0
|
||||
#define HIGH 1
|
||||
Loading…
Reference in a new issue