New arrangement, ADC scanning. Noisy, but promising.


#define ADCpin PA3
int sensorValue = 0;
void setup() {
pinMode(PA0,OUTPUT);
pinMode(PA6,OUTPUT);
gpio_write_bit(GPIOA, 0, LOW);
gpio_write_bit(GPIOA, 6, HIGH);
Serial.begin(19200);
pinMode(ADCpin,INPUT_ANALOG);
}
void loop() {
GPIOA->regs->ODR ^= 65; //flip both driver pins; stm32duino specific(?)
sensorValue = analogRead(ADCpin);
Serial.println(sensorValue);
delay(1);
GPIOA->regs->ODR ^= 65;
delay(10);
}
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.