Tuesday, 23 December 2014

Windows 8.1: How to Add a Local Account



User creation - Local Accounts

Right Click the start menu
Click “Control Panel”







Click on User Accounts and Family Safety



Click on
“User Accounts”



Click Manage another account

Add a new user in PC Settings

Click Add an Account

Click sign in without Microsoft Account

Click “Local account”

Enter your login Details

Then Click “Next”

Select if you require child filters

Then Click “Finish”


You have successfully added a new local account

Windows 8.1: Updating Driver on an R9 290



Example: Installing device drivers post installation


Once you are windows right click the start menu and click device manager



Right click on devices with a “!” on top of them and click
“update device driver”


And click Browse my computer and point the driver update at the correct location


Insert you manufacturer’s disc or have the downloaded driver file available and point the driver installer at the right location.

Then click next



Click OK and the end of the process

Repeat the process on all components that do not have drivers installed

               



Windows 8.1: Installation Notes



Windows 8.1 minimum System requirements


·         Processor: 1 gigahertz (GHz) or faster with support for PAE, NX, and SSE2
·         RAM: 1 gigabyte (GB) (32-bit) or 2 GB (64-bit)
·         Hard disk space: 16 GB (32-bit) or 20 GB (64-bit)
·         Graphics card: Microsoft DirectX 9 graphics device with WDDM driver

Windows 8.1 Versions


Windows 8.1: This is the standard edition, and it will run on desktops, laptops, and some tablets.

Windows 8.1 Pro: This gives you all of the features of Windows 8.1, as well as some extra features intended for advanced users and businesses. For example, people who need more security can use BitLocker to encrypt their files.

You can buy windows online and create a flash stick or DVD disc.  It is possible to upgrade from earlier versions of windows to windows 8 without any discs too.  I would recommend a fresh installation if you want to maximise your performance potential.  Get windows 8.1

Boot process


Start the computer with the flash stick or the DVD for windows 8 in the drive.  If a windows 8 logo does not appear, you will have to find specific information on how to enable a boot override to start the setup from the media you have selected.

Be patient on the initial boot of the windows 8 disc, an image will sit on the screen for quite a while.  There is no progress bar without an SSD or dated hardware in the installation procedure can be slow to get started.  The computer will restart several times before launching the operating system for the first use.

Sunday, 11 May 2014

Sainsonic Arduino Mega 2560 SD Card Shield SDFat Config

If you've tried to get your sainsonic SD shield to work with sdfat you would have probably read about people modifying there board to match the pins of software.


DON'T BE SO SILLY!
EVERY PIN CAN BE CONFIGURED!

1. Got to your arduino libraries folder and go to your SDFAT Folder

2. Open File SdFatConfig.h

3. Got the last few lines and change you're to match this -

#define USE_SOFTWARE_SPI 0
// define software SPI pins so Mega can use unmodified 168/328 shields
/** Default Software SPI chip select pin */
uint8_t const SOFT_SPI_CS_PIN = 53;  
/** Software SPI Master Out Slave In pin */
uint8_t const SOFT_SPI_MOSI_PIN = 52;
/** Software SPI Master In Slave Out pin */
uint8_t const SOFT_SPI_MISO_PIN = 50;
/** Software SPI Clock pin */
uint8_t const SOFT_SPI_SCK_PIN = 51;
#endif  // SdFatConfig_h


4.  Now edit any SDFAT demo file to initialize on pin 53 -
      sd.begin(53, SPI_HALF_SPEED)


Sainsonic Mega 3.2" TFT LCD Fault arduino Pixelation glitch won't display UTFT

Hi Guys,
 I've had a few problems with my Sainsonic Arduino Mega 2560 board with the 3.2" Touch screen. Most of them are related to the undersized voltage regulator on it once it had got a bit hot a few times for too long.

By using my Freetronics Eleven boards regulator bridging to the Sainsonic board I  have completely eliminated the glitched pixels while drawing, which once I had a big program running on the unit would become apparent.




 The Sainsmart Mega Board below can be seen with the smaller voltage regulator.  You should also notice that it still retains reference layout for the pin holes around the regulator for convection and cooling, despite having a different size and location regulator...

You get what you pay for people!  If you have a Sainsonic  arduino mega product and have obvious screen draw errors, or a white screen I'd recommend upgrading to an external regulator and you probably have a much better experience with your unit.







Monday, 23 December 2013

Sainsonic arduino mega touchscreen bmp Image viewer example

Hey,
Here's the demo file I've promised, Hope you enjoy.

Allows the user to scroll between bmp images on a SD card using SD Class and Custom event handlers to suit the non genuine chip on the Sainsonic Screen.

Works with the 3.2" Touchscreen Provided by sainsonic with the


