Compare commits

...

12 Commits

Author SHA1 Message Date
Scott Allen bc460a2cff Fix typo in invert() function documentation 2023-08-14 14:59:19 -04:00
Scott Allen ca1c3ae024 Fix links to duration variable in BeepPin1 docs 2022-06-05 13:58:01 -04:00
Scott Allen 031e9164aa
Merge pull request #71 from Pharap/make-cabi-cpp-compatible
Make cabi C++ compatible
2022-05-01 10:38:18 -04:00
Pharap 7f456cff69
Make cabi C++ compatible
Casting the result of these calls to malloc should be all that is required to make cabi compilable as C++.
Without these casts cabi won't compile as C++ because in C++ `void *` is not implicitly convertible to other data types.
LodePNG already has C++ compatibility.
2022-05-01 08:41:41 +01:00
Scott Allen 2374247788
Merge pull request #63 from ace-dent/PR0626-Contributing
Clarify Contribution style requirements
2021-07-01 18:02:43 -04:00
Scott Allen 98afc7229f
Merge pull request #62 from ace-dent/PR0625-Typos
Fix typos in a few places
2021-07-01 17:57:11 -04:00
Scott Allen 4f0d802d50
Merge pull request #57 from ace-dent/PR0930-OptimizePNG
Optimize png images
2021-07-01 17:55:48 -04:00
Andrew Dent ccedf84434 Clarify Contribution style requirements
Add examples to give clear guidance (and a reminder),
of commit message style requirements.
2021-06-26 00:18:59 +01:00
Andrew Dent 279fd9d0f4 Fix typos in a few places
Pedantic tweaks:

- Fix spellings in a few places.

- Update License copyright year.
2021-06-26 00:13:05 +01:00
Scott Allen 36cbdc734c Fix typo in fillScreen() C++ equivalent code 2021-06-05 07:37:01 -04:00
Scott Allen ab4df7c77a Remove register keywords 2021-04-16 08:47:32 -04:00
Andrew Dent b4b4d45009 Optimize png images
The project’s images have been run through lossless optimization.
It will not affect the project but saves a few bytes for each
download of the repository.
See: https://github.com/ace-dent/pngslim
2020-09-30 11:41:46 +01:00
17 changed files with 53 additions and 29 deletions

View File

@ -1,7 +1,30 @@
# Commit message style
When submitting changes via a pull request, or any other means, please format commit messages using ["50/72" guidelines, as suggested by Tim Pope](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
Summary:
## Summary:
- Maximum 50 character first "title" line, written as a capitalized [imperative sentence](http://examples.yourdictionary.com/imperative-sentence-examples.html).
- If necessary, more detailed explanatory paragraphs following a blank line, with lines wrapped at maximum 72 characters.
- If used, bullet points have a "hanging indent".
## Example 1:
```
Make state variables used by pollButtons() public
The variables currentButtonState and previousButtonState used by
pollButtons(), justPressed() and justReleased() have been made public.
This allows them to be manipulated if circumstances require it.
The documentation added for previousButtonState includes an example.
```
## Example 2:
```
Refactor text code and add char size functions
- Functions write() and drawChar() were refactored for smaller code
size and to make text wrapping operate more like what would normally
be expected.
- A new flag variable, textRaw, has been added, along with functions
setTextRawMode() and getTextRawMode() to set and read it.
```

View File

@ -8,7 +8,7 @@ Software License Agreements
Licensed under the BSD 3-clause license:
Arduboy2 library:
Copyright (c) 2016-2020, Scott Allen
Copyright (c) 2016-2021, Scott Allen
All rights reserved.
The Arduboy2 library was forked from the Arduboy library:
@ -18,7 +18,8 @@ Copyright (c) 2016, Chris Martinez
Copyright (c) 2016, Josh Goebel
Copyright (c) 2016, Scott Allen
All rights reserved.
which is in turn partially based on the Adafruit_SSD1306 library
- which is in turn partially based on the Adafruit_SSD1306 library
https://github.com/adafruit/Adafruit_SSD1306
Copyright (c) 2012, Adafruit Industries
All rights reserved.

View File

@ -428,7 +428,7 @@ Arduboy2 arduboy;
ArduboyPlaytune tunes(arduboy.audio.enabled);
```
The sound channels must then be initialzed and assigned to the speaker pins. This code would go in the *setup()* function:
The sound channels must then be initialized and assigned to the speaker pins. This code would go in the *setup()* function:
```cpp
// audio setup

View File

@ -271,7 +271,7 @@ void moveBall()
topBrick = 6 * row + 1;
bottomBrick = 6 * row + 7;
//If A collison has occured
//If A collision has occurred
if (topBall <= bottomBrick && bottomBall >= topBrick &&
leftBall <= rightBrick && rightBall >= leftBrick)
{
@ -293,7 +293,7 @@ void moveBall()
}
}
//Hoizontal collision
//Horizontal collision
if (leftBall < leftBrick || rightBall > rightBrick)
{
//Only bounce once brick each ball move
@ -459,7 +459,7 @@ boolean pollFireButton(int n)
return false;
}
//Function by nootropic design to display highscores
//Function by nootropic design to display high scores
boolean displayHighScores(byte file)
{
byte y = 8;
@ -736,14 +736,14 @@ void enterHighScore(byte file)
}
}
// Play a tone at a frequency coresponding to the specified precomputed count,
// Play a tone at a frequency corresponding to the specified precomputed count,
// for the specified number of frames.
void playTone(uint16_t count, uint8_t frames)
{
beep.tone(count, frames);
}
// Play a tone at a frequency coresponding to the specified precomputed count,
// Play a tone at a frequency corresponding to the specified precomputed count,
// for the specified duration in milliseconds, using a delay.
// Used when beep.timer() isn't being called.
void playToneTimed(uint16_t count, uint16_t duration)

