Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexGyver committed Jul 28, 2019
1 parent fe4cfe8 commit bab4a7c
Show file tree
Hide file tree
Showing 51 changed files with 1,058 additions and 251 deletions.
Binary file added 1releases/GyverButton.zip
Binary file not shown.
Binary file added 1releases/GyverEncoder.zip
Binary file not shown.
Binary file added 1releases/GyverFilters.zip
Binary file not shown.
Binary file added 1releases/GyverHacks.zip
Binary file not shown.
Binary file added 1releases/GyverMotor.zip
Binary file not shown.
Binary file added 1releases/GyverPID.zip
Binary file not shown.
Binary file added 1releases/GyverPWM.zip
Binary file not shown.
Binary file added 1releases/GyverRGB.zip
Binary file not shown.
Binary file added 1releases/GyverRTOS.zip
Binary file not shown.
Binary file added 1releases/GyverRelay.zip
Binary file not shown.
Binary file added 1releases/GyverTM1637.zip
Binary file not shown.
Binary file added 1releases/GyverTimer.zip
Binary file not shown.
Binary file added 1releases/GyverTimer012.zip
Binary file not shown.
Binary file added 1releases/ServoSmooth.zip
Binary file not shown.
Binary file added 1releases/minimLibs.zip
Binary file not shown.
50 changes: 25 additions & 25 deletions GyverButton/keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,43 @@
# Datatypes (KEYWORD1)
#######################################

GButton KEYWORD1
GyverButton KEYWORD1
GButton KEYWORD1
GyverButton KEYWORD1

#######################################
# Methods and Functions (KEYWORD2)
#######################################

setDebounce KEYWORD2
setTimeout KEYWORD2
setDebounce KEYWORD2
setTimeout KEYWORD2
setStepTimeout KEYWORD2
setClickTimeout KEYWORD2
setType KEYWORD2
setType KEYWORD2
setDirection KEYWORD2
setTickMode KEYWORD2
setTickMode KEYWORD2

tick KEYWORD2
isPress KEYWORD2
isRelease KEYWORD2
isClick KEYWORD2
isHolded KEYWORD2
isHold KEYWORD2
state KEYWORD2
tick KEYWORD2
isPress KEYWORD2
isRelease KEYWORD2
isClick KEYWORD2
isHolded KEYWORD2
isHold KEYWORD2
state KEYWORD2

hasClicks KEYWORD2
getClicks KEYWORD2
isSingle KEYWORD2
isDouble KEYWORD2
isTriple KEYWORD2
isStep KEYWORD2
hasClicks KEYWORD2
getClicks KEYWORD2
isSingle KEYWORD2
isDouble KEYWORD2
isTriple KEYWORD2
isStep KEYWORD2

#######################################
# Constants (LITERAL1)
#######################################

HIGH_PULL LITERAL1
LOW_PULL LITERAL1
NORM_OPEN LITERAL1
NORM_CLOSE LITERAL1
MANUAL LITERAL1
AUTO LITERAL1
HIGH_PULL LITERAL1
LOW_PULL LITERAL1
NORM_OPEN LITERAL1
NORM_CLOSE LITERAL1
MANUAL LITERAL1
AUTO LITERAL1
42 changes: 21 additions & 21 deletions GyverEncoder/keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,39 @@
# Datatypes (KEYWORD1)
#######################################

Encoder KEYWORD1
Encoder KEYWORD1
GyverEncoder KEYWORD1

#######################################
# Methods and Functions (KEYWORD2)
#######################################

tick KEYWORD2
setType KEYWORD2
tick KEYWORD2
setType KEYWORD2
setDirection KEYWORD2
setFastTimeout KEYWORD2
isTurn KEYWORD2
isRight KEYWORD2
isLeft KEYWORD2
isRightH KEYWORD2
isLeftH KEYWORD2
isFastR KEYWORD2
isFastL KEYWORD2
isTurn KEYWORD2
isRight KEYWORD2
isLeft KEYWORD2
isRightH KEYWORD2
isLeftH KEYWORD2
isFastR KEYWORD2
isFastL KEYWORD2

isPress KEYWORD2
isRelease KEYWORD2
isClick KEYWORD2
isHolded KEYWORD2
isHold KEYWORD2
isPress KEYWORD2
isRelease KEYWORD2
isClick KEYWORD2
isHolded KEYWORD2
isHold KEYWORD2
fast_timeout KEYWORD2

#######################################
# Constants (LITERAL1)
#######################################

