Hi,
I will try to keep this short. I have the chinese or rev1 digispark, I did change the fuse to disable reset pin on P5. I have a project and I am having problem with sound sensor input. I wanted to make a sound reactive led by using sound sensor connected at P2 and to control 2 LEDs at P0 and P1.
I do have slightly longer code but I also tried with basic code. both acting the same. On the longer code, P3, P4, P5 has been used for other purposes leaving P2 open for the sound sensor.
Problem:
I used 4 types of this sensor
https://goo.gl/images/35RvtM and they all acting the same. Values didn't get changed despite the fact that the reaction led on that sensor did blink, but the processed led on P0 and P1 stays on. I did output the digitalread command and it seems quirky, sometimes there's a delay, sometimes no response from the input (the input I read is from D0 pin instead of A pin)
Code as follows
#include "DigiKeyboard.h"
int micPin = 2;
int mic;
void setup() {
// put your setup code here, to run once:
pinMode(0, OUTPUT);
pinMode(1, OUTPUT);
pinMode(micPin, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
mic = digitalRead(micPin);
// this is generally not necessary but with some older systems it seems to
// prevent missing the first character after a delay:
DigiKeyboard.sendKeyStroke(0);
// Type out this string letter by letter on the computer (assumes US-style
// keyboard)
DigiKeyboard.println(mic);
digitalWrite(0, mic);
digitalWrite(1, mic);
delay(50);
}
I am at a dead-end on this problem. I actually tried on P5 on the shorter code, it is just the same.