/*
Arduino Mega Sainsmart 3.2 TFT Touchscreen Demo
Written & Adaption of demo Source from Sainsmart
By BJ Smith
http://technomungo.blogspot.com.au
If this Helped you, donate me a few feathercoins @

6tCqWb5C65BfXXEw6yrKBHP8uMx8imW68Y

Explanation:

Cycle through all bitmap images in /images on flash card
Images must be even in dimensions and have 24bit colour

Will explore this glitch at some point.

Demonstrates seeking to data bits to display Bitmap display.

Was written due to the limitation of SDFAT Not allowing me to
load images out of the root directory.

Known Issues:
Images must be even in dimensions.
Doesn't white out the screen before displaying next image,
so if next image is smaller it'll leave some portion of the old image.
Will cover over the menu if the image is too big.

If you need consultation or help on your project I am available
at reasonable rates.
*/

#include "UTFT.h"
#include "SD.h"

//TOUCH SCREEN PINS
#define DCLK     6
#define CS       5 
#define DIN      4
#define DOUT     3
#define IRQ      2


#define SCREEN_WIDTH 320
#define SCREEN_HEIGHT 240

#define SD_PIN 53 

extern uint8_t SmallFont[];
extern uint8_t BigFont[];

int Image_Current = 0;
File root;
boolean isloading = false;
boolean backwards = false;
int lastfile = -1;
volatile boolean screenpressed = false;
unsigned int TP_X,TP_Y;

UTFT myGLCD(GEEE32, 38, 39, 40, 41);

void ShowMessage(const char* msg1, const char* msg2 = 0)
{
    myGLCD.setColor(255, 0, 0);
    myGLCD.fillRoundRect(55, 190, 265, 230);
    myGLCD.setColor(255, 255, 255);
    myGLCD.setBackColor(255, 0, 0);
    myGLCD.print(msg1, CENTER, 196);
    if (msg2) myGLCD.print(msg2, CENTER, 210);
}

void LoadImage(File& file)   //This does have a glitch, you need to have images with even dimensions.
{
    
      //READ THE HEADER
      int header  = file.read();
      int header2  = file.read();
      int xoff = 0;
      int yoff = 0;
      if (header == 66 && header2 == 77) //Check if header = BM
      {
          file.seek(0x1C); //OFFSET FOR COLOR BITS
          word  BPP = read32(file); 
          if ( BPP ==0x18) //CHECK IF 24bit for TFT
          {
                file.seek(0x12); //OFFSET TO DIMENSIONS
                word  height = read32(file);
                word  width = read32(file);
                xoff = SCREEN_WIDTH/2-(int)width/2; //USED TO CENTER THE IMAGE
                yoff = SCREEN_HEIGHT/2-(int)height/2;
                file.seek(0xA); //OFFSET TO DATA OFFSET
                word bitmapOffset =  read32(file);
                file.seek(bitmapOffset); //SEEK TO READ POSITION
                for (int y = (int)width; y > 0 ; y--)
                    {
                        for (int x = 0; x < (int)height ; x++)
                        {
                            byte b = file.read();
                            byte g = file.read();
                            byte r = file.read();
                            myGLCD.setColor(r,g,b);
                            myGLCD.drawPixel(x+xoff,y+yoff);
                        }
                     }
                    
           
          }
        
      }
      else
      {
         if (backwards)
         {
             previmage();
         }
         else
         {
             nextimg();
         }
      }
  }
   



void WalkDirectory(File dir)
{
        File entry = dir.openNextFile();
        if (! entry) {
            // no more files
            lastfile = Image_Current;
           
        }
        if (entry.isDirectory()) {
            WalkDirectory(entry);
        }
        else {
           
            if (lastfile != Image_Current)
            {
                ShowMessage(entry.name());
            }
           
            LoadImage(entry);
        }
        entry.close();
 
}

void spistar()                                     //SPI Start
{
  digitalWrite(CS,HIGH);
  digitalWrite(DCLK,HIGH);
  digitalWrite(DIN,HIGH);
  digitalWrite(DCLK,HIGH);

}
//**********************************************************
void WriteCharTo7843(unsigned char num)          //SPI Write Data
{
  unsigned char count=0;
  unsigned char temp;
  unsigned nop;
  temp=num;
  digitalWrite(DCLK,LOW);
  for(count=0;count<8;count++)
  {
    if(temp&0x80)
      digitalWrite(DIN,HIGH);
    else
      digitalWrite(DIN,LOW);

    temp=temp<<1;

    digitalWrite(DCLK,LOW);               
    nop++;
    nop++;
    digitalWrite(DCLK,HIGH);
    nop++;
    nop++;
  }
}

//**********************************************************
unsigned int ReadFromCharFrom7843()             //SPI Read Data
{
  unsigned nop;
  unsigned char count=0;
  unsigned int Num=0;
  for(count=0;count<12;count++)
  {
    Num<<=1;
    digitalWrite(DCLK,HIGH);//DCLK=1; _nop_();_nop_();_nop_();               
    nop++;
    digitalWrite(DCLK,LOW);//DCLK=0; _nop_();_nop_();_nop_();
    nop++;
    if(digitalRead(DOUT)) Num++;
  }
  return(Num);
}

