Here is my Basic main code. Used GCBasic, 12F1840, ultrasonic transmitter (I had lying around). Maybe more sensitive if I had an ultrasonic receiver.
;Chip Settings #chip 12F1840 #config OSC=ECL, FCMEN=OFF ' Start: ' set wpua5 = 0 'PU off ' ultrasonic sensor on PA5 ' dir porta.0 out ' piezo dir porta.1 out ' piezo dir porta.2 out ' LED for program test ' set porta.0 0 set porta.1 1 set porta.2 0 ' Do Forever lata = lata xor 0b111 loop '
Very nice project. I am going to give it a go! The code appears ok... But I am not a 'C' guy. What does seem missing are a couple of 12F683 configuration items... Maybe preset in the author's setup. I think that something like the following needs to be included: oscon = 00 Clock source determine be Fosc config (word) - 00,03 Fosc = EC Ext clock
Hi! I'm trying to use this code to divide ultrasonic noise by 4 to put it into the audible range. I followed the code a circuit, but it still isn't outputting the reduced frequency. Has anyone else had this issue or have any suggestions?
Used GCBasic, 12F1840, ultrasonic transmitter (I had lying around).
Maybe more sensitive if I had an ultrasonic receiver.
;Chip Settings
#chip 12F1840
#config OSC=ECL, FCMEN=OFF
'
Start:
'
set wpua5 = 0 'PU off
' ultrasonic sensor on PA5
'
dir porta.0 out ' piezo
dir porta.1 out ' piezo
dir porta.2 out ' LED for program test
'
set porta.0 0
set porta.1 1
set porta.2 0
'
Do Forever
lata = lata xor 0b111
loop
'