|
Post by duddex on Oct 24, 2021 16:51:38 GMT
My first DYI project with my AE modular system: controlling the pitch of GRAINS with Polyramp firmware using a VL6180X proximity sensor and an Arduino Nano
The code is very simple
#include <Wire.h> #include "Adafruit_VL6180X.h" Adafruit_VL6180X vl = Adafruit_VL6180X();
int output_pin = 9;
void setup() { vl.begin(); }
void loop() { uint8_t range = vl.readRange(); uint8_t status = vl.readRangeStatus();
if (status != VL6180X_ERROR_NONE) { range = 180; }
analogWrite(output_pin, 180 - range); }
I have patched pin 9 of the Arduino Nano to IN1 of GRAINS. I noticed that 180 is the maximum range that my VL6180X is able to detect. There is some room for improvement. But for now I am quite happy with this quick&dirty approach.
|
|
|
Post by MikMo on Oct 24, 2021 18:02:56 GMT
Nice, i bought one of those a while back, with the exact same intension. AE D beam :-)
|
|
|
Post by duddex on Oct 25, 2021 10:35:47 GMT
Nice, i bought one of those a while back, with the exact same intension. AE D beam :-) Yes D-Beam I also tried a Ultrasonic Distance Sensor (HC-SR04). But I had better results with the VL6180X. Maybe I will give it a try using a SHARP GP2Y0A21YK0F IR Distance Sensor
|
|
|
Post by keurslagerkurt on Oct 29, 2021 14:15:28 GMT
Coooool stuff!!!
|
|
pol
Wiki Editors
Posts: 1,349
|
Post by pol on Oct 31, 2021 9:21:54 GMT
I'd like one of these!
|
|