This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| import PlaygroundSupport | |
| import Combine | |
| class MyViewController : UIViewController { | |
| var label: UILabel! | |
| var sub: AnyCancellable! | |
| override func loadView() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| struct ContentView: View { | |
| @Environment(\.scenePhase) var scenePhase | |
| @State var controller = Controller() | |
| @ObservedObject var publisher = Publisher() | |
| var body: some View { | |
| VStack { | |
| Image(systemName: "globe") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Arduino.h> | |
| #include <M5Unified.h> | |
| #include <MadgwickAHRS.h> | |
| #define Serial USBSerial | |
| Madgwick madgwick = Madgwick(); | |
| float roll = 0; | |
| float pitch = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Arduino.h> | |
| #include <IRremoteESP8266.h> | |
| #include <IRsend.h> | |
| #include <M5Unified.h> | |
| #ifndef USE_USEBSERIAL | |
| #define USBSerial Serial | |
| #endif | |
| static uint16_t kIrLed = 4; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * IRremoteESP8266: IRrecvDumpV2 - dump details of IR codes with IRrecv | |
| * An IR detector/demodulator must be connected to the input kRecvPin. | |
| * | |
| * Copyright 2009 Ken Shirriff, http://arcfn.com | |
| * Copyright 2017-2019 David Conran | |
| * | |
| * Example circuit diagram: | |
| * https://github.com/crankyoldgit/IRremoteESP8266/wiki#ir-receiving | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| import CoreData | |
| struct ContentView: View { | |
| @Environment(\.managedObjectContext) private var viewContext | |
| @FetchRequest( | |
| sortDescriptors: [NSSortDescriptor(keyPath: \Item.timestamp, ascending: true)], | |
| animation: .default) | |
| private var items: FetchedResults<Item> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Arduino.h> | |
| #include <FastLED.h> | |
| #define LED_PIN 21 | |
| #define NUM_LEDS 1 | |
| static CRGB leds[NUM_LEDS]; | |
| void setLed(CRGB color) { | |
| // change RGB to GRB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| struct ModelView: View { | |
| @ObservedObject var model: Model | |
| @State var isEditing = false | |
| var body: some View { | |
| HStack { | |
| Text(model.name) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| struct ContentView: View { | |
| @ObservedObject var model = Model() | |
| var body: some View { | |
| VStack { | |
| Toggle("On/Off", isOn: $model.isOn) | |
| Spacer() | |
| Button("Undo") { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Hello, I'm an instance of A. | |
| Hello, I'm an instance of A. | |
| Hello, I'm an instance of B. | |
| Hello, I'm an instance of B. |