<!DOCTYPE html><htmllang="en"><head><metacharset="utf-8"><metaname="viewport"content="width=device-width, initial-scale=1.0"><metaname="generator"content="rustdoc"><metaname="description"content="This is the struct to interact in a save way with the Arduboy2 C++ library."><title>Arduboy2 in arduboy_rust::prelude::arduboy2 - Rust</title><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><linkrel="preload"as="font"type="font/woff2"crossoriginhref="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><linkrel="stylesheet"href="../../../static.files/normalize-76eba96aa4d2e634.css"><linkrel="stylesheet"href="../../../static.files/rustdoc-cb6f1f67f1bcd037.css"id="mainThemeStyle"><metaname="rustdoc-vars"data-root-path="../../../"data-static-root-path="../../../static.files/"data-current-crate="arduboy_rust"data-themes=""data-resource-suffix=""data-rustdoc-version="1.73.0-nightly (500647fd8 2023-07-27)"data-channel="nightly"data-search-js="search-6dfdfced5eff6596.js"data-settings-js="settings-de11bff964e9d4e5.js"data-settings-css="settings-8c76f75bfb6bd192.css"data-theme-light-css="light-6d2c9675f3d09c26.css"data-theme-dark-css="dark-45ceb8f2e522f4d1.css"data-theme-ayu-css="ayu-fd19013d6ce078bf.css"><scriptsrc="../../../static.files/storage-db41da1a38ea3cb8.js"></script><scriptdefersrc="sidebar-items.js"></script><scriptdefersrc="../../../static.files/main-0795b7d26be81095.js"></script><noscript><linkrel="stylesheet"media="(prefers-color-scheme:light)"href="../../../static.files/light-6d2c9675f3d09c26.css"><linkrel="stylesheet"media="(prefers-color-scheme:dark)"href="../../../static.files/dark-45ceb8f2e522f4d1.css"><linkrel="stylesheet"href="../../../static.files/noscript-cffde32267a19fd6.css"></noscript><linkrel="alternate icon"type="image/png"href="../../../static.files/favicon-16x16-8b506e7a72182f1c.png"><linkrel="alternate icon"type="image/png"href="../../../static.files/favicon-32x32-422f7d1d52889060.png"><linkrel="icon"type="image/svg+xml"href="../../../static.files/favicon-2c020d218678b618.svg"></head><bodyclass="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><navclass="mobile-topbar"><buttonclass="sidebar-menu-toggle">☰</button><aclass="logo-container"href="../../../arduboy_rust/index.html"><imgclass="rust-logo"src="../../../static.files/rust-logo-151179464ae7ed46.svg"alt="logo"></a><h2></h2></nav><navclass="sidebar"><aclass="logo-container"href="../../../arduboy_rust/index.html"><imgclass="rust-logo"src="../../../static.files/rust-logo-151179464ae7ed46.svg"alt="logo"></a><h2class="location"><ahref="#">Arduboy2</a></h2><divclass="sidebar-elems"><section><h3><ahref="#implementations">Methods</a></h3><ulclass="block"><li><ahref="#method.audio_enabled">audio_enabled</a></li><li><ahref="#method.audio_off">audio_off</a></li><li><ahref="#method.audio_on">audio_on</a></li><li><ahref="#method.audio_on_and_save">audio_on_and_save</a></li><li><ahref="#method.audio_save_on_off">audio_save_on_off</a></li><li><ahref="#method.audio_toggle">audio_toggle</a></li><li><ahref="#method.begin">begin</a></li><li><ahref="#method.clear">clear</a></li><li><ahref="#method.collide_point">collide_point</a></li><li><ahref="#method.collide_rect">collide_rect</a></li><li><ahref="#method.digital_write_rgb">digital_write_rgb</a></li><li><ah
</div></details><h2id="implementations"class="small-section-header">Implementations<ahref="#implementations"class="anchor">§</a></h2><divid="implementations-list"><detailsclass="toggle implementors-toggle"open><summary><sectionid="impl-Arduboy2"class="impl"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#63-599">source</a><ahref="#impl-Arduboy2"class="anchor">§</a><h3class="code-header">impl <aclass="struct"href="struct.Arduboy2.html"title="struct arduboy_rust::prelude::arduboy2::Arduboy2">Arduboy2</a></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.new"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#69-71">source</a><h4class="code-header">pub const fn <ahref="#method.new"class="fn">new</a>() -> Self</h4></section></summary><divclass="docblock"><p>gives you a new instance of the <ahref="struct.Arduboy2.html"title="struct arduboy_rust::prelude::arduboy2::Arduboy2">Arduboy2</a></p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.begin"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#74-76">source</a><h4class="code-header">pub fn <ahref="#method.begin"class="fn">begin</a>(&self)</h4></section></summary><divclass="docblock"><p>Initialize the hardware, display the boot logo, provide boot utilities, etc.
This function should be called once near the start of the sketch, usually in setup(), before using any other functions in this class. It initializes the display, displays the boot logo, provides “flashlight” and system control features and initializes audio control.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.clear"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#78-80">source</a><h4class="code-header">pub fn <ahref="#method.clear"class="fn">clear</a>(&self)</h4></section></summary><divclass="docblock"><p>Clear the display buffer and set the text cursor to location 0, 0.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.display"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#83-85">source</a><h4class="code-header">pub fn <ahref="#method.display"class="fn">display</a>(&self)</h4></section></summary><divclass="docblock"><p>Copy the contents of the display buffer to the display.
The contents of the display buffer in RAM are copied to the display and will appear on the screen.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.display_and_clear_buffer"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#89-91">source</a><h4class="code-header">pub fn <ahref="#method.display_and_clear_buffer"class="fn">display_and_clear_buffer</a>(&self)</h4></section></summary><divclass="docblock"><p>Copy the contents of the display buffer to the display. The display buffer will be cleared to zero.</p>
<p>Operation is the same as calling display() without parameters except additionally the display buffer will be cleared.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.draw_pixel"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#124-126">source</a><h4class="code-header">pub fn <ahref="#method.draw_pixel"class="fn">draw_pixel</a>(&self, x: i16, y: i16, color: <aclass="enum"href="enum.Color.html"title="enum arduboy_rust::prelude::arduboy2::Color">Color</a>)</h4></section></summary><divclass="docblock"><p>Set a single pixel in the display buffer to the specified color.</p>
<p>The single pixel specified location in the display buffer is set to the specified color. The values WHITE or BLACK can be used for the color. If the color parameter isn’t included, the pixel will be set to WHITE.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.draw_circle"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#158-160">source</a><h4class="code-header">pub fn <ahref="#method.draw_circle"class="fn">draw_circle</a>(&self, x: i16, y: i16, r: u8, color: <aclass="enum"href="enum.Color.html"title="enum arduboy_rust::prelude::arduboy2::Color">Color</a>)</h4></section></summary><divclass="docblock"><p>Draw a circle of a given radius.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.fill_circle"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#170-172">source</a><h4class="code-header">pub fn <ahref="#method.fill_circle"class="fn">fill_circle</a>(&self, x: i16, y: i16, r: u8, color: <aclass="enum"href="enum.Color.html"title="enum arduboy_rust::prelude::arduboy2::Color">Color</a>)</h4></section></summary><divclass="docblock"><p>Draw a filled-in circle of a given radius.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.get_pixel"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#245-247">source</a><h4class="code-header">pub fn <ahref="#method.get_pixel"class="fn">get_pixel</a>(&self, x: u8, y: u8) -><aclass="enum"href="enum.Color.html"title="enum arduboy_rust::prelude::arduboy2::Color">Color</a></h4></section></summary><divclass="docblock"><p>Returns the state of the given pixel in the screen buffer.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.init_random_seed"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#251-253">source</a><h4class="code-header">pub fn <ahref="#method.init_random_seed"class="fn">init_random_seed</a>(&self)</h4></section></summary><divclass="docblock"><p>Seed the random number generator with a random value.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.just_pressed"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#267-269">source</a><h4class="code-header">pub fn <ahref="#method.just_pressed"class="fn">just_pressed</a>(&self, button: <aclass="struct"href="../struct.ButtonSet.html"title="struct arduboy_rust::prelude::ButtonSet">ButtonSet</a>) -> bool</h4></section></summary><divclass="docblock"><p>Check if a button has just been pressed.</p>
<p>true if the specified button has just been pressed.</p>
<p>Return true if the given button was pressed between the latest call to pollButtons() and previous call to pollButtons(). If the button has been held down over multiple polls, this function will return false.</p>
<p>There is no need to check for the release of the button since it must have been released for this function to return true when pressed again.</p>
<p>This function should only be used to test a single button.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.just_released"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#283-285">source</a><h4class="code-header">pub fn <ahref="#method.just_released"class="fn">just_released</a>(&self, button: <aclass="struct"href="../struct.ButtonSet.html"title="struct arduboy_rust::prelude::ButtonSet">ButtonSet</a>) -> bool</h4></section></summary><divclass="docblock"><p>Check if a button has just been released.</p>
<p>true if the specified button has just been released.</p>
<p>Return true if the given button was released between the latest call to pollButtons() and previous call to pollButtons(). If the button has been held down over multiple polls, this function will return false.</p>
<p>There is no need to check for the released of the button since it must have been pressed for this function to return true when pressed again.</p>
<p>This function should only be used to test a single button.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.not_pressed"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#297-299">source</a><h4class="code-header">pub fn <ahref="#method.not_pressed"class="fn">not_pressed</a>(&self, button: <aclass="struct"href="../struct.ButtonSet.html"title="struct arduboy_rust::prelude::ButtonSet">ButtonSet</a>) -> bool</h4></section></summary><divclass="docblock"><p>Test if the specified buttons are not pressed.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.next_frame"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#308-310">source</a><h4class="code-header">pub fn <ahref="#method.next_frame"class="fn">next_frame</a>(&self) -> bool</h4></section></summary><divclass="docblock"><p>Indicate that it’s time to render the next frame.</p>
<p>When this function returns true, the amount of time has elapsed to display the next frame, as specified by setFrameRate() or setFrameDuration().</p>
<p>This function will normally be called at the start of the rendering loop which would wait for true to be returned before rendering and displaying the next frame.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.poll_buttons"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#318-320">source</a><h4class="code-header">pub fn <ahref="#method.poll_buttons"class="fn">poll_buttons</a>(&self)</h4></section></summary><divclass="docblock"><p>Poll the buttons and track their state over time.</p>
<p>Read and save the current state of the buttons and also keep track of the button state when this function was previously called. These states are used by the justPressed() and justReleased() functions to determine if a button has changed state between now and the previous call to pollButtons().</p>
<p>This function should be called once at the start of each new frame.</p>
<p>The justPressed() and justReleased() functions rely on this function.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.pressed"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#330-332">source</a><h4class="code-header">pub fn <ahref="#method.pressed"class="fn">pressed</a>(&self, button: <aclass="struct"href="../struct.ButtonSet.html"title="struct arduboy_rust::prelude::ButtonSet">ButtonSet</a>) -> bool</h4></section></summary><divclass="docblock"><p>Test if the all of the specified buttons are pressed.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.print"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#354-356">source</a><h4class="code-header">pub fn <ahref="#method.print"class="fn">print</a>(&self, x: impl <aclass="trait"href="../trait.Printable.html"title="trait arduboy_rust::prelude::Printable">Printable</a>)</h4></section></summary><divclass="docblock"><p>The Arduino Print class is available for writing text to the screen buffer.</p>
<p>For an Arduboy2 class object, functions provided by the Arduino Print class can be used to write text to the screen buffer, in the same manner as the Arduino Serial.print(), etc., functions.</p>
<p>Print will use the write() function to actually draw each character in the screen buffer, using the library’s font5x7 font. Two character values are handled specially:</p>
<ul>
<li>ASCII newline/line feed (\n, 0x0A, inverse white circle). This will move the text cursor position to the start of the next line, based on the current text size.</li>
<li>ASCII carriage return (\r, 0x0D, musical eighth note). This character will be ignored.</li>
</span>arduboy.print(<spanclass="macro">f!</span>(<spanclass="string">b"Hello World\n"</span>)); <spanclass="comment">// Prints "Hello World" but does not use the 2kb ram
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.set_cursor"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#365-367">source</a><h4class="code-header">pub fn <ahref="#method.set_cursor"class="fn">set_cursor</a>(&self, x: i16, y: i16)</h4></section></summary><divclass="docblock"><p>Set the location of the text cursor.</p>
<p>The location of the text cursor is set the the specified coordinates. The coordinates are in pixels. Since the coordinates can specify any pixel location, the text does not have to be placed on specific rows. As with all drawing functions, location 0, 0 is the top left corner of the display. The cursor location represents the top left corner of the next character written.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.set_frame_rate"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#374-376">source</a><h4class="code-header">pub fn <ahref="#method.set_frame_rate"class="fn">set_frame_rate</a>(&self, rate: u8)</h4></section></summary><divclass="docblock"><p>Set the frame rate used by the frame control functions.</p>
<p>Normally, the frame rate would be set to the desired value once, at the start of the game, but it can be changed at any time to alter the frame update rate.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.set_text_size"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#383-385">source</a><h4class="code-header">pub fn <ahref="#method.set_text_size"class="fn">set_text_size</a>(&self, size: u8)</h4></section></summary><divclass="docblock"><p>Set the text character size.</p>
<p>Setting a text size of 1 will result in standard size characters with one pixel for each bit in the bitmap for a character. The value specified is a multiplier. A value of 2 will double the width and height. A value of 3 will triple the dimensions, etc.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.audio_save_on_off"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#404-406">source</a><h4class="code-header">pub fn <ahref="#method.audio_save_on_off"class="fn">audio_save_on_off</a>(&self)</h4></section></summary><divclass="docblock"><p>Save the current sound state in EEPROM.</p>
<p>The current sound state, set by on() or off(), is saved to the reserved system area in EEPROM. This allows the state to carry over between power cycles and after uploading a different sketch.</p>
<p>Note
EEPROM is limited in the number of times it can be written to. Sketches should not continuously change and then save the state rapidly.</p>
<p>If the system is configured for sound on, it will be changed to sound off (mute). If sound is off, it will be changed to on. This function sets the sound mode only until the unit is powered off. To save the current mode use saveOnOff().</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.audio_on_and_save"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#414-419">source</a><h4class="code-header">pub fn <ahref="#method.audio_on_and_save"class="fn">audio_on_and_save</a>(&self)</h4></section></summary><divclass="docblock"><p>Combines the use function of <code>audio_on()</code> and <code>audio_save_on_off()</code></p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.audio_enabled"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#426-428">source</a><h4class="code-header">pub fn <ahref="#method.audio_enabled"class="fn">audio_enabled</a>(&self) -> bool</h4></section></summary><divclass="docblock"><p>Get the current sound state.</p>
<p>true if sound is currently enabled (not muted).</p>
<p>This function should be used by code that actually generates sound. If true is returned, sound can be produced. If false is returned, sound should be muted.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.invert"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#437-439">source</a><h4class="code-header">pub fn <ahref="#method.invert"class="fn">invert</a>(&self, inverse: bool)</h4></section></summary><divclass="docblock"><p>Invert the entire display or set it back to normal.</p>
<p>Calling this function with a value of true will set the display to inverted mode. A pixel with a value of 0 will be on and a pixel set to 1 will be off.</p>
<p>Once in inverted mode, the display will remain this way until it is set back to non-inverted mode by calling this function with false.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.collide_point"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#450-455">source</a><h4class="code-header">pub fn <ahref="#method.collide_point"class="fn">collide_point</a>(&self, point: <aclass="struct"href="struct.Point.html"title="struct arduboy_rust::prelude::arduboy2::Point">Point</a>, rect: <aclass="struct"href="struct.Rect.html"title="struct arduboy_rust::prelude::arduboy2::Rect">Rect</a>) -> bool</h4></section></summary><divclass="docblock"><p>Test if a point falls within a rectangle.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.collide_rect"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#465-470">source</a><h4class="code-header">pub fn <ahref="#method.collide_rect"class="fn">collide_rect</a>(&self, rect1: <aclass="struct"href="struct.Rect.html"title="struct arduboy_rust::prelude::arduboy2::Rect">Rect</a>, rect2: <aclass="struct"href="struct.Rect.html"title="struct arduboy_rust::prelude::arduboy2::Rect">Rect</a>) -> bool</h4></section></summary><divclass="docblock"><p>Test if a rectangle is intersecting with another rectangle.</p>
<p>This function is intended to detemine if an object, whose boundaries are defined by the given rectangle, is in contact with another rectangular object.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.digital_write_rgb_single"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#478-480">source</a><h4class="code-header">pub fn <ahref="#method.digital_write_rgb_single"class="fn">digital_write_rgb_single</a>(&self, color: u8, val: u8)</h4></section></summary><divclass="docblock"><p>Set one of the RGB LEDs digitally, to either fully on or fully off.</p>
<li>color The name of the LED to set. The value given should be one of RED_LED, GREEN_LED or BLUE_LED.</li>
<li>val Indicates whether to turn the specified LED on or off. The value given should be RGB_ON or RGB_OFF.</li>
</ul>
<p>This 2 parameter version of the function will set a single LED within the RGB LED either fully on or fully off. See the description of the 3 parameter version of this function for more details on the RGB LED.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.digital_write_rgb"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#499-501">source</a><h4class="code-header">pub fn <ahref="#method.digital_write_rgb"class="fn">digital_write_rgb</a>(&self, red: u8, green: u8, blue: u8)</h4></section></summary><divclass="docblock"><p>Set the RGB LEDs digitally, to either fully on or fully off.</p>
<li>red,green,blue Use value RGB_ON or RGB_OFF to set each LED.</li>
</ul>
<p>The RGB LED is actually individual red, green and blue LEDs placed very close together in a single package. This 3 parameter version of the function will set each LED either on or off, to set the RGB LED to 7 different colors at their highest brightness or turn it off.</p>
<divclass="example-wrap"><preclass="language-text"><code> The colors are as follows:
</code></pre></div></div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.every_x_frames"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#521-523">source</a><h4class="code-header">pub fn <ahref="#method.every_x_frames"class="fn">every_x_frames</a>(&self, frames: u8) -> bool</h4></section></summary><divclass="docblock"><p>Indicate if the specified number of frames has elapsed.</p>
true if the specified number of frames has elapsed.</p>
<p>This function should be called with the same value each time for a given event. It will return true if the given number of frames has elapsed since the previous frame in which it returned true.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.flip_vertical"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#532-534">source</a><h4class="code-header">pub fn <ahref="#method.flip_vertical"class="fn">flip_vertical</a>(&self, flipped: bool)</h4></section></summary><divclass="docblock"><p>Flip the display vertically or set it back to normal.</p>
<li>flipped true will set vertical flip mode. false will set normal vertical orientation.</li>
</ul>
<p>Calling this function with a value of true will cause the Y coordinate to start at the bottom edge of the display instead of the top, effectively flipping the display vertically.</p>
<p>Once in vertical flip mode, it will remain this way until normal vertical mode is set by calling this function with a value of false.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.flip_horizontal"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#543-545">source</a><h4class="code-header">pub fn <ahref="#method.flip_horizontal"class="fn">flip_horizontal</a>(&self, flipped: bool)</h4></section></summary><divclass="docblock"><p>Flip the display horizontally or set it back to normal.</p>
<li>flipped true will set horizontal flip mode. false will set normal horizontal orientation.</li>
</ul>
<p>Calling this function with a value of true will cause the X coordinate to start at the left edge of the display instead of the right, effectively flipping the display horizontally.</p>
<p>Once in horizontal flip mode, it will remain this way until normal horizontal mode is set by calling this function with a value of false.</p>
<li>color The background color to be used for following text. The values WHITE or BLACK should be used.</li>
</ul>
<p>The background pixels of following characters will be set to the specified color.</p>
<p>However, if the background color is set to be the same as the text color, the background will be transparent. Only the foreground pixels will be drawn. The background pixels will remain as they were before the character was drawn.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.set_cursor_x"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#570-572">source</a><h4class="code-header">pub fn <ahref="#method.set_cursor_x"class="fn">set_cursor_x</a>(&self, x: i16)</h4></section></summary><divclass="docblock"><p>Set the X coordinate of the text cursor location.</p>
<li>x The X (horizontal) coordinate, in pixels, for the new location of the text cursor.</li>
</ul>
<p>The X coordinate for the location of the text cursor is set to the specified value, leaving the Y coordinate unchanged. For more details about the text cursor, see the setCursor() function.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.set_cursor_y"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#579-581">source</a><h4class="code-header">pub fn <ahref="#method.set_cursor_y"class="fn">set_cursor_y</a>(&self, y: i16)</h4></section></summary><divclass="docblock"><p>Set the Y coordinate of the text cursor location.</p>
<li>y The Y (vertical) coordinate, in pixels, for the new location of the text cursor.</li>
</ul>
<p>The Y coordinate for the location of the text cursor is set to the specified value, leaving the X coordinate unchanged. For more details about the text cursor, see the setCursor() function.</p>
<li>w true enables text wrap mode. false disables it.</li>
</ul>
<p>Text wrap mode is enabled by specifying true. In wrap mode, if a character to be drawn would end up partially or fully past the right edge of the screen (based on the current text size), it will be placed at the start of the next line. The text cursor will be adjusted accordingly.</p>
<p>If wrap mode is disabled, characters will always be written at the current text cursor position. A character near the right edge of the screen may only be partially displayed and characters drawn at a position past the right edge of the screen will remain off screen.</p>
</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.idle"class="method"><aclass="src rightside"href="../../../src/arduboy_rust/library/arduboy2.rs.html#596-598">source</a><h4class="code-header">pub fn <ahref="#method.idle"class="fn">idle</a>(&self)</h4></section></summary><divclass="docblock"><p>Idle the CPU to save power.</p>
<p>This puts the CPU in idle sleep mode. You should call this as often as you can for the best power savings. The timer 0 overflow interrupt will wake up the chip every 1ms, so even at 60 FPS a well written app should be able to sleep maybe half the time in between rendering it’s own frames.</p>
</div></details></div></details></div><h2id="synthetic-implementations"class="small-section-header">Auto Trait Implementations<ahref="#synthetic-implementations"class="anchor">§</a></h2><divid="synthetic-implementations-list"><sectionid="impl-RefUnwindSafe-for-Arduboy2"class="impl"><ahref="#impl-RefUnwindSafe-for-Arduboy2"class="anchor">§</a><h3class="code-header">impl RefUnwindSafe for <aclass="struct"href="struct.Arduboy2.html"title="struct arduboy_rust::prelude::arduboy2::Arduboy2">Arduboy2</a></h3></section><sectionid="impl-Send-for-Arduboy2"class="impl"><ahref="#impl-Send-for-Arduboy2"class="anchor">§</a><h3class="code-header">impl Send for <aclass="struct"href="struct.Arduboy2.html"title="struct arduboy_rust::prelude::arduboy2::Arduboy2">Arduboy2</a></h3></section><sectionid="impl-Sync-for-Arduboy2"class="impl"><ahref="#impl-Sync-for-Arduboy2"class="anchor">§</a><h3class="code-header">impl Sync for <aclass="struct"href="struct.Arduboy2.html"title="struct arduboy_rust::prelude::arduboy2::Arduboy2">Arduboy2</a></h3></section><sectionid="impl-Unpin-for-Arduboy2"class="impl"><ahref="#impl-Unpin-for-Arduboy2"class="anchor">§</a><h3class="code-header">impl Unpin for <aclass="struct"href="struct.Arduboy2.html"title="struct arduboy_rust::prelude::arduboy2::Arduboy2">Arduboy2</a></h3></section><sectionid="impl-UnwindSafe-for-Arduboy2"class="impl"><ahref="#impl-UnwindSafe-for-Arduboy2"class="anchor">§</a><h3class="code-header">impl UnwindSafe for <aclass="struct"href="struct.Arduboy2.html"title="struct arduboy_rust::prelude::arduboy2::Arduboy2">Arduboy2</a></h3></section></div><h2id="blanket-implementations"class="small-section-header">Blanket Implementations<ahref="#blanket-implementations"class="anchor">§</a></h2><divid="blanket-implementations-list"><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-Any-for-Arduboy2"class="impl"><ahref="#impl-Any-for-Arduboy2"class="anchor">§</a><h3class="code-header">impl<T> Any for T<spanclass="where fmt-newline">where
T: 'static + ?Sized,</span></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.type_id"class="method trait-impl"><ahref="#method.type_id"class="anchor">§</a><h4class="code-header">fn <aclass="fn">type_id</a>(&self) -> TypeId</h4></section></summary><divclass='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a>Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-Borrow%3CT%3E-for-Arduboy2"class="impl"><ahref="#impl-Borrow%3CT%3E-for-Arduboy2"class="anchor">§</a><h3class="code-header">impl<T> Borrow<T> for T<spanclass="where fmt-newline">where
T: ?Sized,</span></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.borrow"class="method trait-impl"><ahref="#method.borrow"class="anchor">§</a><h4class="code-header">fn <aclass="fn">borrow</a>(&self) ->&T</h4></section></summary><divclass='docblock'>Immutably borrows from an owned value. <a>Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-BorrowMut%3CT%3E-for-Arduboy2"class="impl"><ahref="#impl-BorrowMut%3CT%3E-for-Arduboy2"class="anchor">§</a><h3class="code-header">impl<T> BorrowMut<T> for T<spanclass="where fmt-newline">where
T: ?Sized,</span></h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.borrow_mut"class="method trait-impl"><ahref="#method.borrow_mut"class="anchor">§</a><h4class="code-header">fn <aclass="fn">borrow_mut</a>(&mut self) ->&mut T</h4></section></summary><divclass='docblock'>Mutably borrows from an owned value. <a>Read more</a></div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-From%3CT%3E-for-Arduboy2"class="impl"><ahref="#impl-From%3CT%3E-for-Arduboy2"class="anchor">§</a><h3class="code-header">impl<T> From<T> for T</h3></section></summary><divclass="impl-items"><detailsclass="toggle method-toggle"open><summary><sectionid="method.from"class="method trait-impl"><ahref="#method.from"class="anchor">§</a><h4class="code-header">fn <aclass="fn">from</a>(t: T) -> T</h4></section></summary><divclass="docblock"><p>Returns the argument unchanged.</p>
</div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-Into%3CU%3E-for-Arduboy2"class="impl"><ahref="#impl-Into%3CU%3E-for-Arduboy2"class="anchor">§</a><h3class="code-header">impl<T, U> Into<U> for T<spanclass="where fmt-newline">where
U: Into<T>,</span></h3></section></summary><divclass="impl-items"><detailsclass="toggle"open><summary><sectionid="associatedtype.Error"class="associatedtype trait-impl"><ahref="#associatedtype.Error"class="anchor">§</a><h4class="code-header">type <aclass="associatedtype">Error</a> = Infallible</h4></section></summary><divclass='docblock'>The type returned in the event of a conversion error.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.try_from"class="method trait-impl"><ahref="#method.try_from"class="anchor">§</a><h4class="code-header">fn <aclass="fn">try_from</a>(value: U) -> Result<T, <T as TryFrom<U>>::Error></h4></section></summary><divclass='docblock'>Performs the conversion.</div></details></div></details><detailsclass="toggle implementors-toggle"><summary><sectionid="impl-TryInto%3CU%3E-for-Arduboy2"class="impl"><ahref="#impl-TryInto%3CU%3E-for-Arduboy2"class="anchor">§</a><h3class="code-header">impl<T, U> TryInto<U> for T<spanclass="where fmt-newline">where
U: TryFrom<T>,</span></h3></section></summary><divclass="impl-items"><detailsclass="toggle"open><summary><sectionid="associatedtype.Error-1"class="associatedtype trait-impl"><ahref="#associatedtype.Error-1"class="anchor">§</a><h4class="code-header">type <aclass="associatedtype">Error</a> = <U as TryFrom<T>>::Error</h4></section></summary><divclass='docblock'>The type returned in the event of a conversion error.</div></details><detailsclass="toggle method-toggle"open><summary><sectionid="method.try_into"class="method trait-impl"><ahref="#method.try_into"class="anchor">§</a><h4class="code-header">fn <aclass="fn">try_into</a>(self) -> Result<U, <U as TryFrom<T>>::Error></h4></section></summary><divclass='docblock'>Performs the conversion.</div></details></div></details></div></section></div></main></body></html>