Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - lcpalm

Pages: 1
1
Hi,
I'm having trouble and not sure why: Have a circuit set up with a sensor attached to A0, and it reads fine; but if I attach the sensor to A5, it does not report the input.

Here is my code:

---------------------------------

#include <SPI.h>

int readValue1 = 0;
int readValue2 = 0;

// setup for TinyZero
#if defined(ARDUINO_ARCH_SAMD)
  #define SerialInterface SerialUSB
#else
  #define SerialInterface Serial
#endif

void setup() {
  SerialInterface.begin(9600);
  delay(3000);

}

void loop() {

  String dataString = "";

  readValue1 = analogRead(A0);
  readValue2 = analogRead(A5);

  dataString += String(readValue1);
  dataString += ",";
  dataString += String(readValue2);

  SerialInterface.println(dataString);

  delay(1000);

}

----------------------

My circuit is:
 VCC ---> 220ohm ---> IR-emitter ---> GND
VCC ---> 10k ohm ---> A0 [or A5]
                                |--> IR-detector ---> GND

This works as expected when connected to A0: it reports low values when there is IR light striking the IR-detector, and reports high values when the light is blocked. That is, in serial monitor, we get sensor value in A0, and nothing meaningful in A5, as expected:
A0, A5
42,332
43,370
43,367
43,357
361,382 <-- when light blocked
349,373 <-- blocked
340,354 <-- blocked

But when connected to A5, it doesn't report sensor value in A5:
A0, A5
361,382
349,373
340,354
321,372
305,368
that is, here the second column should be low; but it never is.

I'm not sure what is wrong here?

Thank you!

2
Hello,

I have a TinyZero project and would like to attach an external power switch (have wires running to a power switch attached on the enclosure of my project).  I bought a little switch, but am not sure how to wire it up to the TinyZero, or if this is even possible?

Thank you!

3
TinyDuino Processors & TinyShields / Tinyzero won't run off battery?
« on: March 23, 2021, 06:11:44 PM »
Hi, I have a TinyZero circuit built, which runs fine off USB but won't seem to run off battery power.

The battery charges (amber light), but when the USB is removed the system doesn't seem to turn on. It's the 3.7V 150mA Li-Ion battery from TinyCircuits.

The circuit is: TinyZero hooked up to micro SD shield and to protoboard leading to an IR sensor pair, which logs beam-breaks.  It works as expected under USB, incrementing the file name on startup (ie every time it's turned on with the power switch on the TinyZero, or the USB is re-plugged in, it starts a new data log on the SD.) But on removing the USB and trying to run off battery power alone, it doesn't turn on and doesn't write any files.

Not sure how to troubleshoot this.... am new to TinyDuino. Thanks in advance for any help!







Pages: 1
SMF spam blocked by CleanTalk