bluejets wrote: 05 Jul 2020, 00:33
I took a quick look at how you might approach the changeover to the ATtiny85 and it became immediately obvious that there would be a pin shortage as compared to the Arduino if all aspects were covered. I just imagined you might have in mind to use P1(D1) both as an LED output for the original purpose and then somehow switch it to servo out later in the program.
I did consider using the built-in LED pin for both LED duties and driving the servo output, but I thought it might upset some servos causing them to go to full travel. I also thought about using the LED on either the rudder or Aux inputs from the receiver. I don't think that would damage any receivers, but in the very unlikely worst case, depending on which receiver channels had been used, it might just switch some receivers into bind mode. The LED probably won't be all that visible, once the Digispark is inside a case, and the user will know that the gyro is calibrating anyway, because the servo won't move until the calibration is complete, so I decided not to bother with the LED.
Would do some flight testing however, with my Mum and Dad situation at present, time is short.
That plus the eye specialist bloke I build UV units for is opening a new office and needs another unit so busy busy for me at the moment.
Having said that, I'll fit in what I can.
Hope your Mum and Dad situation improves soon, and good luck with your work!
The GY521 board I have here already have 2K2 pullups to the 3v3, so are you saying they require additional pull up resistors ?
That's interesting. I did find I needed additional pull ups on my breadboard rig for reliable operation. However, I did have the USBASP connected to the SDA and SCL lines, as well as the gyro, and I was also using the USBASP to power everything ( including the servo

) so I'll do some more tests later with the programmer unplugged and a better power supply. Maybe the external pull ups won't be needed then.
Assume your pin numbers in the comments (3,4 and 1) are same as D0 to D4 below.??
Yes, sorry, I tend to be a bit careless about 'pin numbers'. I was using them to mean the usual Digispark and Arduino 'D numbers' - not the physical pin numbers on the I.C.
I now realize that, because SoftwareSerial conflicts with pinchange interrupts, so that the AUX input can't be used when in DEBUG mode, it would be more sensible to move the SoftwareSerial debug output to the AUX pin instead of the servo pin, so I'll do that. Also, I'll make the debug output more comprehensive.
I also thought that once the gubbins are inside a case, the case will be not-quite-a-cube, plus the wires have to exit somewhere, so I'll add a configuration option to select any of the gyro's three axes to be used as the control axis - that will allow the gyro to be mounted any way up by editing the configuration. I'll probably separate out the configuration options into their own file too.
Because the user might want to edit the configuration, and possibly also upload future improved versions of the program, we need to have all the 'programming wires' outside the case. Of course, three of the six necessary wires are available anyway, because one of them doubles up as an input from the receiver (I'll probably make that the 'AUX' input), and there are the two power lines.
I'm thinking of having short leads with plugs that, for normal operation, will plug into receiver channels (or servo extension leads to receiver channels) for the two 'inputs' and a short lead with a servo socket for plugging in the servo (again with an extension lead if necessary).
The remaining 'programming wires' (RST, MOSI, MISO) will run to their own connector. For configuring or programming the gyro, the user will need a USBASP with a custom harness to connect to the 'programming connector' and (probably) the AUX receiver plug.
I'm intending to wire the positives from the receiver and the positive out to the servo to the Digispark's VIN pin. That means the user can run the unit at any normal model voltage: 4.8, 5, 6, 7.2, etc. When running at 4.8V the Digispark and the power out to the Gyro board will only be running at about 4V, because of the volt drop across the Digispark's regulator. But it seems to run perfectly reliably at that. I'll test the actual drop-out voltage later.