void AD7843(void)             
{
  digitalWrite(CS,LOW);                   
  WriteCharTo7843(0x90);
  digitalWrite(DCLK,HIGH);
  digitalWrite(DCLK,LOW);
  TP_Y=ReadFromCharFrom7843();
  WriteCharTo7843(0xD0);  
  digitalWrite(DCLK,HIGH);
  digitalWrite(DCLK,LOW);
  TP_X=ReadFromCharFrom7843();
  digitalWrite(CS,HIGH);
}

void setup()
{
  Serial.begin(9600);
  for(int p=22;p<42;p++)
  {
    pinMode(p,OUTPUT);
  }
  for(int p=2; p<7;p++)
      pinMode(p,OUTPUT);
  pinMode(DOUT,INPUT);
  pinMode(IRQ,INPUT);
 
    // Setup the LCD
    myGLCD.InitLCD();
  
    myGLCD.setFont(BigFont);
    myGLCD.fillScr(255, 255, 255);
    //BACK BUTTON
    myGLCD.setColor(255, 0, 0);
    myGLCD.fillRoundRect(10, 190, 50, 230);
    myGLCD.setColor(255, 255, 255);
    myGLCD.setBackColor(255, 0, 0);
    myGLCD.print("<", 25, 202);
    //FORWARD BUTTON
    myGLCD.setColor(255, 0, 0);
    myGLCD.fillRoundRect(270, 190, 310, 230);
    myGLCD.setColor(255, 255, 255);
    myGLCD.setBackColor(255, 0, 0);
    myGLCD.print(">", 285, 202);
   
    spistar(); //setup the Touchscreen
    pinMode(SD_PIN, OUTPUT);
    if (!SD.begin(SD_PIN))
    {
        ShowMessage("SD not ready");
        return;
    }
    attachInterrupt(0, screentouched, FALLING);
    root = SD.open("/images");
    WalkDirectory(root);

}
void screentouched()  //TOUCH SCREEN EVENT HANDLER
{
      noInterrupts();
      if (!screenpressed)
      {
         screenpressed = true;
        
      }
      interrupts();
}
void checkscreen()
{
         
     unsigned int lx,ly;
     int runningy =0; //Cumlative total
     int ycount =0; //Divisor
     int runningx =0; //Cumlative total
     int xcount=0; //Divisor
     int dud = 0; // Count of out of range data

     while (xcount <10 ||ycount <10)  //This performorms multpile measurements, throws out the duds and
     {
           if (dud >5) break; //bail if press is glitchy
           AD7843();
           int yavg =((TP_X-340)*10/144)+2;  //Landscape, so the Vals are swapped
           int xavg =((TP_Y-320)/11);
           if  (yavg >=0&& yavg <=240)
           {
                 runningy+=yavg;
                 ycount++;
                 
           }
           else
           {
                 dud++;
           }
            if  (xavg >=0&& xavg <= 320)
           {
                 runningx+=xavg;
                 xcount++;
           }
            else
           {
                 dud++;
           }
     }
     ly = (int)runningy/ycount;
     lx = (int)runningx/xcount;
    
     Serial.print("X,Y:");
     Serial.print(lx);
     Serial.print(",");
     Serial.println(ly);

     if (lx >= 270 && lx <= 310 && ly >= 190 && ly <= 230)  //IF NEXT BUTTON 270, 190, 310, 230
     {
            backwards =false;
            nextimg();
     }
     else
     {
          if (lx >= 10 && lx <= 50 && ly >= 190 && ly <= 230)  //IF BACK BUTTON 10, 190, 50, 230
            {
                backwards = true;
                previmage();
            } 
                 
     
     }


}
void loop()
{

   if (screenpressed)
         {
            checkscreen();
            delay(100);  //Wait to remove double press in some circumstances (not on this example)
            screenpressed= false;
         }
}

void nextimg()
{
    myGLCD.setColor(24, 0, 255);
    myGLCD.print(">", 285, 202);
    WalkDirectory(root);
    if (lastfile >0)  //Don't overrun the bounds of folder.
    {
        if (lastfile != Image_Current)
        {
            Image_Current++;
        }
      
    }
    else
    {
        Image_Current++;
    }

    myGLCD.setColor(255, 255, 255);
    myGLCD.print(">", 285, 202);

}
void previmage()
{
   if (Image_Current >0/*&&!isloading*/)
    {
         Image_Current--;
         myGLCD.setColor(24, 0, 255);
         myGLCD.print("<", 25, 202);
        
         root.rewindDirectory();
         for (int i = 0; i <Image_Current; i++)
         {
             root.openNextFile();
         }
         WalkDirectory(root);
         myGLCD.setColor(255, 255, 255);
         myGLCD.print("<", 25, 202);
     }
 
}

uint16_t read16(File f)
{
    uint16_t result;
    ((uint8_t *)&result)[0] = f.read(); // LSB
    ((uint8_t *)&result)[1] = f.read(); // MSB
    return result;
}

uint32_t read32(File f)
{
    uint32_t result;
    ((uint8_t *)&result)[0] = f.read(); // LSB
    ((uint8_t *)&result)[1] = f.read();
    ((uint8_t *)&result)[2] = f.read();
    ((uint8_t *)&result)[3] = f.read(); // MSB
    return result;
}