Posts

32 servo control

Image
// ServoOverdone.ino // // Example for multiple Servo objects in a array. // // Version 1, 28 July 2021, by Koepel. // Version 2, 15 August 2021, by Koepel. // changed timing, a little slower // diagram.json has servos in reverse order (I think it is visually better) // Added fourth sequence: "compass" // // Public Domain // // This example is made with Wokwi. #include #define NUM_SERVOS 32 Servo myServo[NUM_SERVOS]; void setup() { // Attach pins from the Arduino Mega board to the Servo objects. // Starting from pin 22, there happen to be exactly 32 pins on the double row pins. for( int i=0; i =0; r--) { for( int i=0; i (NUM_SERVOS / 2)) d = NUM_SERVOS - d; int angle = 90 - (10 * d); if( angle =0; i--) { float rotate = float( i) * (360.0 / float( NUM_SERVOS)); float rad = rotate / 360.0 * 2.0 * M_PI; float top = (300.0 * sin( rad)) + 300.0; float left = (300.0 * cos( rad)) + 300.0; Serial.print( " {\n"); Serial.print( " \"type\...

Arduino based personal gps

Image
GPS model EM486 , arduino uno and 20*4 lcd few connecting wires will do connect 4,6,11,12,13,14 to 8,9,10,11,12,13 of arduino .Here is the sample code for displaying latitude and longitude #include #include /* This sample code demonstrates the normal use of a TinyGPS object. It requires the use of SoftwareSerial, and assumes that you have a 4800-baud serial GPS device hooked up on pins 3(rx) and 4(tx). */ GPS gps; SoftwareSerial ss(3, 4); void setup() { Serial.begin(115200); ss.begin(4800); Serial.print("Simple TinyGPS library v. "); Serial.println(TinyGPS::library_version()); Serial.println("by Mikal Hart"); Serial.println(); } void loop() { bool newData = false; unsigned long chars; unsigned short sentences, failed; // For one second we parse GPS data and report some key values for (unsigned long start = millis(); millis() - start

Arduino based personal gps

arduino based digital compass

Image
arduino based digital compass using cmp03 compass sensor

digital compass using cmp03 sensor

Image
sample code for compass in assembly SEND_START: ; SETB _2W_BUSY ; INDICATE THAT 2WIRE ; OPERATION IN PROGRESS CLR ACK ; CLEAR STATUS FLAGS CLR BUS_FAULT ; JNB SCL,FAULT ; CHECK FOR BUS CLEAR JNB SDA,FAULT ; BEGIN START CONDITION SETB SDA ; LCALL SCL_HIGH ; SDA CLR SDA ; ; LCALL DELAY ; SCL ^START CONDITION CLR SCL ; RET ; FAULT: SETB BUS_FAULT ; SET FAULT STATUS ...

dot matrix display system

Image
dot matrix display board