Skip to content

Commit

Permalink
Merge pull request #8 from tgolla/TouchscreenV2
Browse files Browse the repository at this point in the history
Merge Touchscreen v2 pre-release 1.9.3
  • Loading branch information
tgolla authored Aug 3, 2022
2 parents 2a5aa23 + 0546404 commit 171c0ad
Show file tree
Hide file tree
Showing 16 changed files with 318 additions and 169 deletions.
4 changes: 4 additions & 0 deletions Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
// Splash screen display delay in milliseconds.
#define SPLASH_SCREEN_DELAY 7000

#define OUTPUT_GCODE_TO 2

#define PERCENTAGE_TIME_CALCULATION_ENABLED true

#define FORWARD_REWIND_COUNT 5

// SD Chip Select Pin
Expand Down
6 changes: 6 additions & 0 deletions Documentation/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ The ```FORWARD_REWIND_COUNT``` directive set the number of file jumped forward o
## SD_CS
The ```SPLASH_SCREEN_DELAY``` directive sets the SD card chip select pin. The default setting is 4.

## OUTPUT_GCODE_TO
The ```OUTPUT_GCODE_TO``` directive defines where processed g-code is output. This setting determines if g-code is to be output to only the display, only the serial port, both or neither. This directive is only relavant for with the touchscreen/SD configuration running in SD mode. In classic mode processed g-code is always sent to the serial port. The option is useful for increasing print speed and debugging. When set to the default, display only it provides a visual g-code being processed. However, display calls have a high processor utilization which reduces the print speed. When set to serial only or both g-code is output to the serial port which can be monitored. This can be useful when debugging, but also results in a high processor utilization. When set to neither g-code is not displayed or sent to the serial port resulting in increased printing speed. The following numerical settings should be used (0-Neither, 1-Serial Only, 2-Display Only, 3-Both). The default setting is Display Only (2).

## PERCENTAGE_TIME_CALCULATION_ENABLED
The ```PERCENTAGE_TIME_CALCULATION_ENABLED``` directive sets the default setting of the percentage completed and time remaining calculation. This setting determines if the percentage completed and time remaining calculation is executed and displayed on the screen when printing. The option to turn off the calculation is available to increase print speed and reduce print time. This directive is only relavant for with the touchscreen/SD configuration. The default setting is true.

## PIEZO_PIN
The ```PIEZO_PIN``` directive sets the piezo buzzer pin. To deactivate the buzzer set the value to -1. The default setting is 3.

Expand Down
5 changes: 5 additions & 0 deletions Documentation/G-Code.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ The M311 command allows you to override the pen movement feed rates set in your

### M312
The M312 command sets the pen up federate multiplier. This command allows the SphereBot to move off the object at a faster rate. One means the pen will go up at the same speed (degrees/second) as it goes down. Each increase by one will logarithmically double the pen up speed.
### M990
Sets the g-code output device print device. When set to Neither (P0) output of the g-code is disable, except in classic mode which always outputs g-code to the serial port. When set to Serial Only (P1) g-code is output to just the serial port. This can be useful when debugging, but results in a high processor utilization. When set to Display Only (P2) g-code is output to just the display. This also results in a high processor utilization. When set to Both (P3) g-code is output to both the serial port and the display. This directive is only relavant for with the touchscreen/SD configuration running in SD mode.

### M991
Disable/Enable percentage completed and time remaining calculation. The ability to disable the percentage completed and time remaining calculation is provided to increase speed by reducing processor calculations during printing. When set to disabled (P0) the calculation is disabled. When set to enabled (P1) the calculation is enabled and displayed. This command is only relavant for with the touchscreen/SD configuration.

### Using M3xx commands.
Using a file to preset the M301 through M312 values and saving the configuration with the M500 command provides a great deal of versatility.
Expand Down
10 changes: 5 additions & 5 deletions Documentation/Inkscape.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
The following is a tutorial outlining the steps of converting a SphereBot SVG template (3200x800) into gcode using InkScape v1.x. The tutorial also discusses some of the challenges and solutions provided with some of the newer Mxxx commands of moving gcode between different SphereBots.

