initial commit
This commit is contained in:
commit
954b27343e
38
oscioscoop.ino
Normal file
38
oscioscoop.ino
Normal file
@ -0,0 +1,38 @@
|
||||
const uint8_t ADC_DATA_PIN[] = {
|
||||
19, 18, 14, 15,
|
||||
40, 41, 17, 16
|
||||
};
|
||||
#define ADC_CLK_PIN 27
|
||||
|
||||
void setup() {
|
||||
pinMode(ADC_CLK_PIN, OUTPUT);
|
||||
for(int8_t i=7; i >= 0; i--){
|
||||
pinMode(ADC_DATA_PIN[i], INPUT);
|
||||
}
|
||||
digitalWrite(ADC_CLK_PIN, LOW);
|
||||
Serial.begin(1E6);
|
||||
}
|
||||
|
||||
uint32_t d=50;
|
||||
uint32_t t=0;
|
||||
void loop() {
|
||||
uint32_t T=500;
|
||||
uint8_t value = 0;
|
||||
|
||||
digitalWriteFast(ADC_CLK_PIN, LOW);
|
||||
delayMicroseconds(1);
|
||||
digitalWriteFast(ADC_CLK_PIN, HIGH);
|
||||
delayMicroseconds(1);
|
||||
|
||||
// for(int8_t i=7; i >= 0; i--){
|
||||
// value |= digitalRead(ADC_DATA_PIN[i]) << i;
|
||||
// }
|
||||
value = (GPIO6_PSR >> 16) & 0xFF;
|
||||
|
||||
Serial.println(value, DEC);
|
||||
// Serial.print('\t');
|
||||
// T = micros();
|
||||
//// Serial.println(T - t, DEC);
|
||||
// while(t + d > micros());
|
||||
// t = T;
|
||||
}
|
||||
Reference in New Issue
Block a user