TYPE1 LITERAL1
TYPE2 LITERAL1
MANUAL LITERAL1
AUTO LITERAL1
NORM LITERAL1
REVERSE LITERAL1
TYPE1 LITERAL1
TYPE2 LITERAL1
MANUAL LITERAL1
AUTO LITERAL1
NORM LITERAL1
REVERSE LITERAL1
24 changes: 12 additions & 12 deletions GyverFilters/keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@
#######################################

GyverFilters KEYWORD1
GFilterRA KEYWORD1
GMedian3 KEYWORD1
GMedian KEYWORD1
GABfilter KEYWORD1
GKalman KEYWORD1
GLinear KEYWORD1
GFilterRA KEYWORD1
GMedian3 KEYWORD1
GMedian KEYWORD1
GABfilter KEYWORD1
GKalman KEYWORD1
GLinear KEYWORD1

#######################################
# Methods and Functions (KEYWORD2)
#######################################

setCoef KEYWORD2
setStep KEYWORD2
setCoef KEYWORD2
setStep KEYWORD2
filteredTime KEYWORD2
filtered KEYWORD2
filtered KEYWORD2
setParameters KEYWORD2
getA KEYWORD2
getB KEYWORD2
getDelta KEYWORD2
getA KEYWORD2
getB KEYWORD2
getDelta KEYWORD2
28 changes: 14 additions & 14 deletions GyverHacks/GyverHacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@ Timer 1 (пины 9 и 10) (ВЛИЯЕТ НА РАБОТУ servo)
Timer 2 (пины 3 и 11) (ВЛИЯЕТ НА РАБОТУ tone())
*/
/*
____________________________________________________________________________________________
| Timer 0 (пины 5 и 6) | Timer 1 (пины 9 и 10) | Timer 2 (пины 3 и 11) |
| Timer 1 (пины 9 и 10) | в режиме 10 bit | |
____|___________________________|_______________________________|___________________________|
mode| Phase-correct | Fast PWM | Phase-correct | Fast PWM | Phase-correct | Fast PWM |
____|_______________|___________|___________________|___________|_______________|___________|
1 | 31.4 kHz | 62.5 kHz | 7.8 kHz | 15.6 kHz | 31.4 kHz | 62.5 kHz |
2 | 4 kHz | 7.8 kHz | 977 Hz | 2 kHz | 4 kHz | 8 kHz |
3 | 490 Hz | 976 Hz | 122 Hz | 244 Hz | 980 Hz | 2 kHz |
4 | 122 Hz | 244 Hz | 30 Hz | 61 Hz | 490 Hz | 980 Hz |
5 | 30 Hz | 61 Hz | 7.6 Hz | 15 Hz | 245 Hz | 490 Hz |
6 | - | - | - | - | 122 Hz | 244 Hz |
7 | - | - | - | - | 30 Hz | 60 Hz |
____|_______________|___________|___________________|___________|_______________|___________|
_______________________________________________________________________________________________
| | Timer 0 (пины 5 и 6) | Timer 1 (пины 9 и 10) | Timer 2 (пины 3 и 11) |
| | Timer 1 (пины 9 и 10) | в режиме 10 bit | |
| |___________________________|_______________________________|___________________________|
|mode | Phase-correct | Fast PWM | Phase-correct | Fast PWM | Phase-correct | Fast PWM |
|_______|_______________|___________|___________________|___________|_______________|___________|
|1 | 31.4 kHz | 62.5 kHz | 7.8 kHz | 15.6 kHz | 31.4 kHz | 62.5 kHz |
|2 | 4 kHz | 7.8 kHz | 977 Hz | 2 kHz | 4 kHz | 8 kHz |
|3 | 490 Hz | 976 Hz | 122 Hz | 244 Hz | 980 Hz | 2 kHz |
|4 | 122 Hz | 244 Hz | 30 Hz | 61 Hz | 490 Hz | 980 Hz |
|5 | 30 Hz | 61 Hz | 7.6 Hz | 15 Hz | 245 Hz | 490 Hz |
|6 | - | - | - | - | 122 Hz | 244 Hz |
|7 | - | - | - | - | 30 Hz | 60 Hz |
|_______|_______________|___________|___________________|___________|_______________|___________|
*/

Expand Down
47 changes: 22 additions & 25 deletions GyverHacks/keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,53 +5,50 @@
#######################################
# Datatypes (KEYWORD1)
#######################################

GyverHacks KEYWORD1


#######################################
# Methods and Functions (KEYWORD2)
#######################################

setPin KEYWORD2
readPin KEYWORD2
setPWM KEYWORD2
setADCrate KEYWORD2
setPin KEYWORD2
readPin KEYWORD2
setPWM KEYWORD2
setADCrate KEYWORD2

