This file contains 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
// MARK: NPM Modules | |
import Image from "components/common/image"; | |
// MARK: Types | |
import HomeEntry from "types/contentful/pages/home"; | |
// MARK: Functionality | |
import getHomePage from "utils/contentful/queries/home"; | |
// MARK: React Component | |
export default async () => { | |
const entry: HomeEntry = await getHomePage() | |
const { metaTitle, metaDescription, seoImage } = entry.fields |
This file contains 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
// MARK: Functionality | |
import ContentfulClient from "utils/contentful/client"; | |
// MARK: Function | |
export default async (): Promise<any> => { | |
const response = await ContentfulClient.getEntry("AN_ENTRY_ID"); | |
console.log("response: ", response) | |
return response | |
} |
This file contains 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
// MARK: NPM Modules | |
import { createClient } from "contentful"; | |
// MARK: React Component | |
const ContentfulClient = createClient({ | |
space: process.env.CONTENTFUL_SPACE_ID as string, | |
accessToken: process.env.CONTENTFUL_ACCESS_TOKEN as string | |
}); | |
export default ContentfulClient |
This file contains 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
/** @type {import('next').NextConfig} */ | |
const nextConfig = { | |
images: { | |
remotePatterns: [{ | |
protocol: "https", | |
hostname: "images.ctfassets.net", | |
port: "", | |
pathname: "/**" | |
}] | |
} |
This file contains 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
Show hidden characters
{ | |
"compilerOptions": { | |
"lib": ["dom", "dom.iterable", "esnext"], | |
"allowJs": true, | |
"skipLibCheck": true, | |
"strict": true, | |
"noEmit": true, | |
"esModuleInterop": true, | |
"module": "esnext", | |
"moduleResolution": "bundler", |
This file contains 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
float prevValue = 0.0; // Previous filtered value | |
float filteredValue; | |
float maxChange = 10.0; // Maximum allowed change in value between readings | |
void loop() { | |
float rawValue = analogRead(A0); // Read the raw analog input | |
// Calculate the change in value from the previous reading | |
float valueChange = abs(rawValue - prevValue); |
This file contains 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
float alpha = 0.1; // Filter constant, lower value means more filtering | |
float prevValue = 0.0; // Previous filtered value | |
float filteredValue; | |
void setup() { | |
Serial.begin(9600); | |
} | |
void loop() { | |
float rawValue = analogRead(A0); // Read the raw analog input |
This file contains 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
float alpha = 0.95; // Filter constant, higher value means more filtering | |
float prevValue = 0.0; // Previous filtered value | |
float filteredValue; | |
void setup() { | |
Serial.begin(9600); | |
} | |
void loop() { | |
float rawValue = analogRead(A0); // Read the raw analog input |
This file contains 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
void loop() | |
{ | |
// Print the Enum | |
Serial.print("DifferentEnum Value 1: "); | |
Serial.println(EnumTwo::DifferentEnum::Value_1); | |
Serial.print("DifferentEnum Value 2: "); | |
Serial.println(EnumTwo::Value_2); | |
} |
This file contains 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
namespace EnumTwo { | |
enum DifferentEnum { | |
Value_1, // 0 | |
Value_2 // 1 | |
}; | |
}; |
NewerOlder