New answers tagged

1

There are quite a few issues with this program. The most obvious is the use of floating point calculations in interrupt context. Interrupts should be served as fast as possible, and floating point is really slow on the AVR. Some other issues: Interrupt flags should be cleared by writing a logic 1 to them, however silly it may sound. A couple if & ...


0

Another approach might be to use a single timer instead of 3 separate ones. Maintain 3 software counters and increment all of them on each interrupt, with separate limit tests and resets. This will be slightly slower, but there will be no possibility of collisions.


0

I think the problem is being caused by the size of your ISR's. When using ISR's, it's important to make the code as short as possible and you should certainly avoid using any functions! I would change each of your ISRs to: ISR(TIMER3_COMPA_vect) { m1_steps_done++; } ISR(TIMER4_COMPA_vect) { m2_steps_done++; } ISR(TIMER5_COMPA_vect) { ...


1

Connected a 330nF capacitor between one pin of the PT100 to -DC, and one 330nF between -DC and ground.


1

Your problem is that you don't know what ADC value maps to the maximum RPM. If you did you wouldn't need to know the RPM. What you have here is a "feedback loop", and what you need is some method of using the detected RPM to control the speed of the motor. You need to decouple the potentiometer from the analogWrite completely - the potentiometer ...


1

try with Firmata, it is a protocol that establishes serial communication between the computer with Arduino. All you have to do is have the Firmata on Arduino Board, and pyFirmata plugin available to talk with Arduino from Python on your machine.


1

Well after "working" on this all day, it turns out that the solution was to use the "Arduino as an ISP" solution as described on the arduino.cc website. Why the USB-ISP solution did not work is not immediately obvious as I have used it successfully before - just not with this board! FWIW, the blinking sequence I observed when burning the ...


1

Very interesting project. What to do depends largely on your exact requirements. I guess you have chosen RFID for its easy usage, when everything is set up (like just placing the item roughly at the right spot, instead of needing extra electrical plugs or similar). I'm not being able to scale it In a case like this you normally wouldn't use just one ...


2

tl;dr : Since unsigned char is represented as a byte value, the output to the serial is the byte representation, not the char I re-wrote the code you had for reference: #define CHARS 255 #define BAUD 115200 unsigned char unsChar[CHARS]; char sinChar[CHARS]; void setup() { Serial.begin(BAUD); Serial.println("~~Setup~~"); for(int i = 0; i <...


0

An unsigned char is treated as a number, and a signed char as a character. See the https://simple.wikipedia.org/wiki/ASCII table for the result.


2

I can't add comment to your question so I post as an answer even though this is not much an answer. This is just a hint to solve your problem. 8x8 led matrix and 595s are pretty low-level stuff, so I assume you have some knowledge about electronics and programming in general. I think your wiring is OK but I also think you misunderstand how 595 works. Here is ...


1

Here is your code simplified. (untested) Since the pins are sequential, you could calculate pin numbers, instead of using an array for pin number lookup. For example, you could use a loop for (int i = 1; i < 25; i++) and first input pin would be referenced as i + 1 and first output pin would be referenced as i + 27. // https://arduino.stackexchange.com/...


Top 50 recent answers are included