anyPWMinit KEYWORD2
anyPWMset KEYWORD2
anyPWM KEYWORD2
anyPWMinit KEYWORD2
anyPWMset KEYWORD2
anyPWM KEYWORD2

set8bitPWM KEYWORD2
set10bitPWM KEYWORD2
set8bitPWM KEYWORD2
set10bitPWM KEYWORD2
setPWMprescaler KEYWORD2
setPWMmode KEYWORD2
setPWMmode KEYWORD2

delayFix KEYWORD2
delayFix KEYWORD2
delayMicrosecondsFix KEYWORD2
millisFix KEYWORD2
microsFix KEYWORD2
millisFix KEYWORD2
microsFix KEYWORD2

getVCC KEYWORD2
getVoltage KEYWORD2
getVCC KEYWORD2
getVoltage KEYWORD2
constantWizard KEYWORD2
restoreConstant KEYWORD2
setConst KEYWORD2
getConst KEYWORD2
setConst KEYWORD2
getConst KEYWORD2

lithiumPercent KEYWORD2
alkaline3Percent KEYWORD2
nickel3Percent KEYWORD2
nickel4Percent KEYWORD2
mVtoPercent KEYWORD2
mVtoPercent KEYWORD2

getTemp KEYWORD2
getTemp KEYWORD2

parsingStream KEYWORD2
sendPacket KEYWORD2
dataReady KEYWORD2
sendPacket KEYWORD2
dataReady KEYWORD2

#######################################
# Constants (LITERAL1)
#######################################

#######################################
18 changes: 9 additions & 9 deletions GyverMotor/keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@
# Datatypes (KEYWORD1)
#######################################

GMotor KEYWORD1
GMotor KEYWORD1
GyverMotor KEYWORD1

#######################################
# Methods and Functions (KEYWORD2)
#######################################

setSpeed KEYWORD2
setSpeed KEYWORD2
setSpeed10bit KEYWORD2
setMode KEYWORD2
setMode KEYWORD2
setDirection KEYWORD2

PWM10bit KEYWORD2
PWM10bit KEYWORD2
PWMfrequency KEYWORD2

FORWARD LITERAL1
BACKWARD LITERAL1
STOP LITERAL1
NORM LITERAL1
REVERSE LITERAL1
FORWARD LITERAL1
BACKWARD LITERAL1
STOP LITERAL1
NORM LITERAL1
REVERSE LITERAL1
30 changes: 15 additions & 15 deletions GyverPID/keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,32 @@
# Datatypes (KEYWORD1)
#######################################

GyverPID KEYWORD1
GyverPID KEYWORD1

#######################################
# Methods and Functions (KEYWORD2)
#######################################

setpoint KEYWORD2
input KEYWORD2
output KEYWORD2
kp KEYWORD2
ki KEYWORD2
kd KEYWORD2
setpoint KEYWORD2
input KEYWORD2
output KEYWORD2
kp KEYWORD2
ki KEYWORD2
kd KEYWORD2

getResult KEYWORD2
getResult KEYWORD2
getResultTimer KEYWORD2

setDirection KEYWORD2
setMode KEYWORD2
setLimits KEYWORD2
setDt KEYWORD2
setMode KEYWORD2
setLimits KEYWORD2
setDt KEYWORD2

#######################################
# Constants (LITERAL1)
#######################################

NORMAL LITERAL1
REVERSE LITERAL1
ON_ERROR LITERAL1
ON_RATE LITERAL1
NORMAL LITERAL1
REVERSE LITERAL1
ON_ERROR LITERAL1
ON_RATE LITERAL1
7 changes: 6 additions & 1 deletion GyverPWM/GyverPWM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,20 +564,25 @@ void PWM_20KHZ_D10(int duty) {
OCR1BL = lowByte(duty);
}

void PWM_square_D9(float frequency) {
float PWM_square_D9(float frequency) {
uint32_t top;
float realF;
TCCR1A = 0b01010000;
TCCR1C = 0b01000000;
if (frequency < 16) {
TCCR1B = 0b00011011;
top = (float)250000 / frequency / 2 - 1;
realF = (float)250000 / 2 / (1 + top);
} else if (frequency < 125) {
TCCR1B = 0b00011010;
top = (float)2000000 / frequency / 2 - 1;
realF = (float)2000000 / 2 / (1 + top);
} else {
TCCR1B = 0b00011001;
top = (float)16000000 / frequency / 2 - 1;
realF = (float)16000000 / 2 / (1 + top);
}
ICR1H = highByte(top);
ICR1L = lowByte(top);
return realF;
}
Loading

0 comments on commit bab4a7c

Please sign in to comment.