## Template
*To Be Completed in the a future release.*
*To be completed in the a future release.*

## Steps to Generate G-Code
1. Open your SVG (Scalable Vector Graphics) file in InkScape.
Expand Down Expand Up @@ -53,16 +53,16 @@ The following is a tutorial outlining the steps of converting a SphereBot SVG te

You now have a g-code file you can run on your SphereBot. Note that in the future you will not need to confirming all of the settings for the GCodetools ```Tools library```, ```Orientation points``` and ```Path to Gcode``` as they will remain the same as the last time they were used.

*To Be Completed in the a future release.*
*To be completed in the a future release.*

## Modifying Your G-Code File with Comments
*To Be Completed in the a future release.*
*To be completed in the a future release.*

## Adding M00 Pen Change Commands
*To Be Completed in the a future release.*
*To be completed in the a future release.*

## Newer Mxxx Commands
*To Be Completed in the a future release.*
*To be completed in the a future release.*

## Document History

Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@ Arduino Firmware for use with the Adafruit Motor/Stepper/Servo Shield for Arduin

This fork takes on a large number of changes including consistent naming conventions, an advanced G-Code parser, additional custom G-Code commands, a touchscreen control, SD card reader support and audio alerts. Many of these features are being actively developed. Additional documentation can be found in the documentation folder along with comments in both the SphereBot.ino and configuration.h files.

This code relaese works with the original hardware configuration (Arduino & motor control shield) where g-code files are send to the SphereBot from a PC through a USB cable or you can add a touchscreen shield which allows you to operate in either the original mode cabled to a PC supplying the g-code file or in fully autonomous mode using g-code files stored on the SD card.
This code release works with the original hardware configuration (Arduino & motor control shield) where g-code files are send to the SphereBot from a PC through a USB cable or you can add a touchscreen shield which allows you to operate in either the original mode cabled to a PC supplying the g-code file or in fully autonomous mode using g-code files stored on the SD card.

Also addressed is a MAJOR bug fix in the arc drawing function. Previous code used the current x,y location stored in the stepper motor control code which was rounded to it's integer value while g-code values are represented with 6 decimal places (doubles). At times this would cause the start angle of the arc to be greater than ending angle, which resulted in the drawing of a full circle and not a partial arc.

The version 1.9.2 prerelease is missing the follow features.
The version 1.9.3 prerelease is missing the follow features.

- Version 2.0 release setup notes/documentation.
- A completed comprehensive mechanical assembly document.
- InkScape documentation stepping through creating gcode with the gcodetools along with using some of new the advanced Mxxx commands.
- An alphabetical menu search.
- Commands codes to turn off serial output, display output and percent/time calculations (speed inprovements).

