Recent Posts

Pages: 1 [2] 3 4 ... 10
OK so I used what I learnt from my previous attempt and rewrote the program entirely by hand. Now it works as expected, though the animation is a bit different from the original. I used a modified version of the LED Effect library from
The library was modified so that the LED stays on/off when faded up/down instead of repeatedly fading. I hope this code is a bit cleaner and more professional :)

Code: [Select]
#include <LEDEffect.h>
#define buttonPin 0 // analog input pin to use as a digital input
#define offPin 5 // pin to tell when system is off
LEDEffect powerLed(1); // digital output pin for case power LED

unsigned long Timer;

unsigned int ledState;
boolean on = false;

void setup() {
  // put your setup code here, to run once:

void loop() {
  // on off stuff
  if (digitalRead(offPin) == LOW) {
    on = false;
  } else if (digitalRead(buttonPin) == LOW){
    if (!on) Timer = millis();
    on = true;
  } else {
    if (on) Timer = millis();
    on = false;
  if ((!on) && (millis()-Timer >= 1000UL)) {
    if (ledState != 1) {
      ledState = 1;
  if ((on) && (millis()-Timer >= 1000UL)) {
    if (ledState != 2) {
      ledState = 2;
  if (millis()-Timer <= 1000UL){
    if (ledState != 3) powerLed.breath(30);
    ledState = 3;


To explain how exactly the button thing works:
There is no actual button, the attiny is connected to the power LED pins on the motherboard. Here is a list of the behaviours expected in different power states. This may vary depending on motherboard so I can't guarantee this will work the same for everyone!

PLED+ - off
GND - connected

PLED+ - on
GND - connected

PLED+ - on
GND - switches on and off to blink the LED

The standby behaviour shows why a different method must be used to detect switching off vs on/standby.
Dear all

I have a "special" need  :)
I just receive and tried and ITEAD808 module

It's nice!

I connect from ITEAD808
Rx to TX of Mini pro
Tx to Rx of Mini pro
PWD to pin 5 of Arduino (2sec of pulse to power the ITEAD module)
VIO (input) to VCC
DTR to 13
Ri to 6
and BAT to the RAW pin of Arduino

BAT pin is a pin connected to the Li Battery and give a power of 3.7V

ITEAD808 has a power press button the switch of/on the module which is an hard power (=to PWD)

The battery is loaded because of the USB port, so the battery should remind connected as it is.

My problem
I would like to have one switch to power on/off Mini pro AND ITEAD808. If I press the ITEAD power button, it does not turn off the Arduino because it's connected to the BAT pin. I can not have a switch between the BAT and the RAW pin because it will not switch the ITEAD.

My question
If I unconnect the VIO pin the ITEAD Rx and Tx are unactive. I suppose, if I press to ITEAD power button two sec to power it off, the ITEAD Rx and Tx are unactive.

The how can I "listen" Rx and TX to know if RX and TX are active or not.

IF there are not active, I can create a switch wich a transistor to unconnect the BAT/RAW link to unpower the system.

Do you have a better idea?

Bar Sport / Re: You can always to open my...
Last post by Nick Gammon - Today at 08:21 am
I have modified my approach to telemarketers in this way (in date order):

  • Listening to them
  • Pointing out I am on the "do not call register"
  • Saying "I'm not interested, goodbye"
  • Hanging up the phone without saying anything

I know they are just people doing a job, but I didn't install my phone, and pay for the monthly rental, to be harassed.
Deutsch / Re: Arduino - USB-Buchse abgeb...
Last post by Scherheinz - Today at 08:20 am
Weiß auch garnicht, was alle so toll an dem Nano finden! Orginal wird ihn wohl kaum noch einer einsetzen. Der ist einfach zu teuer. Allein schon wegen FTDI IC. Die Pro Minis kosten orginal keine 10€ und sind dazu noch sehr kompakt. Die meisten nachbauten aus der Bucht sind von mieser Qualität. Zu erkennen an diesen schmalen Reset Tastern. Hab davon schon welche bestellt, dass es hier nicht durchgehend zu Problemen mit Berührung vom Resettaster Gehäuse und dem Atmega kommt, ist auch alles. Es gibt aber auch Fälschungen, die dem Sparkfun sehr identisch ausssehen. Deutlich bessere Qualität und auch für 2-3€ zu bekommen.
Ich vermute mal du hast den Micro gemeint und nicht den Nano, oder?

Project Guidance / Flex Sensor Programming
Last post by robin0301 - Today at 08:19 am
Hi there! I do not understand the programming sentence for my project. Which is "int flex0to100 = map(flexSensorReading, 150, 400, 100, 0);" I do not understand what those values stands for.

I use the flex sensor to make it into a glove to produce musical chords. However, when I interface with the flex sensor, the number shown on the serial monitor when the flex sensor is flat is negative. Could you help me see if the connection is correct? (the pin with the square boxes is connected to a 27K ohm resistor than the pin with a thin line is connected to 5V in the arduino UNO pin. From the resistor, one connects to Analog Pin 0 and the other connects to ground.) Please help me with it.

That's correct . Your understanding of how to wire the solenoid is correct. Your "good to go".
The Instructable schematic is electrically correct but the visual representation is upside down. If you are new to electronics you don't need to worry about that. The convention way to represent it is like this

(Electrically the same , but visually very different. The cathode end of the diode is shown pointing up, unlike the Instructable schematic which was drawn by someone with little experience. In addition, the battery symbol would be shown at the top of the page with the positive end up connected to the + end of the solenoid and the negative end connected to GND.

I should mention that this is not usually done for the same reason I mentioned before. The contacts are going to arc, with or without the flyback diode. That's why transistors (or fets) are used for switching inductive loads. There is no arcing. As long as the solenoid doesn't draw a lot of current it should still be ok. The relay contacts are probably rated for thousands of cycles.
Did you know your LED circuit is constant current source or not ?
Actually I didn't find the ADC to be making a problem, it's the communication instead.
This is my output. The first line is the data I send ("AD0 input" "," "Time since start"). The thing is that I need to make it to be able to send 10k samples per second. Serial print is taking too much, and this is with 115200 baud. Any ideas?

AD conversion micros:   8
Serial print time :    504
Hardware / Re: Errore durante caricamento...
Last post by uwefed - Today at 08:12 am
C'è differenza tra un Atmega328p-pu è un atmega328-pu?
Come hai giá scoperto hanno dei identificatori diversi e percui non funziona. Il controller selezionalto per fare un caricamento ICSP deve corrispondere a quello collegato al programmatore.

Riguarda la scelta del componente nello shop é compito Tuo informarti delle possibilitá e differenze.
Ciao Uwe
Motors, Mechanics, and Power / Servo motor
Last post by amolamol - Today at 08:10 am
 can anyone please suggest me a servo  motor which can be used to achieve humans walking speed and speed can be controlled dynamically using arduino.
Pages: 1 [2] 3 4 ... 10