rusty360

Members
  • Content Count

    1,173
  • Joined

  • Last visited

Community Reputation

555 Excellent

About rusty360

  • Rank
    Committed

Converted

  • Local Area
    Auckland

Recent Profile Visitors

596 profile views
  1. rusty360

    Fault codes - help

    Have spoken to mazda they said they will get the same codes if they are there.
  2. rusty360

    Fault codes - help

    Was it scary expensive?
  3. rusty360

    Fault codes - help

    Hi all looking at a new daily, got it checked out and when guy did diagnostic scan these came up. Normal scan no faults. Drives great, did have the battery fail recently so that explains that one, linked I'm thinking/hoping?
  4. rusty360

    Arduino stuff/ programing/so cheap

    Thats a fantastic description, I will change the code to falling and see what happens! Im picking I just use the word FALLING?
  5. rusty360

    Arduino stuff/ programing/so cheap

    OK that makes some sense to a newbie. I thought because i was using a pull up resistor etc triggering on RISING was the way to go? should I be looking at FALLING then? Does the code look ok? Cheers for the info and help so far!!
  6. rusty360

    Arduino stuff/ programing/so cheap

    Let me know if that still doesnt work.
  7. rusty360

    Arduino stuff/ programing/so cheap

    Yep i can try. I've learnt that indents and spaces matter for python alright!! Hope that helps, the bit i wasn't 100% sure about is this - GPIO.add_event_detect(7,GPIO.RISING,callback=button_callback,bouncetime=1500) The whole rising, falling, leading edge, trailing edge confuses me a bit. The bounce time needed to be above 1100 to no register 2 button pushes as one. This is prob to do with the relay holding on for a while. Code - import constant import datetime import RPi.GPIO as GPIO # # global variable to count bags processed in current minute gBagsInMinuteCount = 0 # # function to realise if bag has been processed def button_callback(channel): print("Button was pushed!") global gBagsInMinuteCount gBagsInMinuteCount+= 1 # # write to log file every time the button is pushed # roll log every day now = datetime.datetime.now() logFilename = constant.LOG_DIR + now.strftime("%Y%m%d") + ".log" # # write to log file f = open(logFilename, "a") f.write(constant.PROCESS_ID + "," + now.strftime("%d/%b/%Y %H:%M:%S") + ",1") f.close() # # main program # initialise try: # # setup some stuff GPIO.setwarnings(False) # Ignore warning for now GPIO.setmode(GPIO.BOARD) # set up BCM GPIO numbering # # set pin 7 to be an input GPIO.setup(7, GPIO.IN) # # setup event GPIO.add_event_detect(7,GPIO.RISING,callback=button_callback,bouncetime=1500) # # main loop currentMinute = datetime.datetime.now().minute while True: # # if have moved to the next minute then update the process status file now = datetime.datetime.now() if(now.minute != currentMinute): # # write html file for current count f = open(constant.HTML_FILE, "w") f.write("<html>\n") f.write(" <head>\n") f.write(" <title>Bag Counter</title>\n") f.write(" <meta http-equiv='refresh' content='5'>\n") f.write(" </head>\n") f.write(" <body>\n") f.write(" <table style='width:100%'>\n") f.write(" <tr>\n") f.write(" <td style='text-align:center; font-size: 4000%'>{}</td>\n".format(gBagsInMinuteCount)) f.write(" </tr>\n") f.write(" <tr>\n") f.write(" <td style='text-align:center'><img src='https://www.wilcoxgoodness.co.nz/images/logo@2x.png' alt='wilcox'></td>\n") f.write(" </tr>\n") f.write(" <tr>\n") f.write(" <td style='text-align:center'>updated: " + now.strftime("%Y-%m-%dT %H:%M:%S") + "</td>\n") f.write(" </tr>\n") f.write(" </table>\n") f.write(" </body>\n") f.write("</html>\n") f.close() # # and reset the counter as is a new minute gBagsInMinuteCount = 0 currentMinute = now.minute finally: # # clean up GPIO.cleanup()
  8. rusty360

    Arduino stuff/ programing/so cheap

    Current Code - import constantimport datetimeimport RPi.GPIO as GPIO## global variable to count bags processed in current minutegBagsInMinuteCount = 0## function to realise if bag has been processeddef button_callback(channel):print("Button was pushed!")global gBagsInMinuteCountgBagsInMinuteCount+= 1## write to log file every time the button is pushed# roll log every daynow = datetime.datetime.now()logFilename = constant.LOG_DIR + now.strftime("%Y%m%d") + ".log"## write to log filef = open(logFilename, "a")f.write(constant.PROCESS_ID + "," + now.strftime("%d/%b/%Y %H:%M:%S") + ",1")f.close()## main program# initialisetry:## setup some stuffGPIO.setwarnings(False) # Ignore warning for nowGPIO.setmode(GPIO.BOARD) # set up BCM GPIO numbering## set pin 7 to be an inputGPIO.setup(7, GPIO.IN)## setup eventGPIO.add_event_detect(7,GPIO.RISING,callback=button_callback,bouncetime=1500)## main loopcurrentMinute = datetime.datetime.now().minutewhile True:## if have moved to the next minute then update the process status filenow = datetime.datetime.now()if(now.minute != currentMinute): ## write html file for current countf = open(constant.HTML_FILE, "w")f.write("<html>\n")f.write(" <head>\n")f.write(" <title>Bag Counter</title>\n")f.write(" <meta http-equiv='refresh' content='5'>\n")f.write(" </head>\n")f.write(" <body>\n")f.write(" <table style='width:100%'>\n")f.write(" <tr>\n")f.write(" <td style='text-align:center; font-size: 4000%'>{}</td>\n".format(gBagsInMinuteCount))f.write(" </tr>\n")f.write(" <tr>\n")f.write(" <td style='text-align:center'><img src='https://www.wilcoxgoodness.co.nz/images/logo@2x.png' alt='wilcox'></td>\n")f.write(" </tr>\n")f.write(" <tr>\n")f.write(" <td style='text-align:center'>updated: " + now.strftime("%Y-%m-%dT %H:%M:%S") + "</td>\n")f.write(" </tr>\n")f.write(" </table>\n")f.write(" </body>\n")f.write("</html>\n")f.close()## and reset the counter as is a new minutegBagsInMinuteCount = 0currentMinute = now.minutefinally:## clean upGPIO.cleanup() and help or info would be great as its all very very new to me!
  9. rusty360

    Arduino stuff/ programing/so cheap

    Yep definitely stays in for very short time based on the led coming on. Hold the phone caller I'll try and post the code.
  10. rusty360

    Arduino stuff/ programing/so cheap

    Just a simple mechanical one. Yep 24v ac as that's the control system on the machine.
  11. rusty360

    Arduino stuff/ programing/so cheap

    Righto so had some success today, I had another look at my circuit and realised I'd farrked up on the bread board. So I got the program running today but the debounce time needed to be set quite high 1500m/s for the program only to register one button push. I'm wondering if this is due to the closing relay being the trigger? Heres a pic of the circult now. White and grey wires go to the switch (relay) there is a cap in parallel with these. Red is 3.3v. Orange is GPIO pin. Green is ground.
  12. rusty360

    Arduino stuff/ programing/so cheap

    Hey ned, yep understand how a resistor reduces the current. I did have the system looking for a pull down but the electrical noise generated from the packing gear just made it trigger like crazy. That's why I thought I would try a pull up. This is what I have for the wiring circuit. Look ok ?
  13. rusty360

    Arduino stuff/ programing/so cheap

    Hi Ned, I've been googling this up a fair bit and cant quite work it out. I'm still getting a large amount of static affecting the pins. I found this online but cant quite work out the diagram, I read it as the green line will go to the GPIO pin, both the triangles are to ground? But this would mean the 3.3v would go straight to ground. Any help would be awesome! This is the last bit of the puzzle.
  14. rusty360

    Coil info - help

    After market based on a holden VB - VK one
  15. rusty360

    Coil info - help

    Ive actually just worked out I need a 0.5 ohm coil. the dizzy has a built in HEI unit. humm off to google i go.