Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

B6.5 updates - WIP - samples need lifecycle updates #359

Merged
merged 16 commits into from
Jul 8, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
using Meadow;
using Meadow.Devices;
using Meadow.Foundation.Audio;
using Meadow.Units;

namespace Audio.PiezoSpeaker_Sample
{
public class MeadowApp : App<F7FeatherV2, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
//<!=SNIP=>

Expand All @@ -16,7 +17,7 @@ public MeadowApp()
{
Console.WriteLine("Initializing...");

piezoSpeaker = new PiezoSpeaker(Device.CreatePwmPort(Device.Pins.D05));
piezoSpeaker = new PiezoSpeaker(Device.CreatePwmPort(Device.Pins.D05, new Frequency(100, Frequency.UnitType.Hertz)));

_ = PlayTriad();
}
Expand All @@ -26,9 +27,9 @@ async Task PlayTriad()
for (int i = 0; i < 5; i++)
{
Console.WriteLine("Playing A major triad starting at A4");
await piezoSpeaker.PlayTone(440, 500); //A
await piezoSpeaker.PlayTone(554.37f, 500); //C#
await piezoSpeaker.PlayTone(659.25f, 500); //E
await piezoSpeaker.PlayTone(new Frequency(440, Frequency.UnitType.Hertz), 500); //A
await piezoSpeaker.PlayTone(new Frequency(554.37f, Frequency.UnitType.Hertz), 500); //C#
await piezoSpeaker.PlayTone(new Frequency(659.25f, Frequency.UnitType.Hertz), 500); //E

await Task.Delay(2500);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Generators.SoftPwmPort_Sample
{
public class MeadowApp : App<F7FeatherV2, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
//<!=SNIP=>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Leds.LedBarGraph_Sample
{
public class MeadowApp : App<F7FeatherV2, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
//<!=SNIP=>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Leds.Led_Sample
{
public class MeadowApp : App<F7FeatherV2, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
//<!=SNIP=>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Leds.PwmLedBarGraph_Sample
{
public class MeadowApp : App<F7FeatherV2, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
//<!=SNIP=>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Leds.PwmLed_Onboard_Sample
{
public class MeadowApp : App<F7FeatherV2, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
//<!=SNIP=>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
using Meadow;
using Meadow.Devices;
using Meadow.Foundation.Leds;
using Meadow.Units;

namespace Leds.PwmLed_Sample
{
public class MeadowApp : App<F7FeatherV2, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
//<!=SNIP=>

Expand All @@ -26,18 +27,18 @@ public MeadowApp()

pwmLeds = new List<PwmLed>
{
new PwmLed(Device.CreatePwmPort(Device.Pins.D02), TypicalForwardVoltage.Blue),
new PwmLed(Device.CreatePwmPort(Device.Pins.D03), TypicalForwardVoltage.Blue),
new PwmLed(Device.CreatePwmPort(Device.Pins.D04), TypicalForwardVoltage.Blue),
new PwmLed(Device.CreatePwmPort(Device.Pins.D05), TypicalForwardVoltage.Blue),
new PwmLed(Device.CreatePwmPort(Device.Pins.D06), TypicalForwardVoltage.Blue), // This pin throws an exception as PWM Port
new PwmLed(Device.CreatePwmPort(Device.Pins.D07), TypicalForwardVoltage.Blue),
new PwmLed(Device.CreatePwmPort(Device.Pins.D08), TypicalForwardVoltage.Blue),
new PwmLed(Device.CreatePwmPort(Device.Pins.D09), TypicalForwardVoltage.Blue),
new PwmLed(Device.CreatePwmPort(Device.Pins.D10), TypicalForwardVoltage.Blue),
new PwmLed(Device.CreatePwmPort(Device.Pins.D11), TypicalForwardVoltage.Blue),
new PwmLed(Device.CreatePwmPort(Device.Pins.D12), TypicalForwardVoltage.Blue),
new PwmLed(Device.CreatePwmPort(Device.Pins.D13), TypicalForwardVoltage.Blue)
new PwmLed(Device.CreatePwmPort(Device.Pins.D02, new Frequency(100, Frequency.UnitType.Hertz)), TypicalForwardVoltage.Blue),
new PwmLed(Device.CreatePwmPort(Device.Pins.D03, new Frequency(100, Frequency.UnitType.Hertz)), TypicalForwardVoltage.Blue),
new PwmLed(Device.CreatePwmPort(Device.Pins.D04, new Frequency(100, Frequency.UnitType.Hertz)), TypicalForwardVoltage.Blue),
new PwmLed(Device.CreatePwmPort(Device.Pins.D05, new Frequency(100, Frequency.UnitType.Hertz)), TypicalForwardVoltage.Blue),
new PwmLed(Device.CreatePwmPort(Device.Pins.D06, new Frequency(100, Frequency.UnitType.Hertz)), TypicalForwardVoltage.Blue), // This pin throws an exception as PWM Port
new PwmLed(Device.CreatePwmPort(Device.Pins.D07, new Frequency(100, Frequency.UnitType.Hertz)), TypicalForwardVoltage.Blue),
new PwmLed(Device.CreatePwmPort(Device.Pins.D08, new Frequency(100, Frequency.UnitType.Hertz)), TypicalForwardVoltage.Blue),
new PwmLed(Device.CreatePwmPort(Device.Pins.D09, new Frequency(100, Frequency.UnitType.Hertz)), TypicalForwardVoltage.Blue),
new PwmLed(Device.CreatePwmPort(Device.Pins.D10, new Frequency(100, Frequency.UnitType.Hertz)), TypicalForwardVoltage.Blue),
new PwmLed(Device.CreatePwmPort(Device.Pins.D11, new Frequency(100, Frequency.UnitType.Hertz)), TypicalForwardVoltage.Blue),
new PwmLed(Device.CreatePwmPort(Device.Pins.D12, new Frequency(100, Frequency.UnitType.Hertz)), TypicalForwardVoltage.Blue),
new PwmLed(Device.CreatePwmPort(Device.Pins.D13, new Frequency(100, Frequency.UnitType.Hertz)), TypicalForwardVoltage.Blue)
};

onRgbLed.SetColor(RgbLed.Colors.Green);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Leds.RgbLed_Sample
{
public class MeadowApp : App<F7FeatherV2, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
//<!=SNIP=>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace Leds.RgbPwmLed_Onboard_Sample
{
public class MeadowApp : App<F7FeatherV2, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
//<!=SNIP=>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Leds.RgbPwmLed_Sample
{
public class MeadowApp : App<F7FeatherV2, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
//<!=SNIP=>

Expand All @@ -28,21 +28,25 @@ public MeadowApp()
rgbPwmLeds = new List<RgbPwmLed>()
{
new RgbPwmLed(
Device.CreatePwmPort(Device.Pins.D02),
Device.CreatePwmPort(Device.Pins.D03),
Device.CreatePwmPort(Device.Pins.D04)),
Device,
Device.Pins.D02,
Device.Pins.D03,
Device.Pins.D04),
new RgbPwmLed(
Device.CreatePwmPort(Device.Pins.D05),
Device.CreatePwmPort(Device.Pins.D06),
Device.CreatePwmPort(Device.Pins.D07)),
Device,
Device.Pins.D05,
Device.Pins.D06,
Device.Pins.D07),
new RgbPwmLed(
Device.CreatePwmPort(Device.Pins.D08),
Device.CreatePwmPort(Device.Pins.D09),
Device.CreatePwmPort(Device.Pins.D10)),
Device,
Device.Pins.D08,
Device.Pins.D09,
Device.Pins.D10),
new RgbPwmLed(
Device.CreatePwmPort(Device.Pins.D11),
Device.CreatePwmPort(Device.Pins.D12),
Device.CreatePwmPort(Device.Pins.D13))
Device,
Device.Pins.D11,
Device.Pins.D12,
Device.Pins.D13)
};

onRgbLed.SetColor(RgbLed.Colors.Green);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
using Meadow;
using Meadow.Devices;
using Meadow.Foundation.Motors;
using Meadow.Units;

namespace Motor.HBridgeMotor_Sample
{
public class MeadowApp : App<F7FeatherV2, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
//<!=SNIP=>

Expand All @@ -18,8 +19,8 @@ public MeadowApp()

motor1 = new HBridgeMotor
(
a1Port: Device.CreatePwmPort(Device.Pins.D07),
a2Port: Device.CreatePwmPort(Device.Pins.D08),
a1Port: Device.CreatePwmPort(Device.Pins.D07, new Frequency(100, Frequency.UnitType.Hertz)),
a2Port: Device.CreatePwmPort(Device.Pins.D08, new Frequency(100, Frequency.UnitType.Hertz)),
enablePort: Device.CreateDigitalOutputPort(Device.Pins.D09)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Relays.Relay_Sample
{
public class MeadowApp : App<F7FeatherV2, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
//<!=SNIP=>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace MeadowApp
/// terminates on the `3V3` rail on one end, and `D02` on the other, such
/// that when the button is pressed, `D02` is raised `HIGH`.
/// </summary>
public class MeadowApp : App<F7FeatherV2, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
RgbPwmLed onboardLed;
PushButton pushButton;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace Sensors.Buttons.PushButton_Sample
{
public class MeadowApp : App<F7FeatherV2, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
//<!=SNIP=>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Sensors.Temperature.AnalogWaterLevel_Sample
{
public class MeadowApp : App<F7FeatherV2, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
//<!=SNIP=>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace MeadowApp
{
public class MeadowApp : App<F7FeatherV2, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
//<!=SNIP=>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Sensors.HallEffect_Sample
{
public class MeadowApp : App<F7FeatherV2, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
//<!=SNIP=>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Sensors.Rotary.RotaryEncoderWithButton_Sample
{
public class MeadowApp : App<F7FeatherV2, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
//<!=SNIP=>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Sensors.Rotary.RotaryEncoder_Sample
{
public class MeadowApp : App<F7FeatherV2, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
//<!=SNIP=>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Sensors.Switches.DipSwitch_Sample
{
public class MeadowApp : App<F7FeatherV2, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
//<!=SNIP=>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Sensors.Switches.SpdtSwitch_Sample
{
public class MeadowApp : App<F7FeatherV2, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
//<!=SNIP=>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Sensors.Switches.SpstSwitch_Sample
{
public class MeadowApp : App<F7FeatherV2, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
//<!=SNIP=>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Sensors.Temperature.AnalogTemperature_Sample
{
public class MeadowApp : App<F7FeatherV2, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
//<!=SNIP=>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

namespace MeadowApp
{
public class MeadowApp : App<F7FeatherV2, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
RgbPwmLed onboardLed;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

namespace MeadowApp
{
public class MeadowApp : App<F7FeatherV2, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
RgbPwmLed onboardLed;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace Meadow.Foundation.Graphics
resetPin: Device.Pins.D04,
*/

public class MeadowApp : App<F7Micro, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
private MicroGraphics graphics;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace Sensors.GPS.NMEA_SSD1309_Sample
{
public class MeadowApp : App<F7FeatherV2, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
//SerialTextFile serialTextFile;
NmeaSentenceProcessor nmea;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace MeadowApp
{
public class MeadowApp : App<F7FeatherV2, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
//<!=SNIP=>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Maple.ServerSimpleMeadow_Sample
{
public class MeadowApp : App<F7FeatherV2, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
MapleServer server;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace MeadowApp
{
public class MeadowApp : App<F7FeatherV2, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
//<!=SNIP=>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace Audio.Radio.Tea5767_Sample
{
public class MeadowApp : App<F7FeatherV2, MeadowApp>
public class MeadowApp : App<F7FeatherV2>
{
//<!=SNIP=>

Expand Down
Loading