View File

@ -22,10 +22,10 @@ char title[] = "Press Buttons!";
byte x;
byte y;
// Width of each charcter including inter-character space
// Width of each character including inter-character space
#define CHAR_WIDTH 6
// Height of each charater
// Height of each character
#define CHAR_HEIGHT 8
// To get the number of characters, we subtract 1 from the length of
@ -49,7 +49,7 @@ void setup() {
//initiate arduboy instance
arduboy.begin();
// here we set the framerate to 30, we do not need to run at default 60 and
// here we set the frame rate to 30, we do not need to run at default 60 and
// it saves us battery life.
arduboy.setFrameRate(30);
@ -101,6 +101,6 @@ void loop() {
// then we print to screen what is stored in our title variable we declared earlier
arduboy.print(title);
// then we finaly we tell the arduboy to display what we just wrote to the display.
// then we finally we tell the arduboy to display what we just wrote to the display.
arduboy.display();
}

View File

@ -1,4 +1,4 @@
Buttons
=======
A an example that demonstrates how to capture input from the buttons.
An example that demonstrates how to capture input from the buttons.

View File

@ -23,7 +23,7 @@ void setup() {
// initiate arduboy instance
arduboy.begin();
// here we set the framerate to 15, we do not need to run at
// here we set the frame rate to 15, we do not need to run at
// default 60 and it saves us battery life
arduboy.setFrameRate(15);
}
@ -46,6 +46,6 @@ void loop() {
// then we print to screen what is in the Quotation marks ""
arduboy.print(F("Hello, world!"));
// then we finaly we tell the arduboy to display what we just wrote to the display
// then we finally we tell the arduboy to display what we just wrote to the display
arduboy.display();
}

View File

@ -321,7 +321,7 @@ void drawBar(int y, Color color, byte value) {
}
}
// Draw the informaton for one digital color
// Draw the information for one digital color
void drawDigital(int y, Color color, const char* name) {
byte state = digitalState[(byte)color];

View File

@ -675,7 +675,7 @@ void screenSaveID() {
printIDLarge(ID_SAVE_X, ID_SAVE_Y);
}
// DISPLAY: Propmt to reset the system EEPROM area
// DISPLAY: Prompt to reset the system EEPROM area
void screenResetSys() {
printStr_P(RESET_SYS_TEXT_1_X, RESET_SYS_TEXT_1_Y, StrResetSys1);
printStr_P(RESET_SYS_TEXT_2_X, RESET_SYS_TEXT_2_Y, StrResetSys2);
@ -685,7 +685,7 @@ void screenResetSys() {
printStr_P(RESET_SYS_BTN_NO_X, RESET_SYS_BTN_NO_Y, StrBtnResetNo);
}
// DISPLAY: Propmt to reset the user EEPROM area
// DISPLAY: Prompt to reset the user EEPROM area
void screenResetUser() {
printStr_P(RESET_USER_TEXT_1_X, RESET_USER_TEXT_1_Y, StrResetUser1);
printStr_P(RESET_USER_TEXT_2_X, RESET_USER_TEXT_2_Y, StrResetUser2);

BIN
extras/assets/arduboy_logo.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 B

After

Width:  |  Height:  |  Size: 238 B

BIN
extras/assets/arduboy_screen.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 390 B

After

Width:  |  Height:  |  Size: 343 B

View File

@ -342,8 +342,8 @@ int main(int argc, char **argv)
rawlen = w * (h+7) / 8;
bmp0 = malloc(rawlen); memset(bmp0, 0, rawlen);
bmp1 = malloc(rawlen); memset(bmp1, 0, rawlen);
bmp0 = (unsigned char *)malloc(rawlen); memset(bmp0, 0, rawlen);
bmp1 = (unsigned char *)malloc(rawlen); memset(bmp1, 0, rawlen);
printf("// %s width: %u height: %u\n", argv[1], w, h);

BIN
extras/cabi/sample.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 B

After

Width:  |  Height:  |  Size: 199 B

View File

@ -6,7 +6,7 @@ Documentation for files contained in this repository that aren't self explanator
Provides information so that this library can be installed and updated in the Arduino IDE using the [Library Manager](https://www.arduino.cc/en/Guide/Libraries#toc3).
The value of *version* must be set to the latest stable tagged release. This should be changed and commited just before tagging the new release.
The value of *version* must be set to the latest stable tagged release. This should be changed and committed just before tagging the new release.
See the [Arduino IDE 1.5: Library specification](https://arduino.github.io/arduino-cli/library-specification/) for details.
@ -14,7 +14,7 @@ See the [Arduino IDE 1.5: Library specification](https://arduino.github.io/ardui
This JSON file is a manifest used by the [PlatformIO IDE](https://platformio.org/) to make this library available in its [Library Manager](https://docs.platformio.org/en/latest/librarymanager/index.html).
The value of *version* must be set to the latest stable tagged release. This should be changed and commited just before tagging the new release.
The value of *version* must be set to the latest stable tagged release. This should be changed and committed just before tagging the new release.
See the [PlatformIO library.json](https://docs.platformio.org/en/latest/librarymanager/config.html) documentation for details.

View File

@ -581,10 +581,10 @@ void Arduboy2Base::drawFastHLine
w = xEnd - x;
// buffer pointer plus row offset + x offset
register uint8_t *pBuf = sBuffer + ((y / 8) * WIDTH) + x;
uint8_t *pBuf = sBuffer + ((y / 8) * WIDTH) + x;
// pixel mask
register uint8_t mask = 1 << (y & 7);
uint8_t mask = 1 << (y & 7);
switch (color)
{
@ -623,7 +623,7 @@ void Arduboy2Base::fillScreen(uint8_t color)
// {
// color = 0xFF; // all pixels on
// }
// for (int16_t i = 0; i < WIDTH * HEIGTH / 8; i++)
// for (int16_t i = 0; i < WIDTH * HEIGHT / 8; i++)
// {
// sBuffer[i] = color;
// }

View File

@ -45,9 +45,9 @@
* for. For example, with a rate of 60 frames per second a duration of 30
* would be used to play a tone for half a second.
*
* The variable named `#duration` is the counter that times the duration of a
* The variable named #duration is the counter that times the duration of a
* tone. A sketch can determine if a tone is currently playing by testing if
* the `#duration` variable is non-zero (assuming it's a timed tone, not a
* the #duration variable is non-zero (assuming it's a timed tone, not a
* continuous tone).
*
* To keep the code small and efficient, the frequency of a tone is specified

View File

@ -572,7 +572,7 @@ class Arduboy2Core : public Arduboy2NoUSB
* Invert the entire display or set it back to normal.
*
* \param inverse `true` will invert the display. `false` will set the
* display to no-inverted.
* display to non-inverted.
*
* \details
* Calling this function with a value of `true` will set the display to