Created
June 7, 2019 22:15
-
-
Save possan/e1f758cad92fd61fb7688f40ea8b9c23 to your computer and use it in GitHub Desktop.
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 setup() { | |
// put your setup code here, to run once: | |
pinMode(7, OUTPUT); | |
// pinMode(5, INPUT); | |
} | |
static uint8_t b = 0; | |
static volatile unsigned char memory[1000] = { 123, }; | |
void loop() { | |
// put your main code here, to run repeatedly: | |
// = digitalRead(5); | |
uint8_t pin = 7; | |
uint8_t bit = digitalPinToBitMask(pin); | |
uint8_t port = digitalPinToPort(pin); | |
volatile uint8_t *out = portOutputRegister(port); | |
// uint8_t pin2 = 4; | |
// uint8_t bit2 = digitalPinToBitMask(pin2); | |
// uint8_t port2 = digitalPinToPort(pin2); | |
// volatile uint8_t *out2 = portOutputRegister(port2); | |
// uint8_t pin3 = 4; | |
// uint8_t bit3 = digitalPinToBitMask(pin3); | |
// uint8_t port3 = digitalPinToPort(pin3); | |
// volatile uint8_t *out3 = portOutputRegister(port3); | |
uint8_t V1 = ~bit; | |
uint8_t V2 = bit; | |
volatile uint8_t B = 0; | |
volatile uint8_t A0 = 0; | |
volatile uint8_t A1 = 0; | |
while(true) { | |
// read two bytes | |
//A0 = *out2; | |
// A1 = *out3; | |
// B = memory[(A1 << 8) | A0]; | |
*out = V1; | |
*out = V2; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment