I have two questions, Its kinda restricted to post on this site and also restrictions for replying.
My questions here is.
how to get this work. I had good convo, but it got cut off because to manye replies for a day (limit 18).
There is an alternative SPI interface on the Photon
But for that you’d need to modify the library to use SPI1 instead of SPI and re-direct RST, DC and CS too.
e.g.
MOSI -> D2
SCK -> D4
CS -> D5
DC -> D6
RST -> D7
Ideally the library would provide a constructor that also allows to pass in the SPI interface to use in order to keep it portable. But for the time being you’d just hard code SPI1
2.How can i use D0 to detect sound??? i tried with a led to test it, but the led was always on.
and i only got 228 as serial output.
I cannot see a any restrictions on your account.
Unfortunately you had some “double posts” that triggered the system to flag some of your posts and I think you also flagged one of your posts and the number of flags received in a short period may have temporarily silenced your account.
When you want to change a post you’ve already made, you can use the instead of creating a new post - that may also prevent running into the max posts per day limit for new users.
How did you wire your sound sensor and where does the 228 come from?
We’d need to see that code too
Have you tried adjusting the trigger level for the sensor via the potentiometer?
To move the screen from SPI toSPI1 you just need to replace all occurances of SPI. in the library to SPI1.
Depending on your sensor some variants have both an analog and a digital output.
While the threshold for the digital one is set via the potentiometer to go from LOW to HIGH at a set loudness the analog will give a voltage proportional to the loudness.
However, when using analog pins you must make sure that the signal never exceeds 3.3V to avoid damaging the ADC on that pin.
On the Photon all (except A3 and A6/DAC) GPIO pins are 5V tolerant.
You should just not have internal pull-resistors enabled or using ADC (aka analogRead()) on the pin.
I haven’t got such a sensor at hand so I cannot really provide you with specifics or how good that sensor would be suited for what you are intending to do.
However, when you set the pin mode via pinMode(yourPin, INPUT) you won’t have any internal pull resistors attached and when you use digitalRead() and notanalogRead() you should be safe even with a 5V signal.
If you want to use analogRead() you may want to either use a voltage divider to bring the 5V signal into the 3.3V range or use a 3.3V Zener Diode to cut off any access voltage.