### Forking (Please Don't)

Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions SD/gcode/~Inkscape (Universal).gcode
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ M309 P5 ;M309 Pxxx - Z Adjust Preset Threshold: 5 Z Adjust Calculated: -1
M310 P500.00 ;M310 Pxxx - Preset XY Feedrate : 500.00
M311 P60.00 ;M311 Pxxx - Preset Pen Feedrate: 60.00
M312 P2 ;M312 Pxxx - Pen Up Feedrate Multiplier: 2
M990 P2 ;M990 Px - Output G-Code To: (0-Neither, 1-Serial Only, 2-Display Only, 3-Both): 2
M991 P1 ;M991 Pxxx - Percentage Time Calculation (0-Disabled, 1-Enabled): 1
M500 ;Save pen configuration to EEPROM. Values Saved in EEPROM (23): 23
M999
%
10 changes: 10 additions & 0 deletions SD/gcode/~M990BothSerialDiaplay
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
%
;Output G-Code Both
;
;Output g-code to both the serial port
;or display.
;
M990 P3
M500 ;Save pen configuration to EEPROM. Values Saved in EEPROM (23): 23
M999
%
10 changes: 10 additions & 0 deletions SD/gcode/~M990NeitherSerialDisplay
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
%
;Output G-Code Neither
;
;Output g-code to neither the serial port
;or display.
;
M990 P0
M500 ;Save pen configuration to EEPROM. Values Saved in EEPROM (23): 23
M999
%
9 changes: 9 additions & 0 deletions SD/gcode/~M990OnlyDisplay
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
%
;Output G-Code Display
;
;Output g-code to only the display.
;
M990 P2
M500 ;Save pen configuration to EEPROM. Values Saved in EEPROM (23): 23
M999
%
9 changes: 9 additions & 0 deletions SD/gcode/~M990OnlySerial
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
%
;Output G-Code Serial
;
;Output g-code to only the serial port.
;
M990 P1
M500 ;Save pen configuration to EEPROM. Values Saved in EEPROM (23): 23
M999
%
13 changes: 13 additions & 0 deletions SD/gcode/~M991DisablePercentageTimeCalculation.gcode
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
%
;Disable Percentage/Time
;Calculation
;
;Disables the percentage completed and time
;remaining calculation. This option removes
;the calculations inorder to increase the
;printing time.
;
M991 P0
M500 ;Save pen configuration to EEPROM. Values Saved in EEPROM (23): 23
M999
%
14 changes: 14 additions & 0 deletions SD/gcode/~M991EnablePercentageTimeCalculation
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
%
;Enable Percentage/Time
;Calculation
;
;Enables the percentage completed and time
;remaining calculation. This option allows
;for the calculations inorder to display the
;percentage completed and time remaining.
;(45% 3:45)
;
M991 P1
M500 ;Save pen configuration to EEPROM. Values Saved in EEPROM (23): 23
M999
%
10 changes: 0 additions & 10 deletions SerialDisplayPrint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,3 @@ void SerialDisplayPrint::println(char *data, PrintDevice device)
if (device == Both || device == SerialOnly)
Serial->println(data);
}

void SerialDisplayPrint::println(PrintDevice device)
{
#if ADAFRUIT_TFT_TOUCH_SHIELD
if (device == Both || device == DisplayOnly)
AdvanceToNextLineOnDisplay();
#endif
if (device == Both || device == SerialOnly)
Serial->println();
}
27 changes: 13 additions & 14 deletions SerialDisplayPrint.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Released into the public domain.
class SerialDisplayPrint
{
public:
enum PrintDevice { Both, SerialOnly, DisplayOnly };
enum PrintDevice { Neither, SerialOnly, DisplayOnly, Both };

SerialDisplayPrint();
void begin(HardwareSerial &serial);
Expand All @@ -26,19 +26,18 @@ class SerialDisplayPrint
#endif
void SetTextSize(int textSize);
void SetTextDisplay();
void print(byte data, PrintDevice device = Both);
void print(short data, PrintDevice device = Both);
void print(int data, PrintDevice device = Both);
void print(unsigned long data, PrintDevice device = Both);
void print(double data, PrintDevice device = Both);
void print(char *data, PrintDevice device = Both);
void println(byte data, PrintDevice device = Both);
void println(short data, PrintDevice device = Both);
void println(int data, PrintDevice device = Both);
void println(unsigned long data, PrintDevice device = Both);
void println(double data, PrintDevice device = Both);
void println(char *data, PrintDevice device = Both);
void println(PrintDevice device = Both);
void print(byte data, PrintDevice device);
void print(short data, PrintDevice device);
void print(int data, PrintDevice device);
void print(unsigned long data, PrintDevice device);
void print(double data, PrintDevice device);
void print(char *data, PrintDevice device);
void println(byte data, PrintDevice device);
void println(short data, PrintDevice device);
void println(int data, PrintDevice device);
void println(unsigned long data, PrintDevice device);
void println(double data, PrintDevice device);
void println(char *data, PrintDevice device);

private:
HardwareSerial *Serial;
Expand Down
Loading

0 comments on commit 171c0ad

Please sign in to comment.