Try internal pull-up resistors instead of the external ones.#1
Try internal pull-up resistors instead of the external ones.#1honnet wants to merge 1 commit intoPatternCraft:masterfrom
Conversation
|
Hi Cedric, Hope you've had a good day. Ive been chatting to David who developed the Make sure that the voltage supplied to the arduino pins swings way above (the arduino code senses a voltage threshold, the pi code will just Does that makes sense, its a bit over my head. I need to have a think about Thanks On Sun, Apr 3, 2016 at 12:54 AM, honnet notifications@github.com wrote:
Gemma May Latham |
|
Well, the Raspberry Pi has internal pull-up and pull-down resistors that can be set when the pin declarations are made, here is an example* of how to use it: *Source: |
The internal pull-up resistors are about 20-50 kOhms, seek for "I/O Pin Pull-up Resistor" on page 384 of the datasheet:
http://www.atmel.com/Images/Atmel-7766-8-bit-AVR-ATmega16U4-32U4_Datasheet.pdf
It's probably more than what was in the original circuit but it should work.
If it doesn't, you might have to change the value of CFG_SENSOR_THRESHOLD, those lines should help to understand how it's used:
https://github.com/honnet/punchcard_reader/blob/master/ReadSensors/ReadSensors.ino#L23
https://github.com/honnet/punchcard_reader/blob/master/ReadSensors/ReadSensors.ino#L281
The way to set the internal pull-up resistors can also be done differently, see the comment in the commit.
More about pullup resistors and analog pins in the "Pullup resistors" section:
https://www.arduino.cc/en/Reference/AnalogPins