Sawtooth Demo
void setup() {
DDRD = B11111111; // Set all bits of PORTD as output
}
void loop() {
for (uint8_t y=0; y<=255; y++) // Loop through all possible y values of a byte
{
PORTD = y; // Slap the bits to Arduino pins D0..D7
delayMicroseconds(50); // Let it linger
}
}
Dashed Line Demo
void setup() {
DDRD = B11111111; // Set all bits of PORTD as output
}
void loop() {
for (uint8_t y=0; y<=255; y++) // Loop through all possible y values of a byte
{
// Only "plot" when y is divisible by 25
if ((y%25)==0)
PORTD = y;
delayMicroseconds(50); // Let it linger
}
}
I've had that same line-of-thought for some time... Trying to figure out how to do drawings in normal Y-T 'scoping.
Nice and easy to comprehend solution!
And cool video showing/explaining it!